q javamail compile problem

J

Jason

Hi,

In my jsp page, using javamail api, if message
body="<table><tr><td><h1>333</h1></td></tr><tr><td>888</td></tr></table>";
then it's OK.
However, if it seperated to more than one line, then there will be compile
errors.
How do I edit the jsp page for the javamail messge body to serveral lines so
it will be more readable?
Any help will be appreciated.

Jason
 
E

Eki Y. Baskoro

G'Day,

How bout string concatenating it like the following:

String message = "";

message += "<table>\n";
message += "<tr>\n";
message += "<td><h1>333</h1></td>\n";
message += "</tr>\n";
message += "</table>\n";

and so on.
 
T

Thomas Schodt

G'Day,

How bout string concatenating it like the following:

String message = "";

message += "<table>\n";
message += "<tr>\n";
message += "<td><h1>333</h1></td>\n";
message += "</tr>\n";
message += "</table>\n";

Not very good for performance, you keep creating and discarding String
objects. But he could do something like

message = "<table>\n"
+ "<tr>\n"
+ "<td><h1>333</h1></td>\n"
+ "</tr>\n"
+ "</table>\n"
;
 
J

Jason

Thank you both of you!

Thomas Schodt said:
Not very good for performance, you keep creating and discarding String
objects. But he could do something like

message = "<table>\n"
+ "<tr>\n"
+ "<td><h1>333</h1></td>\n"
+ "</tr>\n"
+ "</table>\n"
;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top