I am trying to use a simple JSP page that tests for an existing Bean, and uses the pre-existence of it as a logic branch by putting some code in the initialization part of the jsp:usebean, and then a <%return;%> statement.

But,
I find that both Tomcat and Websphere put some code after my last code in the init branch, and thus it becomes invalid Java.

  <!-- Access bean, else create -->
  <jsp:useBean id="msg" class="String" scope="session">
     New.
     <% return; %>
  </jsp:useBean>
     Old.

Is this valid JSP? If not, where is the spec. section that would pertain to this?

It seems logical...! :-)

Error: 500
Location: /test/aTest_1.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSPE:\Net\Apache\Tomcat\work\localhost_8080%2Ftest\_0002faTest_0005f_00031_0002ejspaTest_0005f1_jsp_0.java:85: Statement not reached.
                out.write("\r\n\r\n");

Thanks.

-----------------------------------------------
Gregory Guthrie

MUM Faculty Mail - FM 1068
Farfield, IA 52557

http://www.mum.edu/~guthrie
(641)472-7773
------------------------------------------------

Reply via email to