Hide JSP extension in Java

Home > Search
  by

The following can be placed in your web applications web.xml file so that your search.jsp can be accessed by navigating to www.example.com/search (no .jsp extension).

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

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments