How to output HTML code in methods without out.print
843833Jul 16 2001 — edited Aug 28 2001Hi,
I am trying to create a larger web-site with jsp. At first I tried to structure the page using include files. Since there is a limit for the length of if/else blocks, I now switched to using methods instead.
The Problem I have is that there a larger HTML blocks I dont want to print with out.print because that would make the source unreadable.
Unfortunately the <%= tag doesnt work in methods.
Here a code sample:
<%!
public void processOrder()
{
for(int i=1; i<10; i++)
{
out.print("<table>");
out.print("<tr>");
out.print("<td>Your Order:<td>");
...
}
}
%>
Isnt there a way to use a tag like <%= ?
Or are there other constructs then methods which can handle <%= ?
With PHP it would be no problem. So I wonder why there should be no way to do it with jsp.