struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Ying <liying.cn.2...@gmail.com>
Subject Re: struts.xml parsing error, involving interceptor
Date Tue, 28 Sep 2010 04:11:52 GMT
Hi Ken:

In the DTD file, it is defined:

<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?,
default-action-ref?, default-class-ref?, global-results?,
global-exception-mappings?, action*)>

That means, you should add the definition of interceptor
as children nodes of the [package] node.

Hope these helps.


2010/9/28 Ken <ken.mcwilliams@aerose.com>

>
> This has been driving me nuts...
>
> The following works in my code (typed by hand not copied from source):
> <struts>
>    <!-- If I add the missing content (found below) HERE, then this does
> NOT work -->
>    <package namespace="/secure" name="secure" extends="struts-default">
>        <result-types>
>            <result-type name="tiles"
> class="org.apache.struts2.views.tiles.TilesResult"/>
>        </result-types>
>        <global-results>
>            <result name="login" type="redirectAction">login</result>
>        </global-results>
>        <action name="test">
>            <result name="success" type="tiles">/secure/welcome</result>
>        </action>
>    </package>
> </struts>
>
>
> *** This breaks the otherwise working struts.xml if inserted where the
> commented line is above ***
>
> <interceptors>
>    <interceptor name="authenticationInterceptor"
>            class="interceptors.Authentication"/>
>    <interceptor-stack name="secureStack">
>        <interceptor-ref name="authenticationInterceptor"/>
>        <interceptor-ref name="defaultStack"/>
>    </interceptor-stack>
> </interceptors>
> <default-interceptor-ref name="secureStack"/>
>
> *** End content ***
>
> Error states that there is a parsing error in the file included into
> struts.xml... Need fresh eyes...
>
> Oh at the top of each document for completeness:
>
> <?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">
>
> Thank you.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message