Glassfish url mapping

感情迁移 提交于 2020-01-07 08:53:05

问题


I have some question about mapping url in Glassfish 4.

here is my project structure http://postimg.org/image/5gdyiassj/

as you can see I don't have eshop folder, but in my project there is a redirect to this folder.

I tried to place this code web xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <display-name>Test MVC Project</display-name>
<description>
E-bookshop example for
Beginning JSP, JSF and Tomcat: from Novice to Professional
</description>
    <servlet>
        <servlet-name>EBookshopServlet</servlet-name>
        <servlet-class>
            ebookshop.ShoppingServlet
        </servlet-class>

    </servlet>

  <servlet-mapping>
        <servlet-name>EBookshopServlet</servlet-name>
        <url-pattern>/eshop</url-pattern>
    </servlet-mapping>
</web-app>

into WEB-INF folder but it still shows this http://postimg.org/image/8zbsatf0f/

So, where is my mistake, what is I am doing wrong?

来源:https://stackoverflow.com/questions/31709601/glassfish-url-mapping

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