You should add a name space for person and product package, as following:

    <package name="person" extends="struts-default" namespace="/person">
        <action name="list" method="execute" class="personAction">
            <result>pages/persons.jsp</result>
        </action>
    </package>
    <package name="product" extends="struts-default" namespace="/product">
        <action name="list" method="execute" class="productAction">
            <result>pages/products.jsp</result>
        </action>
    </package>

And invoke action using /person/list.action, /product/list.action.

陈仕兵
GIMS,  IT Application Development
Great Eastern Life Assurance (China) Co. Ltd.
Tel: 86-023-6805-3128
Fax: 86-023-68053154
Mbl: 86-023-66101533

-----邮件原件-----
发件人: hezjing [mailto:[EMAIL PROTECTED] 
发送时间: 2007年6月21日 12:57
收件人: struts-users
主题: How to invoke actions in different configuration packages

Hi!

When we have the Struts configuration below:

    <package name="person" extends="struts-default">
        <action name="list" method="execute" class="personAction">
            <result>pages/persons.jsp</result>
        </action>
    </package>


We can invoke the action by /list.action.

Why do we want to create a package like the above?


But can we have multiple packages like the following?

    <package name="person" extends="struts-default">
        <action name="list" method="execute" class="personAction">
            <result>pages/persons.jsp</result>
        </action>
    </package>
    <package name="product" extends="struts-default">
        <action name="list" method="execute" class="productAction">
            <result>pages/products.jsp</result>
        </action>
    </package>


How do we invoke the list action for person and product?


-- 

Hez

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




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

Reply via email to