Hi,

i changed from Apache 1.3.19/Tomcat 3.2.3 to Apache 1.3.19/Tomcat
4.0.1 on SUSE Linux 7.3. Now I'am encountering a taglib problem. My
dynamic bodycontents are not processed in the proper way anymore. I
put an url rewriting example example in this mail.

I hope somebody can help.

Thomas



### example.jsp ###

<A href="<myLib:url><%= myBean.getURL() %></myLib:url>">text</A>


### output Tomcat 3.2.3 (right) ###

<A href="http://localhost/target.jsp";>text</A>


### output Tomcat 4.0.1 (wrong) ###

<A href="<%= myBean.getURL() %>">text</A>


### example.tld ###

<tag>
  <name>url</name>
  <tagclass>de.iop.webrun.shared.taglib.UrlTag</tagclass>
  <bodycontent>tagdependent</bodycontent>
  <info>rewrite url</info>
</tag>


### UrlTag-Code ###

import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.IOException;

public class UrlTag extends BodyTagSupport
{
  public int doAfterBody() throws JspException
  {
    BodyContent bodyContent = getBodyContent();
    String baseURL          = bodyContent.getString();
    bodyContent.clearBody();
    try
    {
      HttpServletResponse response = (HttpServletResponse)
pageContext.getResponse();
      String encodedURL = response.encodeURL(baseURL);
      this.getPreviousOut().print(encodedURL);
    }
    catch(IOException e)
    {
      throw new JspTagException("I/O exception " + e.getMessage());
    }
    return SKIP_BODY;
  }
}



--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to