錯誤信息:java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException,No mapping found for dependency [type=com.opensymphony.xwork2.conversion.ConversionFileProcessor, name='default'] in public void com.opensymphony.xwork2.conversion.impl.XWorkConverter.setConversionFileProcessor(com.opensymphony.xwork2.conversion.ConversionFileProcessor).其中struts.xml就放在src目錄下web.xml里的內容如下<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">? <display-name>test</display-name>? <filter>??? <filter-name>struts2</filter-name>??? <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>??? <init-param>? ?? ??? ?<param-name>config</param-name>? ?? ??? ?<param-value>struts-default.xml,struts-plugin.xml,struts.xml</param-value>? ?? ?</init-param>? </filter>? <filter-mapping>??? <filter-name>struts2</filter-name>??? <url-pattern>/*</url-pattern>? </filter-mapping>? <listener>??? <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>? </listener>? <context-param>??? <param-name>contextConfigLocation</param-name>??? <param-value>classpath:spring.xml</param-value>? </context-param></web-app>其中<init-param></init-param>標簽及里面的內容去掉也是報同樣的錯誤。
1 回答

大咪
TA貢獻785條經驗 獲得超332個贊
你struts.xml里配置少default這個節點,加上這個試試
<include?file="struts-default.xml"/>
然后web.xml里不用改動
添加回答
舉報
0/150
提交
取消