Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AJAX required or not

 
Hirak Dasgupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On based of input from user I want to populate a table from database in the same jsp form without submitting that form.

So, only AJAX can solve this problem or there is some solution other than AJAX?

If AJAX is the only solution then pls provide me the steps for doing that through AJAX.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hirak Dasgupta:
then pls provide me ...
Please use real words when posting to the forums. Abbreviations such as "pls" in place of "please" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this has nothing to do with Struts and more to do with Ajax, it has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to contact the server without submitting the current page, then yes, Ajax is your best bet.

If you are a rank beginner with Ajax, I'd suggest starting with a good tutorial, such as this article.
 
Hirak Dasgupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hirak Dasgupta:
On based of input from user I want to populate a table from database in the same jsp form without submitting that form.

So, only AJAX can solve this problem or there is some solution other than AJAX?

If AJAX is the only solution then pls provide me the steps for doing that through AJAX.


Yes, AJAX is the best way to do that. Also, as you don't wan't to submit the page so AJAX is the only solution.

For using AJAX the following steps have to be followed:
1. The section of the jsp that you want to replace with AJAX must be
embedded in a span tag.
2. call the retrieveURL method on click of required button in following
format retrieveURL(yourAction.do?ask=COMMAND_NAME_1',"yourFormBean");
3. This function will automatically pass control to your Action class (if
using Struts and get the required new values)

A sample ajax file is as below :


[ March 03, 2008: Message edited by: Anubhav Anand ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. The section of the jsp that you want to replace with AJAX must be
embedded in a span tag.

Must be? No. It can be any structured element.
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:

Must be? No. It can be any structured element.



Rigthly said Bear. I suppose I missed it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic