Servlet web.xml servlet-mapping

谁都会走 提交于 2019-12-11 13:40:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!