Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Struts
struts2 ajax update jsp from action
Raymond Chiu Wing Hing
Ranch Hand
Posts: 91
1
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Dear all,
I have below code that I want to update second select control from first select control. But it seems not working. Find out that the json
string
returned from ajax is very string with return html page??
struts.xml
<action name="jsonsample" method="refreshLoanPeriod" class="ActionForm"> <result name="success">/WEB-INF/jsp/form_step1.jsp</result> </action>
ActionForm class
public String refreshLoanPeriod(){ .......... setJson(new Gson().toJson(mapPaymentTermList)); return "success"; }
JSP
function onChangeProduct(){ alert("123"); $.ajax({ type: "POST", url: "jsonsample.action", data: "testfirstone=" + name, success: function(json){ alert("json string: " + json); } }); } <s:select id="testfirstone" name="testfirstone" list="#session.testfirstonelist" listKey="key" listValue="value" onchange="onChangeProduct()" /> <select id="repaymentPeriod1" name="repaymentPeriod1" />
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Dependable dropdowns in jsp(struts2)
struts2 + json plugin problems
Struts 2 JSON double select
Data loading problem in select tag using ajax in struts2
Struts2 jQuery plugin, how do call ajax from javascript for tag select
More...