When I was using JBoss 7.1.1 I could display a JSP page doing something like that :
@WebServlet("/path")
public class Controller extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.getServletContext().getRequestDispatcher("/WEB-INF/login.jsp").forward(request, response);
}
}
But when I do the same thing with WildFly 9.0.2 it's not working and I have the following error :
15:55:40,264 DEBUG [org.jboss.resteasy.core.SynchronousDispatcher 60] (default task-2) PathInfo: /WEB-INF/login.jsp
15:55:40,269 WARN [org.jboss.resteasy.core.ExceptionHandler 135] (default task-2) failed to execute: javax.ws.rs.NotFoundException: Could not find resource for full path: http://localhost:8080/myapp-web/WEB-INF/login.jsp
at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:112) [resteasy-jaxrs-3.0.11.Final.jar:]
at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43) [resteasy-jaxrs-3.0.11.Final.jar:]
at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48) [resteasy-jaxrs-3.0.11.Final.jar:]
...
My web.xml file is almost empty :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
</web-app>
How to do it working with WildFly 9 ?