This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Setting Friendly URLs for applications in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Setting Friendly URLs for applications in Tomcat" Watch "Setting Friendly URLs for applications in Tomcat" New topic
Author

Setting Friendly URLs for applications in Tomcat

Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Dear All,

Can somebody please tell me, how do we set friendly URLs to the applications running on our Tomcat server?

Thanks in advance.

Cheers,
Ram.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
What is a "friendly URL" ?


Ping & DNS - updated with new look and Ping home screen widget
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi Ulf,

Sorry, that I should made it a bit more elaborate.

We have an application, deployed in a server....say for example it takes the URL "http://localhost:8080/myworld/utils/MyUtils.jsp.

I would like to access the application, just by typing "myutils".

Is there any way, we can achieve this?

Cheers,
Ram.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
Using <servlet-mapping> in your web.xml you can define a servlet that listens to "myutils", which then forwards to the JSP.
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Many a thanks Ulf, shall try this and let you know
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting Friendly URLs for applications in Tomcat
 
Similar Threads
SEO friendly URLs with Struts
Tomcat on Linux
Is there a mod_rewrite for Tomcat to make URLs SEO friendly?
get parameter in Servlet in different way
JForum nice urls (as on Java Ranch)