How to hide .jsp extension or change display name on URL?
I'm using servlet-jsp communication. my web.xml code is
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>pub</servlet-name>
<jsp-file>/publications.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>pub</servlet-name>
<url-pattern>/publications</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>SciArchive</servlet-name>
<servlet-class>controller.SciArchiveController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SciArchive</servlet-name>
<url-pattern>*.sci</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>home.jsp</welcome-file>
</welcome-file-list>
</web-app>
I want to hide .jsp extenstion in URL ..../SciArchive/publications.jsp
to ..../SciArchive/publications
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…