How to quit from JSP's scriptlet?

Discussions

Web tier: servlets, JSP, Web frameworks: How to quit from JSP's scriptlet?

  1. How to quit from JSP's scriptlet? (3 messages)

    AS the title, how can I quit from the JSP's scriptlet if I don't want to execute other statements within the scriptlet.
    Like the following example, if expression is true, the System.out.println("test2") should not be execute.
    EX:
    <%
      System.out.println("test1");
      if (expression) =====>quit;
      System.out.println("test2");
    %>
  2. Re:How to quit from JSP's scriptlet?[ Go to top ]

    In this particular example you could say,

    if(!expression)
    {
      System.out.println("test2");
    }

    That means System.out.println("test2") will be executed only if the expression is false


    Rahul
  3. Re:How to quit from JSP's scriptlet?[ Go to top ]

    I know that.

    The problem is that I don't want to code like that because theses codes are included in other jsp files which use <%@ include file='...' %> Directive.
  4. Re:How to quit from JSP's scriptlet?[ Go to top ]

    Keep trying, you'll figure it out.