struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Wannemacher <w...@wantii.com>
Subject Re: struts 2 -- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.
Date Mon, 22 Jun 2009 16:35:42 GMT
Are you accessing a JSP page with struts tags in it by going directly
to the JSP ? For instance, you should be hitting a URL similar to the
following (based on the config you sent) -

http://yourserver:8080/contextRoot/pcFlow.action

Then, depending on what the return value of
com.myco.regui.struts.accounts.AccountsAction.execute(), you will see
one of the JSPs you mapped as results.

Also, is there any reason why you are changing the interceptor stack?
You don't have validation and workflow, which seems a bit odd...

-Wes

On Mon, Jun 22, 2009 at 12:27 PM, laredotornado<laredotornado@gmail.com> wrote:
>
> Hi,
>
> I'm trying to migrate my app from struts 1 to struts 2.  On a particular JSP
> page, I get this error
>
> The page generated an error: Exception:
> The Struts dispatcher cannot be found. This is usually caused by using
> Struts tags without the associated filter. Struts tags are only usable when
> the request has passed through its servlet filter, which initializes the
> Struts dispatcher needed for this tag. - [unknown location]
>
> I can't find anything in my server error log files.  Below is my web.xml and
> struts.xml files.  Any ideas how I can troubleshoot this?  Thanks, - Dave
>
> ===============Begin web.xml ==============================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <web-app  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/web-app_2_4.xsd"
> version="2.4">
>
>    <filter>
>                <filter-name>TransactionFilter</filter-name>
>
> <filter-class>com.myco.regui.servlets.filters.TransactionFilter</filter-class>
>    </filter>
>        <filter-mapping>
>                <filter-name>TransactionFilter</filter-name>
>                <url-pattern>/*</url-pattern>
>        </filter-mapping>
>
>        <filter>
>                <filter-name>struts-filter</filter-name>
>                <filter-class>
>                        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>                </filter-class>
>        </filter>
>        <filter-mapping>
>                <filter-name>stuts-filter</filter-name>
>                <url-pattern>/*</url-pattern>
>        </filter-mapping>
>
> <session-config>
>        <session-timeout>65</session-timeout>
> </session-config>
>
> <welcome-file-list>
>        <welcome-file>index.html</welcome-file>
> </welcome-file-list>
>
>
> </web-app>
> ================End web.xml ==============================
>
> ===============Begin struts.xml =============================
> <?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.enable.DynamicMethodInvocation" value="false" />
>    <constant name="struts.devMode" value="false" />
>
>    <!-- Add packages here -->
>
>    <package name="myapp" namespace="/" extends="struts-default">
>
>                <interceptors>
>                        <interceptor name="AccountsInterceptor"
> class="com.myco.regui.struts.accounts.AccountsInterceptor"></interceptor>
>                        <interceptor-stack name="AccountsInterceptorStack">
>                                <interceptor-ref name="prepare"/>
>                                <interceptor-ref name="modelDriven"/>
>                                <interceptor-ref name="exception"/>
>                                <interceptor-ref name="servletConfig"/>
>                                <interceptor-ref name="checkbox"/>
>                                <interceptor-ref name="params"/>
>                                <interceptor-ref name="SimpleInterceptor"></interceptor-ref>
>                        </interceptor-stack>
>                </interceptors>
>                <default-interceptor-ref
> name="AccountsInterceptorStack"></default-interceptor-ref>
>
>        <default-action-ref name="index" />
>        <action name="pcFlow"
> class="com.myco.regui.struts.accounts.AccountsAction">
>                <result name="success">jsp/pcredirect.jsp</result>
>                <result name="failure">jsp/pcAccountLookupError.jsp</result>
>        </action>
>
>                <action name="hhFlow"
> class="com.myco.regui.struts.accounts.AccountsAction">
>                <result name="success">jsp/hhredirect.jsp</result>
>                <result name="failure">jsp/hhError.jsp</result>
>        </action>
>
>        <action name="logout"
> class="com.myco.regui.struts.logout.LogoutAction">
>                <result>jsp/pcAccountLookup.jsp</result>
>        </action>
>    </package>
>
> </struts>
> ================End struts.xml==============================
> --
> View this message in context: http://www.nabble.com/struts-2----The-Struts-dispatcher-cannot-be-found.-This-is-usually-caused-by-using-Struts-tags-without-the-associated-filter.-tp24150745p24150745.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message