This seems like it should work, but I'm getting all sorts of hassles, and the documentation page for this, naturally, provides no examples of what the include file should look like.

My struts.xml has...

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd";>
<struts>
        <include file="struts-editevent.xml">
        <package name="CONGO" extends="struts-default">
                <interceptors>
                [blah blah blah]
                </interceptors>
        (more actions)
        </package>
</struts>

The 'struts-editevent.xml' has:
<action name="coconut/viewEditEvent" method="load" class="com.stonekeep.congo.coconut.EditEvent">
                <interceptor-ref name="mystack" />
<result name="success">/WEB-INF/jsp/coconut/EditEventForm.jsp</result> <result name="login" type="redirect-action">coconut/showloginpage</result>
        </action>

<action name="coconut/postEditEvent" method="update" class="com.stonekeep.congo.coconut.EditEvent">
                <interceptor-ref name="mystack" />
<result name="success">/WEB-INF/jsp/coconut/Maintenance.jsp</result> <result name="input">/WEB-INF/jsp/coconut/EditEventForm.jsp</result> <result name="login" type="redirect-action">coconut/showloginpage</result>
        </action>

A basic block of actions.

I'm getting XML validatoin errors up the wazoo because the struts-editevent.xml file isn't well-formed. If I put it in <struts> blocks, I get "you're referencing interceptors that don't exist".

If I try and duplicate the entire package, interceptors, and DTD definition into the include file, I get package collisions.

My take is the <include> function does not work as described in the documentation. It should be a linear include, and the resulting document is parsed by SAX, but that doesn't seem to be happening.

Can someone give me an example of an included XML file that actually works?

Here are links to what I'm seeing:
My main struts.xml: http://pastebin.stonekeep.com/4955

My struts-editevent.xml: http://pastebin.stonekeep.com/4956

What happens when I deploy:

http://pastebin.stonekeep.com/4957

Note that says "no grammar found". Adding the DTD says "you need a package name in your struts block" - etc etc etc. It never really resolves.

Can someone show me an <include> setup that actually works?

--
-------------------.--------.-------------------------------.
Dave Belfer-Shevett \ KB1FWR \ JID: [EMAIL PROTECTED] \
blog:planet-geek.com >--------'-----------------------------------.
[EMAIL PROTECTED]    /   Windows98 Err#021 - Error Parsing Error    \
-------------------<        List; Please Wait For Next Error        |
                    \______________________________________________/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to