This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes How to hide .jsp extension? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to hide .jsp extension?" Watch "How to hide .jsp extension?" New topic
Author

How to hide .jsp extension?

Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Hello friends..

iam curious, is there any way to hide .jsp extension?
example i want to access an Url http://localhost:8080/MyApplication/mypage.jsp ..
is it possible to go that URL only by write http://localhost:8080/MyApplication/mypage (Without .jsp extension)?..
(its look like servlet)..

Thanks in advance..


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
One way I can think of, is to register a jsp in web.xml, like you do for a servlet and specify 'mypage' in the <url-pattern>

Ex:


Blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
I recommend you read this article. It explains how web apps should be structured in a way so that JSPs are never the primary targets of client accesses to begin with.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to hide .jsp extension?
 
Similar Threads
servlet URL
Redirect and RedirectAction result types
where to map the domain name in Tomcat?
How to hide action "extension" in URL? (Struts2)
JBoss & Tomcat integration - endless problem