(顺便说一句,我正在使用WebSphere 7)
我有一个带有基本身份验证和安全约束的java Web应用程序(如下所示)。
当我在http://localhost:9080/myapp/
访问我的网络应用时,不会显示身份验证表单。
但是,当我直接访问该页面http://localhost:9080/myapp/index.jsp
时,会出现身份验证表单。
如何为/
欢迎页面显示该表单?
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<url-pattern>/index.jsp</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>USERGROUP1</role-name>
</auth-constraint>
<user-data-contraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-contraint>
</security-constraint>
答案 0 :(得分:2)
尝试从<url-pattern>/index.jsp</url-pattern>
到此<url-pattern>/</url-pattern>
答案 1 :(得分:2)
您创建一个虚拟index.jsp,转发到您的“真实”索引页面。