Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ajax invalid Jason response with current page HTML

 
Ragupathirajan Venkatesan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

In my ajax call, i am getting the Jason response. Unfortunately I am getting the additional content of HTML along with the response. That HTML is equivalent to page from where I am triggering the Ajax request. It is java struts web application, in the action class before addding the content to printwriter object i am printing the response, which has only the required response. But in jsp while retriving through responseText ,, some HTML content is getting added to the original required response. By the use of alert I came to know that it is the HTML source of current page.

If any of you came across this kind of issue, please advice me. Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64969
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, it's JSON, not "Jason".
 
Stefan Evans
Bartender
Posts: 1746
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So your action is completely handling the response?

What does your action code look like?
What (if anything) are you returning from it?
What version of struts are you using? 1.1? 1.2? 2.0?

For Struts1.2, make sure that you return null from your execute method to inform Struts that you have handled the response, and it doesn't need to.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic