Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

restful actions

Aram Mkhitaryan

2007-03-05

Replies:

Hi,

Does someone tried restful actions???

I'am working with blank application and trying to add restful action.
Here is my struts.xml
--------
<struts>
  <constant name="struts.enable.DynamicMethodInvocation"
    value="false" />
  <constant name="struts.devMode" value="true" />

  <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
    name="struts-restful"
    class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper"
/>

  <constant name="struts.mapper.composite"
    value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,
org.apache.struts2.dispatcher.mapper.RestfulActionMapper,
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />

  <constant name="struts.action.extension" value="example" />

  <include file="example.xml" />
</struts>
------------------------------------------------------

Here is my mapping in example.xml
---------------------------------------
<package name="root" extends="struts-default" namespace="/">
  <action name="do/*" class="example.RestSupport">
    <param name="first">{0}</param>
    <result type="redirect">http://www.google.com</result>
  </action>
</package>
---------------------------------------------

According to docs following path "http://contextroot/do/this is an example"
should invoke view method, but i get 404 code.
Even struts filter does not handle this request.

For this mapping works only this path "http://contextroot/do.example"
despite the documentation (should run without .example).

What can I do?

Thank you in advance,
Aram
________________________________
Aram Mkhitaryan

52, 25 Lvovyan, Yerevan 375000, Armenia

Mobile: +374 91 518456
E-mail: aram.mkhitaryan@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.