File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to send a request without leaving the current page?

 
W Sun
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I got a question here:
In a jsp page, when the user changed a option in a drop down box, I want the page to send a request to the server doing some operations on the database(probably use a bean) but still stay at the current page. How can I do that?
Another simple question is:
There're 10 elements/components in a FORM, and the user is changing the options in a drop down box (one of the 10 elements/components). Is there any way I can know which elements/components the user is playing with ?
Thanks in advance!
 
Shengli Hu
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use javascript to do it in client but server
 
Idly Vada
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by W Sun:

In a jsp page, when the user changed a option in a drop down box, I want the page to send a request to the server doing some operations on the database(probably use a bean) but still stay at the current page. How can I do that?

You can use an invisible frame and submit the data from a form in that invisible frame to the server.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you can see it's possible to do, but it isn't 'HTTP'. I find its better to send a request and get a response even if the response just reloads the page. At least this is HTTP and follows the rules.
It always depends on what you're trying to do though.
Dave
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch wolfire!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
Thanks!
bear
JSP Fourm Bartender
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic