This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Struts and the fly likes URL Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "URL Pattern" Watch "URL Pattern" New topic
Author

URL Pattern

ramji srinivasan
Greenhorn

Joined: Aug 22, 2005
Posts: 11
hi

i want to know whether we can change the URL patttern in web.xml from *.do to *.jsp.i want my firt page of my site to be in *.jsp instead of *.do.

Thanks & regards
Ramji Srinivasan
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The "*.do" in the web.xml file causes any request that ends in .do to be routed to the Struts ActionServlet where it can be routed to the appropriate Struts Action class. This does not prevent a user from calling a JSP page directly. So, without making any changes to the web.xml, you can call myServer/myApp/myFirstPage.jsp and it will work just fine as long as myFistPage.jsp doesn't require any pre-processing to be displayed correctly.

Changing the "*.do" to "*.jsp" would be a really bad idea and would not have the desired effect at all.


Merrill
Consultant, Sima Solutions
pax smith
Ranch Hand

Joined: Dec 13, 2005
Posts: 45
Hi

*.do is a convension. You can use anything. But use of *.jsp is not good because after that you JSP is something used for only jsp files only whereas *.do is used to redirect to Struts action. Moreover if you want to call JSP then you can call them directly i.e abc/xyz.jsp there is no problem in that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URL Pattern