aspose file tools*
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
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: 39547
    
  27
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 - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to hide .jsp extension?
 
Similar Threads
JBoss & Tomcat integration - endless problem
Redirect and RedirectAction result types
How to hide action "extension" in URL? (Struts2)
where to map the domain name in Tomcat?
servlet URL