Alex Kachanov wrote:
>
> hello, guys!
>
> I'm finishing a small taglib and what to add a finishing touch.
> Inside the tag hadler I wish to encodeURL a string (which is
> a url constructed on the fly).
>
> I'm really lost: how should I do this?
> could you give me two lines of code?
>
> I know how to do this in usual Servlet where response object is
> available.
>
> But how to do this in tag handler?


Assuming your tag extends TagSupport, you have access to the variable
pageContext. If not, you had to implement setPageContext, so you can get
at the PageContext wherever you put it.

  ((HttpServletResponse) pageContext.getResponse()).encodeURL(path);


Gennis

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to