Mike,
If you specify the following, the jspTest.jsp
will be displayed when you call the URL
http://myserver.com/myApp/test.do. This is done without writing an Action class.
<action path="/test" forward="/WEB-INF/jsp/jspTest.jsp" />
Furthermore, if you specify the following forward with any other action, it will be successful:
<forward name="failure"
path="/WEB-INF/jsp/jspTest.jsp"/>
If you specify a forward without redirect=true,
Struts uses the ServletContext's RequestDispatcher to forward the request to the specified JSP. The RequestDispatcher does have access to files inside the /WEB-INF directory, so it can display the JSP with no problems.
If you put redirect=true in a forward, it uses the sendRedirect() method on your HttpServletResponse object, which simply sends a message back to the browser to redirect to another URL. Since the /WEB-INF directory is protected from any access by the browser, you will get an error message if you try to redirect to any page under the /WEB_INF directory.
Is this making sense now?
[ May 05, 2006: Message edited by: Merrill Higginson ]