Newline doesn't work

2009-03-18 Thread Mighty Tornado
Silly question.
I wrote a servlet that gets init params from the web.xml and stuffs them
into the request which is the displayed by JSP.

But when I try to make it a string with newline characters it still prints
everything in one line - like newline characters turn into regular space
characters.

This is the code:

String newline = System.getProperty(line.separator);

String rName = getServletConfig().getInitParameter(rName);

String kName = getServletConfig().getInitParameter(kName);

result += Family Members + newline;

result += rName + newline;

result += kName + newline;


I tried \n, and '\n' as well.


Thanks.


Re: Newline doesn't work

2009-03-18 Thread Timothy J Schumacher

Try

If this is going to be displayed by a browser then try:

String newline = br;

-Tim

Mighty Tornado wrote:

Silly question.
I wrote a servlet that gets init params from the web.xml and stuffs them
into the request which is the displayed by JSP.

But when I try to make it a string with newline characters it still prints
everything in one line - like newline characters turn into regular space
characters.

This is the code:

String newline = System.getProperty(line.separator);

String rName = getServletConfig().getInitParameter(rName);

String kName = getServletConfig().getInitParameter(kName);

result += Family Members + newline;

result += rName + newline;

result += kName + newline;


I tried \n, and '\n' as well.


Thanks.

  


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Newline doesn't work

2009-03-18 Thread Caldarale, Charles R
 From: Mighty Tornado [mailto:mighty.torn...@gmail.com] 
 Subject: Newline doesn't work
 
 But when I try to make it a string with newline characters it 
 still prints everything in one line - like newline characters 
 turn into regular space characters.

That's the way HTML works.  You need to separate lines by p or br; 
experiment with both to see which is more to your liking.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Newline doesn't work

2009-03-18 Thread Ilya Kazakevich
Mighty, 

Here is good and small HTML tutorial, which I advice you to read:
http://www.w3schools.com/html/default.asp
 
-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, March 18, 2009 7:41 PM
To: Tomcat Users List
Subject: RE: Newline doesn't work

 From: Mighty Tornado [mailto:mighty.torn...@gmail.com]
 Subject: Newline doesn't work
 
 But when I try to make it a string with newline characters it still 
 prints everything in one line - like newline characters turn into 
 regular space characters.

That's the way HTML works.  You need to separate lines by p or br;
experiment with both to see which is more to your liking.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Newline doesn't work

2009-03-18 Thread Mighty Tornado
Thank you all. The answers were very valuable and I got the thing to work.

On Wed, Mar 18, 2009 at 1:41 PM, Ilya Kazakevich
kazakev...@devexperts.comwrote:

 Mighty,

 Here is good and small HTML tutorial, which I advice you to read:
 http://www.w3schools.com/html/default.asp

 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: Wednesday, March 18, 2009 7:41 PM
 To: Tomcat Users List
 Subject: RE: Newline doesn't work

  From: Mighty Tornado [mailto:mighty.torn...@gmail.com]
  Subject: Newline doesn't work
 
  But when I try to make it a string with newline characters it still
  prints everything in one line - like newline characters turn into
  regular space characters.

 That's the way HTML works.  You need to separate lines by p or br;
 experiment with both to see which is more to your liking.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Newline doesn't work

2009-03-18 Thread André Warnier

Mighty Tornado wrote:

Thank you all. The answers were very valuable and I got the thing to work.

You don't seem to realise how nice they all were.  I tell you, no 
technical issue is too complex for these guys.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org