• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

embedding html in servlets

 
Vinay Thippeswamy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,

iam new to servlets. Is there any utility to convert all that html into code that is compatabile to fit into out.println(). i mean with all that double quotation inserted automatically. i tried google but didnt find anything.

thanks
vinay.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simple answer would be : don't do this in a servlet, that is not its role. Output html in html/jsp files, that will save you time and readability.
 
Vinay Thippeswamy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,
i knew about that. i was wondering if there was such an utility.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A search and replace with regular expressions with a simple text editor ?
1. Replace the start of a line with out.print("
2. Replace the end of a line with ");
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"vinay vinay",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Vinay Thippeswamy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry.
i had read your naming policy. and i knew i would be warned about it.
but i have just one name and thats VINAY. since your form didnt allow me to proceed, i had no choice but to put my last name as vinay.

hey how about vinay schwarzenegger???

regards
vinay
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please respond to the Private Message that I sent to you.
 
rajsunder reddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
A search and replace with regular expressions with a simple text editor ?
1. Replace the start of a line with out.print("
2. Replace the end of a line with ");


did you try doing it with any html page???
HINT: there are some things called escape characters that need to be taken care of, if you dont then there would be 165 errors when you compile iit
 
Al Hollis
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can just put html tags directly into a print statement exactly as mentioned above
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rajsunder, thank you for warning about escape characters

did you try doing it with any html page???

Actually no, because I always put HTML where it ought to be : in an HTML/JSP file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic