【发布时间】:2015-08-11 11:15:09
【问题描述】:
我想删除 Struts2 应用程序中的操作后缀扩展。
将<constant name="struts.action.extension" value=""/> 添加到struts.xml
但是 Apache 服务器抛出 404 错误。
HTTP 状态 404 - 没有为命名空间 [/] 和操作映射操作 与上下文路径 [/Ideck_V3] 关联的名称 [login.jsp]。
我在第一页使用web.xml 中的welcome-file-list。
这里是web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>com.hbs.ideck.common.Struts2Dispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>
这里是struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.action.extension" value=""/>
<include file="user.xml"/>
<include file="vendor.xml"/>
<include file="settings.xml"/>
</struts>
我该如何解决这个问题?
【问题讨论】:
标签: java configuration struts2 action-mapping