ZZZ
ZZZ

Reputation: 1545

How to remove .JSP extension for all JSP page on a project

I create a project with JSP using Eclipse EE. How to remove all .JSP extension? For example, localhost:8080/Project/signin.jsp to localhost:8080/Project/signin

Besides remove the JSP extension, can I access it with different name, like localhost:8080/Project/login

Upvotes: 2

Views: 1417

Answers (1)

Rahul Tripathi
Rahul Tripathi

Reputation: 172548

You can try to use servlet-mapping

<servlet>  
     <servlet-name>Project</servlet-name>  
     <jsp-file>signin.jsp</jsp-file>  
</servlet>  
<servlet-mapping>  
     <servlet-name>Project</servlet-name>  
     <url-pattern>/signin</url-pattern>  
</servlet-mapping> 

or you can use the UrlRewriteFilter

Upvotes: 3

Related Questions