问题
On my web.xml I have the following code
<servlet>
<servlet-name>controller</servlet-name>
<servlet-class>ControllerServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>controller</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>controller</servlet-name>
<url-pattern>/url/*</url-pattern>
</servlet-mapping>
To enter into the servlet the url has to be like : htp://ee:8080/ER/index.do or htp://ee:8080/ER/url/888. I want to get enter by a route like htp://ee:8080/94353.
I've tried a lot of possibilities but I can't find the correct one.
Thank you!
回答1:
I think you can't omit the application name from URL because in the URL you need to define the IP address of the server and the port number, in server there are a lot of applications are deployed in it. you need to tell server which application you want to access
来源:https://stackoverflow.com/questions/27746360/servlet-web-xml-servlet-mapping