You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by tsvetelin <ts...@rushmore-digital.com> on 2003/11/14 15:22:21 UTC

Improvements in handling Stale link in Form component

Hi All,

Last couple of days I am working on 2 things: making client side of our
application stateless and improving the stale link handling in our
application.

Problem: We have dynamic web forms module where the administrator can
add/remove the question from the application forms. So it was possible users
of our application to receive the stale link error during the filling the
form. Showing the default page that say “Stale link has been entered” or
something else isn’t appropriate because there aren't any session data on
the server(stateless application - all necessary data are in a hidden fields
in the form) and we lose the user tracking(for example selected product
category).

Solution:
The new listener can be passed to the form component which will be notify
when the Stale Link Error is couth. In the way the page or component can
decide what must be done when the stale error occur. In our case the page
clear it’s properties (except this that is related to the user actions
tracking - for example selected product category).

Here are the changes:
1. The new interface has been added:
/**
 *  Defines a listener to an {@link net.sf.tapestry.form.Form} and {@link
net.sf.tapestry.link.DirectLink} components, which is way to
 *  get behavior when the Stale Link Error occur.
 *
 *  @author Tsvetelin Saykov
 *  @version $Id: IStaleLinkErrorLister.java,v 1.0 2003/11/14 Exp $
 *
 **/
public interface IStaleLinkErrorLister {
	public void staleLinkErrorOccur(RequestCycleException e) throws
RequestCycleException;
}

2. The new binding has been added to the Form component
  <parameter name="staleLinkErrorListener"
  	java-type="net.sf.tapestry.IStaleLinkErrorLister"
  	required="no"
  	direction="in">
    <description>
  	Object invoked when the form is submitted and the stale link error occur.
    </description>
  </parameter>

3. The code in Form.java has been changed in the part where the
StaleLinkException is thrown:

I would like to commit this changes in the framework.
Any comments?

Tsvetelin


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org