aspose file tools*
The moose likes Struts and the fly likes Struts2 hello world using AJAX Jquery is working but renders html input tags twice. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 hello world using AJAX Jquery is working but renders html input tags twice." Watch "Struts2 hello world using AJAX Jquery is working but renders html input tags twice." New topic
Author

Struts2 hello world using AJAX Jquery is working but renders html input tags twice.

Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 670
I am trying to run a simple Hello world of struts2 to learn its usage with AJAX Jquery.

What I am trying to accomplish: There is a text box to enter name and a submit button saying sayHello. On clicking this button if name entered is Mark it should display Hello Mark using AJAX. Below is my code which gives desired output but displays html content twice.. Please let me know if my below approach is correct or wrong:

The code is working but the the problem is On entering name as Mark it is showing Hello Mark (which is correct) but along with this it is rendering the text boxes one more time.

Struts.xml



here is my action class:



here is my JSP page where there is some mistake which renders HTML twice.




Also I was not sure whether to post this in Struts forum or JSP forum or CSS,AJAX,Jquery Javacript Forum.

thanks

Karthik Jayachandran
Ranch Hand

Joined: Feb 18, 2009
Posts: 88

Might be the jsp page mentioned in result tag is loading again and again.

Try using json method - refer Struts2 Json plugin

or get a workaround - refer Returning string in struts 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 hello world using AJAX Jquery is working but renders html input tags twice.