Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to output HTML code in methods without out.print

843833Jul 16 2001 — edited Aug 28 2001
Hi,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2001
Added on Jul 16 2001
8 comments
192 views