• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

In Need of Urgent help Struts + jquery

 
Vikas Dhyani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

This is vikas. I am COMPLETELY NEW TO STRUTS(struts2 framework). I have a task to use jquery to make ajax call to the actionclass of the JSP from which i m trying to make a call.

My JSP has 2 forms, the aim is to make actionclass call from one form, with loading the entire page. I am putting the jsp code without jquery for your reference:






I need to make a jquery ajax call from the second form submit tag(without reloading of the entire page)... I am completely clueless of what to do... pleease pleease help me.. with the steps to be done.


Warm Regards,
Vikas
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TL;DR.

Are you having an issue with Struts 2, or with jQuery?
 
Sita Marivada
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can make a call to action class using sj:div tags.

<s:url var="urlajax1" action="youraction" namespace="/ns escapeAmp="false">
<s:param name="paramname" value="%{value}" />
</s:url>

<sj:div id="someid" href="%{urlajax1}" />


When rendering the page,when container encounters sj:div ,it looks for href and makes a call to particular action class(in s:url).It will just update the page with the result fragment returned by your method in action class in the particular div area in the jsp.

In this way you can call multiple actions from the same page by adding multiple sj:div's
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic