jespersahner
asked on
Nesting mixed Scriptlets and HTML
Hi!
This is a basic question concerning nesting mixed Scriptlets and HTML.
Say that you have some JSP-code like this:
<TABLE BORDER=2>
<%
for ( int i = 0; i < n; i++ ) {
%>
<TR>
<TD>Number</TD>
<TD><%= i+1 %></TD>
</TR>
<%
}
%>
</TABLE>
- i.e. mixed Scriptlets and HTML.
My question now is: Can mixed Scriptlets and HTML be nested?
Say that the code above should only be carried out if some condition is meet, i.e.:
<%if (some condition) { %>
..some mix of Scriptlet and HTML..
<% } %>
Will this work?
Regards,
Jesper
This is a basic question concerning nesting mixed Scriptlets and HTML.
Say that you have some JSP-code like this:
<TABLE BORDER=2>
<%
for ( int i = 0; i < n; i++ ) {
%>
<TR>
<TD>Number</TD>
<TD><%= i+1 %></TD>
</TR>
<%
}
%>
</TABLE>
- i.e. mixed Scriptlets and HTML.
My question now is: Can mixed Scriptlets and HTML be nested?
Say that the code above should only be carried out if some condition is meet, i.e.:
<%if (some condition) { %>
..some mix of Scriptlet and HTML..
<% } %>
Will this work?
Regards,
Jesper
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>Not really
I know LOL :-). Dint mean it literally.
I know LOL :-). Dint mean it literally.
>scriplets are outdated
Maybe :) But are working.
Besides sometime I love writing them... simply to remember the old days :)
Maybe :) But are working.
Besides sometime I love writing them... simply to remember the old days :)
Not really, Sometimes I like to use print method.
<TABLE BORDER=2>
<%
for ( int i = 0; i < 6; i++ ) {
out.print("<TR><TD>Number<
}
%>
</TABLE>