On Tue, Feb 27, 2001 at 12:07:15PM -0500, Maya Muchnik wrote:
> Hi,
> Do you have any ideas how registration.jsp file (struts-example) can be
> changed to handle a situation when a user call it directly. I do not "like" a
> SevletException to be displayed:
> 
> Error: 500
> Location: /struts-example/registration.jsp
> Internal Servlet Error:
> 
> javax.servlet.ServletException: No bean found under attribute key
> registrationForm.....A LOT OF ERRORS MESSAGES
> 
> It is better to display some "friendly" error message or return to login.jsp.
> 
> Maya
> 
To avoid situations when a user targets directly to view page I see
three strategies:

1. Take all your view pages under WEB-INF.
2. Use container managed security and disable access to directories
   where your view pages reside (thes will be available only for
   servlet dispather's forwarding/including).
3. Place a logic at the start of your view pages which checks the
   calling URL and redirects/forwards to the appropriate controler
   action.

Each of them has their odds but couldn't find a better solution so far.
                                                              incze

Reply via email to