Bookmark Topic Watch Topic
  • New Topic

Servlet status handling

 
Antonino Lo Bue
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
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 ]
 
Antonino Lo Bue
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Once again: will the page be reloaded or not?

What is the purpose of:
 
Antonino Lo Bue
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Report post to moderator
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...
 
    Bookmark Topic Watch Topic
  • New Topic