Instead of the hack of a hidden frame, use the have your jsp return the
proper http response code to instruct the browser to not update content.

<%
  // do all your processing here as long as you send the following
  // back as your response
  response.setStatus(204);
%>

the 204 response code (No content) can be used by scripts that need to
respond to user clicks, but not send any content back - browsers should
not update their current view when receiving this response.

- vin




Mark Wutka wrote:

> Subject: Re: writing to db on button click
>
>
> Matt-
>    I'm sure you realize that you can't simply make a bean on the server
> react to mouse clicks on the server. After all, at the time the user is
> clicking, the JSP that generated the page has finished running and the
> server and the browser are disconnected from each other.
[ snip ]
> Now, my last suggestion is to use the old "hidden frame" trick.
> You open up a URL and tell the output to go to a hidden frame. You
> are still opening up a new page, but since it goes to a hidden frame,
> the UI looks exactly as it did before.
[snip]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to