how to make corresponding java code for html code

Discussion in 'Java' started by david wolf, Apr 21, 2006.

  1. david wolf

    david wolf Guest

    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("<!--

    .....
    ....
     
    david wolf, Apr 21, 2006
    #1
    1. Advertisements

  2. david wolf

    Oliver Wong Guest

    "david wolf" <> wrote in message
    news:...
    >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
     
    Oliver Wong, Apr 21, 2006
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TJS
    Replies:
    1
    Views:
    1,878
    Kevin Spencer
    Mar 2, 2005
  2. Jim in Arizona
    Replies:
    4
    Views:
    8,434
    Jim in Arizona
    Aug 24, 2005
  3. Vijay
    Replies:
    4
    Views:
    1,552
    Vijay
    Apr 13, 2005
  4. H5N1
    Replies:
    0
    Views:
    2,982
  5. Sameer
    Replies:
    1
    Views:
    358
    Alf P. Steinbach
    Feb 21, 2006
  6. Replies:
    5
    Views:
    423
    Ben Pope
    Mar 13, 2006
  7. Replies:
    2
    Views:
    650
    Jerry Coffin
    Jul 23, 2006
  8. Replies:
    1
    Views:
    456
    Victor Bazarov
    Aug 18, 2006
Loading...