Hi,
I tried passing the request through ajax to action class.
I have this javascript method
function getGrouping() {
alert("inside grouping");
var parameters= new Array();
var i=0;
parameters[i++]='methodName';
parameters[i++]='getValuesA';
parameters[i++]='primaryValue';
parameters[i++]=document.getElementById('primary').value;
var response = XMLHttpRequestSender('somePage.do',
parameters,
'true',
'GET',
'1000000',
'3','secondary', displayResult);
}
function displayResult(req, idToChange)
{
alert('Inside displayResulte into '+idToChange);
//I am able to come into this method.
var result = req.responseText;
alert("inside result");
alert(result);
//here I have code to populate the second drop down
}
public ActionForward getValuesA(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) {
String primaryValue = request.getParameter("primaryValue");
List secondaryvalues= new ArrayList();
secondaryValues.add("abc");
secondaryValues.add("cde");
//I construct a string "optionsString" with the values and set it in request.
request.setAttribute("result", optionsString);
return null;// as I am returning to the same jsp i am returning null.is this right.
}
So should I use another jsp and use request.getAttribute("result") to get the options from action class or how do I get the options set in the action class into this jsp.