Actually make it:
<%
if (request.getMethod().equals("GET")) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
// Make sure return is here to STOP all processing - otherwise
// You'll probably see IllegalStateExceptions
return;
}
-Tim
Paul Taylor wrote:
Thanks Tim
For all non JSTLers I added this to my page:
<%if (request.getMethod().equals("GET")) {
response.sendError(HttpServletResponse.SC_NOT_FOUND); } %>
Tim Funk wrote:
The easy way is to make start.jsp a GET and all the other pages POST.
When pages are bookmarked - they are asked for via GET requests. Code
you JSP to look for the request method. If the method is NOT POST,
then redirect them to some error page. (Or the start page)
For example, in JSTL (but not verified)
<c:if test='${"POST" ne pageContext.request.method}'>
<c:redirect url="start.jsp" />
</c:if>
-Tim
Paul Taylor wrote:
Point taken regarding images.
But is this the only way to protect jsp ?
I have a directory structure as follows
/jsp/feedback/start.jsp
/jsp/feedback/finish.jsp
I want them to be able to bookmark start.jsp and access it either
through the interface or directly from the url. but I dont want them
to access
finish.jsp directly because it doesnt make any sense as it is is only
shown after processing start.jsp.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]