This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I am trying display a dynamic table on the .jsp page using Ajax. But it jsp page is not retaining the data. i have tried to pass the data using get/set attribute. My question is how do we get HTML response in AJAX in form of table generated dynamically?
I have tried to fetch data as gievn in this code:
ajax code is
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the button on your post.
What is textHint? What is being returned in the response?
Joined: Nov 10, 2008
"txtHint' is the area where i want to dispaly result returned by the servlet Complete Ajax file is
Now this code is sending particular area of problem to servlet which returns the doctors available for that area. I want to display that doctor list in formof a tableon same jsp where problem is selected, Thus how Ajax will help?
I am not well versed with XML so i wish to recieve datain form of text which will filled in table dynamicly.
How will it recieve data in "txtHint" from servlet?
Joined: Nov 08, 2001
You are not canceling the action from the submit button so it will submit the page.
Austin Tashis wrote:Even untyped buttons cause forms to submit in Firefox.
There's really no such thing as an "untyped" button. If it is omitted, it defaults to "submit". This is true of most browsers, not just Firefox.
You should always explicitly type buttons.
Joined: Nov 10, 2008
There are no two html tags in code. its here typing mistake i made. Button is also working fine since i have tried this code to display a simple text file in defined area.
Now i am facing problem in getting data display in form of table on Same JSP page from where request goes. This is what is ajax?
Now i guess my problem is clear to you, just tell me how can i recieve data in jsp from servlet ? is there any role of ajax responseTEXT/HTML method. This is used to define the type of data we want to recieve. here data would in text form
But how to get ? Using get/set Attributes or any other way?any link will also help if you have to refer