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. Advertising

  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. Advertising

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,742
    Kevin Spencer
    Mar 2, 2005
  2. Sameer
    Replies:
    1
    Views:
    304
    Alf P. Steinbach
    Feb 21, 2006
  3. Replies:
    5
    Views:
    375
    Ben Pope
    Mar 13, 2006
  4. Replies:
    2
    Views:
    498
    Jerry Coffin
    Jul 23, 2006
  5. Replies:
    1
    Views:
    375
    Victor Bazarov
    Aug 18, 2006
Loading...

Share This Page