Hi,
I am trying to work out how populate attributes on using Restful2ActionMapper
but I think I am missing something in my configuration and wondered if someone
could give me some advice.
My struts file is
<struts>
<constant name="struts.mapper.class" value="restful2" />
<constant name="struts.convention.result.path" value="/WEB-INF/jsp" />
<constant name="struts.enable.SlashesInActionNames" value="true" />
<constant name="struts.convention.package.locators" value="action" />
<package name="default" extends="struts-default">
<action name="region/*" class="com.action.RegionAction" >
<param name="name">{0}</param>
</action>
</struts>
My action
package com.action ;
@Results({
@Result(name="get", location="region/displayRegion.jsp")
})
public class RegionAction extends ActionSupport {
private String name ;
private int id ;
public String get(){
…..
return "get" ;
}
// name & id getters and setters …...
}
I am trying to get the URL into the state like as the documentation claims it
can handle
http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2
So My URL would be like...
http://127.0.0.1:8080/region/name/Mexico/id/2
But that is not working out. Is there something I have missed?
Many thanks
_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009