aspose file tools*
The moose likes JSP and the fly likes How to send a request without leaving the current page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to send a request without leaving the current page?" Watch "How to send a request without leaving the current page?" New topic
Author

How to send a request without leaving the current page?

W Sun
Greenhorn

Joined: Apr 24, 2003
Posts: 6
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

Joined: Apr 17, 2002
Posts: 2
you can use javascript to do it in client but server


Jesus is on the way.
Idly Vada
Ranch Hand

Joined: Sep 02, 2003
Posts: 135
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

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Jan 10, 2002
Posts: 61430
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to send a request without leaving the current page?