forwarding effectively to nothing
4 posts in topic
Flat View  Flat View

Posted By:   Conor_Rock
Posted On:   Monday, July 12, 2004 06:46 AM

I want to register a button click from the front end as a flag on the database. Meaning, the user clicks the button, an action is called to set the flag, but i dont want to refresh the page or forward to another action. Is this possible? I was looking at using the forward attribute within the action element to possibly specify an alternative to an 'Action' to process my request. Im not however sure how to use the forward attribute, or how to do this in an alternative manner. Thanks.

Re: forwarding effectively to nothing

Posted By:   dinesh_jn  
Posted On:   Thursday, July 22, 2004 02:11 AM

Without refreshing or Forwarding to any other page, You can achive by Embeding an Applet/Swing.

Do User Interface in Applet and embed in HTML tags.
When Button Click event [Jubtton/Button] is triggered, Applet will invoke Servlet and inturn servlet communicates with database.

While invoking servlet pass the flag to Servlet.

Re: forwarding effectively to nothing

Posted By:   Simon_Pearce  
Posted On:   Thursday, July 15, 2004 11:45 PM

I haven't used Struts, but this is a common problem.

In the button, have a javascript that updates a seperate (invisible) frame. This means the other frame can do the update without updating your original window.

Re: forwarding effectively to nothing

Posted By:   Sean_Owen  
Posted On:   Monday, July 12, 2004 10:54 AM

Hmm, you might be able to use the "onClick" handler to cause a request that does not actually refresh the page. For example, you could change the URL of some dummy 1x1 transparent pixel image on the page, which should cause a new request but not refresh the browser window. This new URL could contain request parameters that carry whatever data needs to go to the server. It is a hack, but might work.

Re: forwarding effectively to nothing

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, July 12, 2004 10:03 AM

You can return null, from an Action.execute(). We do that if the action has written output directly to the response itself, and does not need to forward to a jsp, like when we write out a dynamic PDF.

But if you have submitted a new request (from your button click), then your old page is gone already, so you need a new response to replace it in the browser...
About | Sitemap | Contact