Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question for experts?

 
Liz Cheyney
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering if there is any way to send HTTP request to the servlet as a background process.
I should probably clarify what I mean:
I have web application with several tabs for entering data and a user can navigate between them without submitting the data in the servlet/EJB/DB. At some point of data entering process I want to execute a query but I want it to be transperent for the user. In particular, I don't want him to see how the page is refreshing and so on. Can I do it?
Thanks in advance
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this is what you mean, but you can use JavaScript to send a request to a servlet, placing the response in an off-screen frame and then acting on that data with JavaScript. The screen the user is looking at is not affected.
Bill
 
Jesse Beaumont
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can but it gets a bit messier. The way to do it is to put your page in a two frame frameset. The first frame contains your page, the second frame is of size 0. When you want to do the invisible submit you submit the data via the second frame and include an onLoad event in the response which populates the data back into the first frame. The problem is that all your javascript get's that much messier because you are using frameset's but from the users perspective it is the neatest way to do it. The only other thing to keep in mind is that when the user actions a request like this there is no feedback to the user that an action has taken place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic