You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Stefan Wachter <st...@gmx.de> on 2001/11/28 11:54:20 UTC

proposal: client side state

Dear all,

we developed a general mechanism to transfer state information to the client
(i.e. browser) that is automatically returned with the next request. This
mechanism helps to keep the server side more stateless which is a desirable
feature.

We implemented this behaviour by having a map in request scope that holds
this state information. We overloaded the html:link- and html:form-tag such
that requests caused by them will contain this information. In case of the
form-tag we simply add a hidden field to the form for every entry in the map. In
case of the link-tag we add parameters to the URL.

My proposal is to introduce this feature into struts. If it is not accepted
as a general feature then I would like to have the html:link-tag to be
extensible. Currently it is not possible to influence the URL creation. Here is the
corresponding source code where I already introduced a hook method:

    public int doStartTag() throws JspException {

        // Special case for name anchors
        if (linkName != null) {
            StringBuffer results = new StringBuffer("<a name=\"");
            results.append(linkName);
            results.append("\">");
            ResponseUtils.write(pageContext, results.toString());
            return (EVAL_BODY_TAG);
        }

	// Generate the hyperlink URL
        Map params = RequestUtils.computeParameters
            (pageContext, paramId, paramName, paramProperty, paramScope,
             name, property, scope, transaction);

==================

        params.putAll(getClientSideState());
        params.putAll(doGetAdditionalParameters())

==================

        String url = null;
        try {
            url = RequestUtils.computeURL(pageContext, forward, href,
                                          page, params, anchor, false);
        } catch (MalformedURLException e) {
            RequestUtils.saveException(pageContext, e);
            throw new JspException
                (messages.getMessage("rewrite.url", e.toString()));
        }

     .....
     .....

    }
    

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>