• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AJAX required or not

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bear
 
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic