Meaningless Drivel is fun!*
The moose likes Struts and the fly likes In Need of Urgent help Struts + jquery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "In Need of Urgent help Struts + jquery" Watch "In Need of Urgent help Struts + jquery" New topic
Author

In Need of Urgent help Struts + jquery

Vikas Dhyani
Greenhorn

Joined: Jul 15, 2010
Posts: 1
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

Joined: Sep 29, 2008
Posts: 12617

TL;DR.

Are you having an issue with Struts 2, or with jQuery?
Sita Marivada
Greenhorn

Joined: Apr 01, 2010
Posts: 14
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


Sita Putta
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: In Need of Urgent help Struts + jquery