Hi,
 
I'm testing HelloWorld struts 2 example with friendly url's. I have read
 
http://struts.apache.org/2.0.6/docs/restfulactionmapper.html
http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/d
ispatcher/mapper/Restful2ActionMapper.htmlhttp://struts.apache.org/2.0.6
/docs/restfulactionmapper.html
(and a lot of pages found in Google speaking about Restful way)
 
and I don't understand what I'm doing wrong.
 
I have declared the HelloWord action as
 
        <action name="HelloWorld/*" class="example.HelloWorld">
            <param name="id">{1}</param>
            <result>/HelloWorld.jsp</result>
        </action>
 
using wildcards to pass parameters. The HelloWord class has an "id"
member variable, with it's public getters and setters.
 
The struts.properties has the next lines configurated:
 
 
struts.mapper.class=org.apache.struts2.dispatcher.mapper.Restful2ActionM
apper
        struts.action.extension=action
        struts.enable.DynamicMethodInvocation = false
        struts.enable.SlashesInActionNames = true
 
(I have tested with RestfulActionMapper and DefaultActionMapper objects
too)
 
I have read all documentation sections that speak about URL syntax
(http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALU
E2, etc etc), but my example doesn't works. I have tried this
combinations:
 

        http://localhost:8080/example/HelloWord.action/1
        
        http://localhost:8080/example/HelloWord.action/id/1
        
        http://localhost:8080/example/id/1/HelloWord.action
        
        http://localhost:8080/example/1/HelloWord.action
         

always with the same result: There is no Action mapped for action name
blablabla/blablabla
 
Please, I need to understand what I'm doing wrong, because I believe I'm
doing the things as tutorials and articles show, but without right
results...
 
Thanks a lot!
 
Jordi Rubio Moreno
 
 

Reply via email to