You should be able to refer to the JSP using a relative URL from any
other page. It is just a question of making sure that the relative URL
reflects the relative locations of the referring action/page, and the
target page.
Regards,
Phil
In the web frameworks example, there is now a JSP-only module which
has the following Spring definition:
<web:mapping>
<web:to-module prefix = "/jsp" setContextPath="true"/>
<web:to-handler extension = "jsp" servletName="jspServlet"/>
<web:to-handler extension = "gif" servletName="jspResources"/>
<web:to-handler extension = "css" servletName="jspResources"/>
</web:mapping>
<web:servlet id = "jspResources"
servletClass = "org.impalaframework.web.servlet.ResourceServlet"/>
<web:jsp-servlet id="jspServlet"/>
The setContextPath attribute means that requests which are mapped to
the module using the '/jsp' prefix will have the context path
(HttpServletRequest.getContextPath()) equal to the application path
plus /jsp (e.g. /webframeworks/jsp).
In this case, the URL:
http://localhost:8080/webframeworks-host/jsp/hello.jsp
is mapped to hello.jsp, which is in the 'default' package in
webframeworks-jsp module's classpath.
For resources, this works similarly. The stylesheet
http://localhost:8080/webframeworks-host/jsp/css/style.css
is mapped to style.css, contained within the 'css' package.
Phil