On Thu, 2004-02-12 at 10:22, beyaNet Consultancy wrote: > Eduard, > I tried your recommendation and it worked partly but the output to > thescreen is incorrect. I am getting �t�h�i�s� written > tothe screen instead of plain text with out the � being written > tothe screen as well. How do I deal with this?
Perhaps there is some characterset problem? You could try: new String(text,"ISO-8859-1") or whatever charset your getArtistPhoto1() returns > And if the output streamwas an image or audio how would I deal with > those outputs as well? forinstance if: > > 1. byte[] text = newArt.getArtistPhoto1(); allows me to > do<xsp:expr>new String(text)</xsp:expr> in my xsp page, how would > Ideal with: > > 2. byte[] image = newArt.getArtistPhoto1(); or > > 3. byte[] audio = newArt.getArtistPhoto1(); > You cannot put binary data in an <xsp:expr>. You always get the image etc. in your webpage through an extra request from for example a <img> tag. You have to create a pipeline that delivers the binary data. If the binary data are static you can use a <map:read>. If the binary data are dynamically generated you may have to write your own reader or a serializer.... Eduard > many thanks in advance > On 12 Feb 2004, at 06:37, Eduard Drenth wrote: > > On Thu, 2004-02-12 at 01:48, beyaNet Consultancy wrote: > Hi, > I have the following code in my xsp page: > > byte[] binImg = newArt.getArtistPhoto1(); > > I now want to display this stream in the page like so: > > <xsp:expr>binImg</xsp:expr> > > > If this is a textfile try: <xsp:expr>new > String(binImg)</xsp:expr> > > but am getting, as expected, casting errors. What do i > needto do > todisplay the contents of this stream, which was a > simple txt file > readinto postgresql as a byte array? Any help with > this issue will be > mostappreciated. > > > many thanks in advance > -- > Eduard Drenth <[EMAIL PROTECTED]> > home sweet home > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Eduard Drenth <[EMAIL PROTECTED]> home sweet home --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
