• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

In Need of Urgent help Struts + jquery

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TL;DR.

Are you having an issue with Struts 2, or with jQuery?
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic