Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

out.println() does not work

Tags:

java

jsp

I have homework which I have to use scriptlets in , I need to make new line in my jsp page usint out object I tried to use

<%
out.println();
out.newLine();
 %>

but both doesn't work !!! I treid to use

out.flush()

but it doesn't work!!

like image 812
palAlaa Avatar asked Jul 02 '26 13:07

palAlaa


1 Answers

Perhaps out.println("<br>"); is what you're after. (Remember that the browser in which you're viewing the jsp-page in, interprets the output of your script as HTML, which basically ignores newline characters.)

You can look at the source of the page to see what the jsp-page actually generates.

If you really want to see the verbatim output of the jsp-script, you could do

out.println("<html><body><pre>");

// ...

out.println("</pre></body></html>");
like image 73
aioobe Avatar answered Jul 05 '26 04:07

aioobe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!