• Post Reply Bookmark Topic Watch Topic
  • New Topic

server side request for pop up in JSP.

 
Mohan Karthick
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

What I need to do if I want to display pop up window from server side.

Scenario:
Say an employee is servicing his notice period and current day is his last day, so while browsing company site, on every 30 minutes one dialog box on browser will be displayed.

With out using javascript i need to do it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mohan Karthick:
With out using javascript i need to do it.


You will not be able to do this without JavaScript.
 
Mohan Karthick
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure??


This is possible only by AJAX and Java script ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajax is not necessary, but you need to either use the HTML target attribute on a link or form, or the JavaScript window.open() method.

There is no way to force a popup from the server without client-side provisions such as these.
 
Mohan Karthick
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once request reaches servlet, I will open a thread and pass request response object to some other method /class and this method will wait for 60 minute, meanwhile request response will display the main page and user may browse.
Exactly after 60 minute, response will send to the same client and this time it will display an popup.
Is it possble ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, not only does HTTP not make any provisons for returning an unrequested response, passing the request instance to another thread that will retain it beyond the scope of the response is a recipe for disaster.

For a long-running processes, you should start the process in another thread, without passing the request instance (copy any info you need out of it), and return the response as quickly as possible. Your UI can then check for completeion by checking a status flag that your worker thread can set when it is complete. This can be done under user control (by visiting a page that checks and displays the status) or, assuming that user is going to sit and stare at the same page, by polling.
 
Mohan Karthick
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answer.

Do you have any link where I can see any example for the same.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!