struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Łukasz Lenart <lukasz.len...@googlemail.com>
Subject Re: Struts2 REST plugin problems
Date Sun, 03 Jul 2011 10:49:19 GMT
Did you try to specify struts.rest.namespace constant ? It will change
what kind of actions are created base on the namespace.

http://struts.apache.org/2.2.3/docs/rest-plugin.html#RESTPlugin-Settings


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/


2011/7/2 Aelbery Lee <aelbery@gmail.com>:
> Hi, all.
>
>    I'm currently using struts 2.2.3. I want to mix normal action with
> restful action in the same web app. I searched and found here.
>
> In my struts.mxl:
>
>        <constant name="struts.devMode" value="true" />
>
>        <constant name="struts.convention.action.mapAllMatches" value="true" />
>        <constant name="struts.convention.default.parent.package"
> value="rest-default" />
>
>        <constant name="struts.convention.package.locators" value="action" />
>
>        <constant name="struts.mapper.class"
> value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>        <constant name="struts.mapper.prefixMapping" value="/ws:rest,:struts"/>
>
>        <constant name="struts.rest.namespace" value="/ws"/>
>
>        <package name="common" namespace="/mvc" extends="struts-default">
>
>            <action name="*" class="com.mycompany.CommonSupport">
>            <result>/WEB-INF/content/{1}.jsp</result>
>        </action>
>
>    </package>
>
> If I removed the PrefixBasedActionMapper and prefixMapping two lines,
> /myapp/mymodule works fine with restful action.
>
> But now /myapp/mymodule raise exception "method not found", execute();
> And /myapp/ws/mymodule raise exception "action not found", ws action.
>
> So I must make a mistake. Thanks for you help.
>
> --
> View this message in context: http://struts.1045723.n5.nabble.com/Struts2-REST-plugin-problems-tp3492324p4544292.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
>
>

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


Mime
View raw message