aspose file tools*
The moose likes Struts and the fly likes should global forward be handled by action forward? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "should global forward be handled by action forward?" Watch "should global forward be handled by action forward?" New topic
Author

should global forward be handled by action forward?

Tony Smith
Ranch Hand

Joined: Jul 07, 2007
Posts: 229
Seems like via global forward you can just define:

<forward name="logon" path="/logon.jsp"/>

and <html:link name="logon"/> should take you to logon.jsp.

But sometimes I see people do extra step of having:

<forward name="logon" path="/logon.do"/>

and essentially /logon.do doesn't do anything except also forward to logon.jsp. Is there any reason that you should involve action with this kind of simple forward?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It is considered a best practice to "hide" JSP files from the user, meaning never show a URL that directly references a JSP file. In fact it is a good idea to add a secuirty constraint to the web.xml file such that it isn't even possible to access a JSP file directly.

There are a number of reasons for this. One is that you don't want a potential hacker to know the file structure of your website. Another is that even though you currently have no processing that has to occur before the login.jsp page is displayed, you may want to add some later. If the user has bookmarked the JSP page, the link will fail.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: should global forward be handled by action forward?