File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL Pattern

 
ramji srinivasan
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
pax smith
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic