Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to hide .jsp extension?

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic