【发布时间】:2015-01-07 13:55:41
【问题描述】:
我是 java spring 和 glassfish 4.1 的新手 .. 我的应用程序在 glassfish 中部署成功,但浏览错误 404 ..
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>
【问题讨论】:
-
尝试使用管理控制台,然后是 Applications -> 你的应用程序并检查它部署在什么上下文中。
-
我尝试了管理控制台,也从那里启动,但同样的错误
-
您使用的确切网址是什么?
-
那么我敢打赌你的 url-pattern 与那个 URL 不匹配
标签: java spring-mvc glassfish netbeans-8