In JSP, you have an implicit out
object. Use out.println()
to print on web pages.
Additionally, inside HTML you can use <% = "Message"%> (or <% myMessage.toString ()%> for the same effect
UPDATE:
Either you are in a JSP (or servlet) or not. The object that receives the stream for writing HTML is the servlet * (explicit or compiled from JSP). If you can write from another class, you need to pass out
this class and use it (you cannot write to a web page using System.out).
Be careful not to pass it to the business logic class, they must be incompatible with the user interface (i.e. they do not need to know that the user interface is HTML); this will be bad practice, as it will mix inner classes with external output.
source share