Siring - simple question of a newbie

I am a jsp newbie. I try a little code as follows:

........

<% String a1="welcome to";

String a2="\n";

String a3="this test";

String a=a1+a2+a3;%>

Print out result a=

<%=a%>;

......

Then it prints a=welcome to this test.

I want to see like this:

welcome to

this test (with a line break).

But dont know why a does not show up like that.

Please help. Thanks.

[460 byte] By [Danny_55a] at [2007-10-2 20:34:25]
# 1
"\n" is a new line character in java.Your jsp is rendered in a browser, using html.The new line character in html is ""
angrycata at 2007-7-13 23:17:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Yes, however, my purpose is to create a text from several texts. I do not print that text out. Instead, I will write it into a body of a message to be sent by email.

For instance, I use a form HTML to ask users to enter their "name" and "address". Then that form points to a jsp. The jsp then creates a text=name +"\n"+address then it calls a java class to send email. In the received email, I expect to see this, for example:

Peter Richardson.

123 East Street.

Unfortunately, I still see this: Peter Richardson 123 Eas Street.

So please help. Thanks.

Danny_55a at 2007-7-13 23:17:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
What format is the email class receiving your message text?
hbskunka at 2007-7-13 23:17:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...