You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sepid rahimi <se...@gmail.com> on 2010/09/14 11:20:25 UTC
struts2 problem
hi
I created a struts2spring project(in maven structure) and i'm going to
write a result type that use from it in my actions and deployed in tomcat
but i have
this problem:
java.lang.
IllegalStateException: Must have the StrutsPrepareFilter
execute before this one
org.apache.struts2.dispatcher.ng.InitOperations.findDispatcherOnThread(InitOperations.java:90)
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.lazyInit(StrutsExecuteFilter.java:52)
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:73)
please help me
my web.xml(located in java/resources)
<?xml version=*"1.0"* encoding=*"UTF-8"*?>
<web-app id=*"person"* version=*"2.4"* xmlns=*"
http://java.sun.com/xml/ns/j2ee"
*
xmlns:xsi=*"http://www.w3.org/2001/XMLSchema-instance"
*
xsi:schemaLocation=*"http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"*>
<welcome-file-list>
<welcome-file>/WEB-INF/starter.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
</filter>
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<*init-param*>
<param-name>config</param-name>
<param-value>/src/main/resources/struts.xml</param-value>
</init-param>
</web-app>
my struts.xml (located in java/resources)in maven structure
<?xml version=*"1.0"* encoding=*"UTF-8"* ?>
<!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.devMode"* value=*"true"* />
<package name=*"default"* namespace=*"/"* extends=*"json-default"*>
<result-types>
<result-type name=*"json-type"* class=*"jsonType"*/>
</result-types>
<action name=*"getJSONResult"* class=*"action.JSONDataAction"*>
<result type=*"json-type"*>/jsonDataAction.jsp</result>
</action>
</package>
</struts>
*Regard*
*Thanks*