Or redisplay in a textarea? -----Original Message----- From: Arron Bates [mailto:struts-dev@;keyboardmonkey.com] Sent: 23 October 2002 17:20 To: Struts Developers List Subject: Re: HTML formatting of newline characters with bean:write tag
Craig R. McClanahan wrote: >Can't you just embed your <bean:write> tag inside a <pre> element and get >the same effect? > >Craig > pre opens a can of worms if the designers/managers are picky. For one, it roots the browsers ability to word wrap. Use a regex in your action code or some funky tag and replace them with <br /> 's before output. It's the only way to get a true representation. Arron. > > >On Wed, 23 Oct 2002, Inge Solvoll wrote: > > > >>Date: Wed, 23 Oct 2002 14:25:48 +0200 >>From: Inge Solvoll <[EMAIL PROTECTED]> >>Reply-To: Struts Developers List <[EMAIL PROTECTED]> >>To: [EMAIL PROTECTED] >>Subject: HTML formatting of newline characters with bean:write tag >> >>When outputting text with the bean:write tag, it can be text that was >>entered by a user in a textarea. The text is submitted with \n (linefeed) >>characters, and in most cases that I can think of, these linefeeds should >>be preserved when outputted in HTML. Why isn't all newline characters >>translated into BR tags when outputted through the bean:write tags? In PHP, >>this functionality exists in the nl2br function, but I normally expect >>Struts to perform things like this in a more transparent and elegant way. >> >>There is probably a reason for why this functionality doesn't exist, that I >>don't see right now. Or, it exists but I didn't do a good job looking for it? >> >>Anyway, I solved the problem for myself by rewriting WriteTag in the >>taglib.bean package to perform the needed translation from \n to BR-tags. >>Clearly, this is not a very elegant way of solving the problem, so I would >>be very happy to get some feedback on this issue. >> >>I hope this is the correct mailing list to submit this to, this is my first >>contact with this list. My company uses Struts extensively in an advanced >>way, and we often run into problems that there exists very little >>information about online. I believe these problems would be interesting for >>the Struts developers, so I will post a description later on. >> >>Keep up the good work! >> >>Inge :-) >> >> >>-- >>To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@;jakarta.apache.org> >>For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org> >> >> >> >> > > >-- >To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@;jakarta.apache.org> >For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org> > > > -- To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org> *************************************************************************** This communication (including any attachments) contains confidential information. If you are not the intended recipient and you have received this communication in error, you should destroy it without copying, disclosing or otherwise using its contents. Please notify the sender immediately of the error. Internet communications are not necessarily secure and may be intercepted or changed after they are sent. Abbey National Treasury Services plc does not accept liability for any loss you may suffer as a result of interception or any liability for such changes. If you wish to confirm the origin or content of this communication, please contact the sender by using an alternative means of communication. This communication does not create or modify any contract and, unless otherwise stated, is not intended to be contractually binding. Abbey National Treasury Services plc. Registered Office: Abbey National House, 2 Triton Square, Regents Place, London NW1 3AN. Registered in England under Company Registration Number: 2338548. Regulated by the Financial Services Authority (FSA). *************************************************************************** -- To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>