tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Watkin <james.wat...@anderson.ucla.edu>
Subject RE: Tag to Unescape an HTML String?
Date Sat, 24 Jan 2004 01:00:59 GMT
A little while ago I tried the Apache Jakarta String TagLib 
<str:decodeUrl>. It gave me the following error: URLDecoder: Illegal hex 
characters in escape (%) pattern - For input string: "&a". As you suggest, 
maybe the length of my body HTML String was too long to be passed as a param.

- Jim

At 04:45 PM 1/23/2004 -0800, you wrote:
>java.net.URLDecoder.decode() will decode such a string.
>You could create a simple tag that called the method
>if you want.  Be aware that some servers are unhappy with
>really big URLs.
>- Dan
>
> > -----Original Message-----
> > From: James Watkin [mailto:james.watkin@anderson.ucla.edu]
> > Sent: Friday, January 23, 2004 2:47 PM
> > To: taglibs-user@jakarta.apache.org
> > Subject: Tag to Unescape an HTML String?
> >
> >
> > I have a question regarding the following problem and
> > proposed solution:
> > Within a JSP, what would be the most efficient way to
> > unescape an HTML
> > string? The Regexp tag library? I've managed to avoid writing regular
> > expressions for a long time.
> >
> > Problem:
> > I'm creating some reusable JSP templates that are chained
> > together with
> > <c:import>. I'm trying to solve the well known problem of
> > having to create
> > two new JSPs for every new page -- one for the new page body,
> > the other to
> > import the master page layout and pass the URL of the new
> > page body JSP.
> >
> > Proposed Solution:
> > Rather than pass the master page layout a URL for the body JSP, I can
> > eliminate the body JSP by passing in the body as a String. If
> > my master
> > page layout is within the same container, then I can use
> > <c:set> and not
> > have to worry about unescaping the body String. However, I'd
> > prefer (I
> > think) to have the master page layout live outside the container,
> > especially since the JSTL spec notes that foreign context
> > access within the
> > same container might not be supported by all containers. If
> > the master page
> > layout JSP is outside the container of the importing JSP,
> > then the body
> > HTML String has to be passed with <c:param>, which escapes
> > the string. So
> > I'll need to unescape it be I can use it.
> >
> > - Jim
> >
> > ______________________________
> > James Watkin
> > ACIS Software Development
> > The Anderson School at UCLA
> > james.watkin@anderson.ucla.edu
> > Voice: 1-310-825-5030
> >    Fax: 1-310-825-4835
> > ______________________________
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >
> >
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org

______________________________
James Watkin
ACIS Software Development
The Anderson School at UCLA
james.watkin@anderson.ucla.edu
Voice: 1-310-825-5030
   Fax: 1-310-825-4835
______________________________ 


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message