• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax in Struts

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unable to get response from server after Ajax call.
Please help me.

Depending upon the value selected in the Drodown shown below I need to build another dropdown.

I.My initial dropdown is built like this - This works fine
<select name="id_<%=edVO.getObxObservationResultKey()%>" size="1" styleClass="RegSelect" onchange="javascript: ajaxTestCall(this)"><hin:lookupOptions table="CDESSDiseasesCD" />
</select>

II.Then I call a javascript method. This is calling my Struts action class method- This also works fine
function ajaxTestCall(inputForm) {
retrieveURL('eclrsDetail.do?method=ajaxtestCall','EclrsDetailForm')
}// end function dismiss

III. My action class method like this
public ActionForward ajaxtestCall(ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse res) throws WebException {
req.setAttribute("showSuggestion",Boolean.TRUE);
return mapping.findForward("eclrs_detail");
}


IV. I have following code in JSP to get response back from server
<c:if test="${showSuggestion}" >
<tr><span id="txtHint">yes I am from Ajax call</span></</tr>
</c:if>
In IV step I am failing. I do not get "I am from Ajax call" printed on jsp.(I will try building another dropdown after this). The reason seems to be because showSuggestion is still null.
why showSuggestion is not set in request attribute. Is there any other things that I need to take care?

Can anyone help me with this?
[ May 11, 2006: Message edited by: Vani D Bandargal ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic