File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 63865

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: html in variable inside a servlet
It's not a secret anymore!