我有一个非常简单的web.xml文件:Glassfish服务器欢迎文件不起作用?
<?xml version="1.0" encoding="UTF-8" ?>
<web-app 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"
version="3.1">
<welcome-file-list>
<welcome-file>abcd.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>foo</param-name>
<param-value>bar</param-value>
</context-param>
</web-app>
,我有我的应用程序2 JSP文件hello.jsp中和abcd.jsp。
我部署war文件到GlassFish服务器,上下文根是 “novone”
当我去为localhost:8080/novone我看到的hello.jsp,不abcd.jsp ...
在GlassFish管理面板(local4848 /普通/ index.jsf)应用程序 - > novone-> Descriptor->描述-文件我看到:
<?xml version="1.0" encoding="UTF-8" ?>
<web-app 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"
version="3.1">
<welcome-file-list>
<welcome-file>abcd.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>foo</param-name>
<param-value>bar</param-value>
</context-param>
</web-app>
怎么来的hello.jsp供应,而不是abcd.jsp?
当我手动转到/novone/abcd.jsp时,我可以看到从应用程序范围加载的值“bar”。
哪个版本的Glassfish? – unwichtich 2014-11-03 21:24:22
@unwichtich版本4.1 – 2014-11-03 21:27:57