how to make corresponding java code for html code

D

david wolf

I need to put some html code in my java bean or taglib. What I did is
that I first get these html code by designing it in front page. Since I
need to put these html code in a loop(say I want to generate a table
dynamically) in my java bean or taglib, I copied thes html code in my
java bean. And then put these in a stringbuffer.

My question is that it is so tedious to do these. I need to put
msg.append for every line of html code and also use \ to modify every
double quote inside the html.

Is there a tool to help me to this, I mean putting html code inside my
string buffer, automatically without my manually doing this?

--------------------------------------------------------
StringBuffer msg = new StringBuffer();

msg.append("<td>
msg.append("<style type="text/css">
msg.append("<!--

.....
....
 
O

Oliver Wong

david wolf said:
I need to put some html code in my java bean or taglib. What I did is
that I first get these html code by designing it in front page. Since I
need to put these html code in a loop(say I want to generate a table
dynamically) in my java bean or taglib, I copied thes html code in my
java bean. And then put these in a stringbuffer.

My question is that it is so tedious to do these. I need to put
msg.append for every line of html code and also use \ to modify every
double quote inside the html.

Is there a tool to help me to this, I mean putting html code inside my
string buffer, automatically without my manually doing this?

--------------------------------------------------------
StringBuffer msg = new StringBuffer();

msg.append("<td>
msg.append("<style type="text/css">
msg.append("<!--

How about saving your HTML code to a file, and writing your java code to
read from these files?

- Oliver
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top