Or, add it yourself:

package com.dotech.servlet.taglibs;

import java.net.MalformedURLException;

import java.util.Map;

import javax.servlet.jsp.JspException;

import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ResponseUtils;

public class RewriteTag extends org.apache.struts.taglib.html.RewriteTag {

    public int doStartTag() throws JspException {

        // Generate the hyperlink URL
        Map params = RequestUtils.computeParameters(pageContext,
                                                    paramId,
                                                    paramName,
                                                    paramProperty,
                                                    paramScope,
                                                    name,
                                                    property,
                                                    scope,
                                                    transaction);
             
        String url = null;
        try {
            // Note that we're encoding the & character to & in XHTML mode
only, 
            // otherwise the & is written as is to work in javascripts. 
            url = RequestUtils.computeURL(pageContext,
                                          forward,
                                          href,
                                          page,
                                          action,  // The Struts 1.1 version
explicitly passes null for action
                                          params,
                                          anchor,
                                          false,
                                          isXhtml());
                    
        } catch (MalformedURLException e) {
            RequestUtils.saveException(pageContext, e);
            throw new JspException(messages.getMessage("rewrite.url",
e.toString()));
        }

        ResponseUtils.write(pageContext, url);

        return (SKIP_BODY);
    }
}

Then, a TLD dumped somewhere under WEB-INF in your app:

<taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>dot-html</short-name>
    <uri>http://dotech.com/taglibs/html</uri>

    <tag>
        <name>rewrite</name>
        <tag-class>com.dotech.servlet.taglibs.RewriteTag</tag-class>
    </tag>
</taglib>

And finally use in your JSPs:

<%@ taglib prefix="dot-html" uri="http://dotech.com/taglibs/html"; %>
..
<dot-html:rewrite ...>
..

Quoting "Ruth, Brice" <[EMAIL PROTECTED]>:

> hallelujah! Now I just need to migrate ... ugh
> 
> Erik Weber wrote:
> 
> > If I'm not mistaken, the "action" attribute to html:rewrite is 
> > supported in 1.2.
> >
> > Erik

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to