struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sivaks75 <>
Subject ajax request processing issue
Date Thu, 23 Jun 2011 17:33:52 GMT

I am using struts 2.2.3 version and pretty new to Struts. I have 2 issues
with respect to handling ajax request. 

Issue 1: 
I defined a method in Action class and mapped that method to struts.xml
mapping and gave that action class name in ajax request URL as given below. 

requestObject = xmlHttpRequestHandler.createXmlHttpRequest(); 
var url = "serviceContent";"Get",url,true); 
Action mapping: 
<action name="serviceContent"
<result name="success">services.jsp</result> 

It did not process the request and got the response as "Not found". Looks
like it is not able to map. 

Hence I decided to implement execute() method in my action class and changed
the code as given below 
requestObject = xmlHttpRequestHandler.createXmlHttpRequest(); 
var url = "ServiceCatalog";"Get",url,true); 
Action mapping: 
<action name="ServiceCatalog"
<result name="success">services.jsp</result> 

It works good. It is getting into execute() method. 

Issue 2: 
I wanted to pass some additional input to the execute method. I change ajax
request url to as given below. 
var url =

Now it does not go to execute() method and simple does nothing. There is no
error. I am getting the return status as success. 

If I enter that

directly in the browser and the control goes to execute() method, since it
is normal form submit. 

I am not sure why it is not taking the additional input attributes in the
request. I cant set those additional attributes as hidden controls, since am
not submitting the form. 

Any help appreciated! 


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message