Having looked at the source of this RewriteTag I see that encoding of the  &
character to & is in XHTML mode only

Doesnt this violate HTML 4.01 specifications? Any thoughts to introtuce a
parameter, for example encodeSeparator true/false


public class RewriteTag extends LinkTag {
   // --------------------------------------------------------- Public
Methods

   /**
    * Render the appropriately encoded URI.
    *
    * @throws JspException if a JSP exception has occurred
    */
   public int doStartTag() throws JspException {
       // Generate the hyperlink URL
       Map params =
           TagUtils.getInstance().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 = TagUtils.getInstance
().computeURLWithCharEncoding(pageContext,
                   forward, href, page, action, module, params, anchor,
false,
                   this.isXhtml(), useLocalEncoding);
       } catch (MalformedURLException e) {
           TagUtils.getInstance().saveException(pageContext, e);
           throw new JspException(messages.getMessage("rewrite.url",
                   e.toString()));
       }

       TagUtils.getInstance().write(pageContext, url);

       return (SKIP_BODY);
   }

   /**
    * Ignore the end of this tag.
    *
    * @throws JspException if a JSP exception has occurred
    */
   public int doEndTag() throws JspException {
       return (EVAL_PAGE);
   }
}

Reply via email to