You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "GU,JAMES (HP-Corvallis,ex1)" <ja...@hp.com> on 2001/01/25 17:53:05 UTC

Post without getting new page? -- RE: Handling refresh in a web b ased application

By saying "the request is ignored", what do you expect to be displayed in the
browser? I assume you just wnat what page is displayed before the refresh. 

I have a related question that has been puzzling me for a while: can you just do
a simple data post to the server from a web browser (form, link, or any DOM
event etc) without causing the browser to expect/display new pages from the
server? For instance, when the state at the client side has changed (e.g., the
user changed the content in a form, notice that no submit button is clicked
yet), I'd like to notify the server the user state has been changed but I don't
need and don't want to get/display any new page from the server.

-james

> -----Original Message-----
> From: ron talk [mailto:ron_talk@hotmail.com]
> Sent: Thursday, January 25, 2001 8:04 AM
> To: struts-user@jakarta.apache.org
> Subject: Handling refresh in a web based application
> 
> 
> Hi all,
> 
> is there anyway to determine whether a repeated http request has been 
> generated through a
>       - click on the refresh button on a browser
>       - through clicking the back button a the browser and 
> re-clicking the 
> link/button generating the initial request
> 
> I am working on a struts based application in which I must 
> allow the request 
> to be completed if it is though going back and re clicking 
> the link, but if 
> its a simple refresh, the request is ignored.
> 
> 
> 
> ______________________________________________________________
> ___________
> Get Your Private, Free E-mail from MSN Hotmail at 
http://www.hotmail.com.

RE: Post without getting new page? -- RE: Handling refresh in a web based application

Posted by Andrew Boyko <ab...@fabgear.com>.
> can you just do
> a simple data post to the server from a web browser (form, link, 
> or any DOM
> event etc) without causing the browser to expect/display new 
> pages from the
> server? For instance, when the state at the client side has 
> changed (e.g., the
> user changed the content in a form, notice that no submit button 
> is clicked
> yet), I'd like to notify the server the user state has been 
> changed but I don't
> need and don't want to get/display any new page from the server.

Just setStatus(HttpServletResponse.SC_NO_CONTENT) in your response; 
the browser will cheerfully do nothing.

Andy Boyko   aboyko@fabgear.com

RE: Post without getting new page? -- RE: Handling refresh in a web based application

Posted by Abraham Kang <ab...@infogain.com>.
Hi James,

   This might sound complicated because it is.  You will again have to have
a hidden frame with a non-visual applet in it.  Everytime a page loads in
the visible page you will want to fire some JavaScript on the visible page
to notify the applet on the non-visual page of the form the user is viewing.
Each time an input field loses focus you will notify the applet so it can
communicate changes to the interface to the server.  One of the things to
note is applet security restrictions will only allow you to set up the web
server and JSP/Servlet engine on the same host.  This solution is not
trivial and I would not sugguest you pursue this option unless it was
absolutely required and you had the time to figure out Javascript to Java
interaction.

Good Luck,
Abraham

> -----Original Message-----
> From: GU,JAMES (HP-Corvallis,ex1) [mailto:james_gu@hp.com]
> Sent: Thursday, January 25, 2001 8:53 AM
> To: 'struts-user@jakarta.apache.org'
> Subject: Post without getting new page? -- RE: Handling refresh in a web
> based application
>
>
> By saying "the request is ignored", what do you expect to be
> displayed in the
> browser? I assume you just wnat what page is displayed before the
> refresh.
>
> I have a related question that has been puzzling me for a while:
> can you just do
> a simple data post to the server from a web browser (form, link,
> or any DOM
> event etc) without causing the browser to expect/display new
> pages from the
> server? For instance, when the state at the client side has
> changed (e.g., the
> user changed the content in a form, notice that no submit button
> is clicked
> yet), I'd like to notify the server the user state has been
> changed but I don't
> need and don't want to get/display any new page from the server.
>
> -james
>
> > -----Original Message-----
> > From: ron talk [mailto:ron_talk@hotmail.com]
> > Sent: Thursday, January 25, 2001 8:04 AM
> > To: struts-user@jakarta.apache.org
> > Subject: Handling refresh in a web based application
> >
> >
> > Hi all,
> >
> > is there anyway to determine whether a repeated http request has been
> > generated through a
> >       - click on the refresh button on a browser
> >       - through clicking the back button a the browser and
> > re-clicking the
> > link/button generating the initial request
> >
> > I am working on a struts based application in which I must
> > allow the request
> > to be completed if it is though going back and re clicking
> > the link, but if
> > its a simple refresh, the request is ignored.
> >
> >
> >
> > ______________________________________________________________
> > ___________
> > Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
>