wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to hide .jsp extension?" Watch "How to hide .jsp extension?" New topic

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>


Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41124
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
How to hide action "extension" in URL? (Struts2)
where to map the domain name in Tomcat?
JBoss & Tomcat integration - endless problem