aspose file tools*
The moose likes JSP and the fly likes Servlet status handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Servlet status handling

Antonino Lo Bue
Greenhorn

Joined: Feb 08, 2007
Posts: 15
Hi, I need to run a servlet which do a processing and to dynamically activate an HTML input submit button when the servlet ha finished the processing.

How I can accomplish this without using AJAX ?

For clarity:
before calling servlet (requestInitialized):

after servlet do their work (requestDestroyed):



Thanks in advance


Antonino Lo Bue


Antonino Lo Bue<br />Research Fellow<br />ICAR-CNR Palermo<br />Phone: 091-6809256<br />Web: <a href="http://medialab.pa.icar.cnr.it/sito/Personali/LoBue/index.html" target="_blank" rel="nofollow">http://medialab.pa.icar.cnr.it/sito/Personali/LoBue/index.html</A>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

I'm a bit confused. You wrote your question as if you expect to be able to change the attributes of an element in the loaded page once you have submitted it. Of course that cannot be. Once you submit the page, the browser will replace the page with whatever is returned as the response.

You can, of course, send a copy of the same page. In this page you can easily embed some JSP EL expressions that set the value of the disabled attribute as appropriate.

Does that make sense?
[ May 15, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Antonino Lo Bue
Greenhorn

Joined: Feb 08, 2007
Posts: 15
No, this behaviour is not what I want...

I suppose that there are 2 submit button:
the first is used to POST an HTML form which invoke the servlet in a blank page;
the second is used to download the process results file when the servlet complete the processing.

I need to enable the 2nd button only when the servlet finished their work.

I tried with a servlet event listener but I don't know how to change the attribute of the 2nd button...

Maybe the only solution is AJAX but I anyone knows another method I will prefer this...

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

which invoke the servlet in a blank page;


Not sure what you mean by this. Do you actually want a new empty and useless browser window to open just so you can avoid using Ajax?
Antonino Lo Bue
Greenhorn

Joined: Feb 08, 2007
Posts: 15
For clarity this is the code:



I need to change the disabled value from to only when the servlet has terminated his processing...

how I can do? It's possible to do this with JSP? Or I need AJAX, in this case what can I do?

Antonino

[ May 16, 2007: Message edited by: Antonino Lo Bue ]
[ May 16, 2007: Message edited by: Antonino Lo Bue ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

Once again: will the page be reloaded or not?

What is the purpose of:
Antonino Lo Bue
Greenhorn

Joined: Feb 08, 2007
Posts: 15
popupForm1() is a javascript that open the servlet result page into another window without toolbars...

The main page (from which is called the servlet) can be reloaded using JSP command like

I think that without refresh command I will need to use AJAX...
 
jQuery in Action, 2nd edition
 
subject: Servlet status handling