Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to merge css code in servlet without creating separate css file?

 
Mandar Rdongare
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii,
How it can be possible to merge css code in servlet without creating separate css file?
Please help me.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets typically write HTML formatted pages - how would you include CSS code in HTML? Think about it.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although it is not advisable for markup of any kind to be generated by the servlets. Servlets should serve as controllers, not views. The servlets should perform their processing, then forward to a JSP to render the view. The CSS would be in the JSP.
 
Arun Giridhar
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I bet you can write inline style. Why you need to do that in Servlet aka Controller ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arun Giridhar wrote:you can write inline style

Inline styles are generally frowned upon. It's best to keep style separate from content/structure.
 
Arun Giridhar
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Inline styles are generally frowned upon. It's best to keep style separate from content/structure.

Your right ! ..I usually keep content and structure separate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic