Hi Diaconu Eduard,
I aready have a key(EffortTracker.getProgram) mapped to the value(
getPrograms).
i.e.
application.resources file contains,
EffortTracker.getPrograms=getPrograms
and
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("EffortTracker.getPrograms","getPrograms");
return map;
}
(I am sorry the code that was there in my initial mail is not showing
getKeyMethodMap method properly)
I guess, LookupDispatchAction will reverse map the value to key using
properties file.
and action mapping in struts-config.xml already declared method as a
parameter.
Taking that into consideration , do we still need to use
<html:hidden proprety = "method" />
Regards,
Nava Krishna. M
Diaconu Eduard wrote:
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("getPrograms","getPrograms");
return map;
}
ApplicationResources.properties
getPrograms=getPrograms
in jsp
<html:hidden property="method" />
-----Messaggio originale-----
Da: Nava Krishna Mallela [mailto:[EMAIL PROTECTED]
Inviato: giovedì 6 aprile 2006 12.32
A: user@struts.apache.org
Oggetto: how to handle requests submitted using java script with a
LookupDispatchAction subcalss
Hi,
Please guide me overcome this issue.
My jsp page has two list boxes, the values in one of those
boxes(dependent list box) are populated depending on the selected value
in the other one (independent listbox).
I tried submitting the value selected in the independentlistbox using
javascript.
I am using LookupDispatchUpAction subclass to handle this request.
I am getting the following error message,
javax.servlet.ServletException: Request[/effortTracker] does not contain
handler parameter named method
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:200)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Extract from jsp:
------------------
<html:select property="project_id" value="0" onchange="javascript:
resubmit('EffortTracker','getPrograms')">
<option value="0">Select</option>
<bean:define id="Projects" name="Menu" property="projects"
type="java.util.Collection"/>
<html:options collection="Projects" property="project_ids"
labelProperty="project_codes"/>
</html:select>
The javascript used:
--------------------
function resubmit(form_name,method_value)
{
document.forms[form_name].method.value= method_value;
document.forms[form_name].submit();
}
LookupDispatchAction subclass:
----------------------------
public class EffortAction extends LookupDispatchAction{
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("getPrograms","getPrograms");
return map;
}
public ActionForward getPrograms(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
I have a parameter named "method" configured in struts- config.xml.
<action path="/effortTracker"
name="EffortTracker"
type="infosys.aol.Actions.EffortAction"
validate="false"
parameter="method">
<forward name="continue" path="Tiles.EffortTracker"/>
</action>
ApplicationResources.properties
I will be happy to provide any more information as you find needed.
Thank you
Regards,
Nava Krishna M
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]