Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

struts2 with ajax: howto return a value to div?  RSS feed

Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to use AJAX with struts2. I'm 'paraphrasing' an example from the apache site.

The objective is to return a simple value (field name=data) to a dvi ('myID')

I did this:

* JSP *

when the user clicks the doIt the action, testAjax1, is executed (showing the 'data' the user has input)


public String testAjax1()
System.out.println("say something: "+data);
return "t2";

and routed to AjaxResult3.jsp:


OUTPUT: The result, AjaxResult3.jsp, comes in a NEW page with the 'data' value the user has provided


My question is how to have the result get to myID and not to a new page?
[ February 19, 2008: Message edited by: Bear Bibeault ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!