What I am doing is Ciphering a url parameter, so &m=(ciphered text here),
and java's ciphering returns a byte[] to you, so I needed to convert it from
byte[] to a string that I could set as a url parameter, then reverse
everything when I get that url back.

-David

> -----Original Message-----
> From: Martin Gainty [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 22, 2005 2:17 PM
> To: Struts Users Mailing List
> Subject: Re: How to encode byte array as url parameter
> 
> David
> Any reason why you're not constructing java.net.URL from string? and then
> using toExternalForm() to convert back to String?
> http://java.sun.com/j2se/1.5.0/docs/api/
> ???
> Martin-
> ----- Original Message -----
> From: "David Erickson" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <user@struts.apache.org>
> Sent: Wednesday, June 22, 2005 3:54 PM
> Subject: RE: How to encode byte array as url parameter
> 
> 
> >I took a look at that commons encoder and for encoding a byte[] it
> returns
> >a
> > byte[].. seems pointless to me?
> > -David
> >
> >> -----Original Message-----
> >> From: Dave Newton [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, June 22, 2005 1:41 PM
> >> To: Struts Users Mailing List
> >> Subject: Re: How to encode byte array as url parameter
> >>
> >> David Erickson wrote:
> >>
> >> >Hi I am wondering how I can take a byte[] and use it as a URL
> parameter?
> >> I
> >> >have tried converting it to a string using varying character sets, but
> >> when
> >> >I call string.getbytes I never get back my original array.  Any help
> >> would
> >> >be greatly appreciated.
> >> >
> >> >
> >> Googled "url encode byte" to get:
> >>
> http://jakarta.apache.org/commons/codec/apidocs/org/apache/commons/codec/n
> >> et/URLCodec.html
> >>
> >> which pointed me to if you don't want to use the above:
> >> http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1 (how to
> >> encode bytes in a URL)
> >>
> >> Dave
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to