• Post Reply Bookmark Topic Watch Topic
  • New Topic

aliasing JSP files  RSS feed

 
John Ray Allen
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using tomcat5 and apache and i want to alias my JSP files in order for me to shorten the URL..where exactly should i make changes? want to hear your opinions regarding this matter..thanks guys
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the same as mapping servlets.
Declare the servlet. Eexcept in this case, replace the servlet-class element with the jsp-file element.

Map the servlet.
 
John Ray Allen
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i already have a web.xml file, do i have to add this code? what if I want more URL to be aliased?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it goes in web.xml and you can add as many mappings (aliases) for each servlet as you want.

NOTE: Depending on the spec version of the container you're using, the order of elements in web.xml may or may not matter. Consult the spec for the proper order.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!