aspose file tools
The moose likes Servlets and the fly likes html in variable inside a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "html in variable inside a servlet" Watch "html in variable inside a servlet" New topic

html in variable inside a servlet

Ed Carrington
Ranch Hand

Joined: Oct 11, 2007
Posts: 77
For my Servlet controller I forward to specific JSP depending on user action. I forward messages using sessions depending on the action and some of the messages need to have HTML <br> so I can break up the message line by line:

For good MVC skills, is it okay to forward html in a Servlet like above example?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 61985

It wouldn't be my first choice.

You haven't given us any indication as to why you feel the markup needs to be generated from a servlet.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: html in variable inside a servlet