简体   繁体   中英

unable to redirect to web-inf folder . resource not found

Am having trouble trying to access my application showing a 404 error, resource not found. am using spring 5, maven and netbeans dispatcher-servlet.xml

  <bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
    <property name="prefix" value="/WEB-INF/" />
    <property name="suffix" value=".xhtml" />
</bean>

web.xml

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/config/root-config.xml </param-value>
</context-param>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/config/root-config.xml </param-value>
</context-param>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet><welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>*.xhtml</param-value>
</context-param>

/web pages/index.jsp

 <% response.sendRedirect("pages/login");%> 

login.xhtml

/web pages/WEB-INF/login.xtml

pom.xml (maven)

您的login.xhtml文件位置应为/web WEB-INF/pages/login.xtml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM