You are viewing a plain text version of this content. The canonical link for it is here.
Posted to watchdog-dev@jakarta.apache.org by rl...@apache.org on 2002/01/29 00:59:17 UTC

cvs commit: jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/scripting/scriptlet positiveScriptlet.jsp

rlubke      02/01/28 15:59:16

  Modified:    src/server/jsp-tests/jsp/core_syntax/scripting/scriptlet
                        positiveScriptlet.jsp
  Log:
   - content push from CTS
  
  Revision  Changes    Path
  1.3       +46 -11    jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/scripting/scriptlet/positiveScriptlet.jsp
  
  Index: positiveScriptlet.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/scripting/scriptlet/positiveScriptlet.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- positiveScriptlet.jsp	18 Dec 2001 14:26:57 -0000	1.2
  +++ positiveScriptlet.jsp	28 Jan 2002 23:59:16 -0000	1.3
  @@ -1,16 +1,51 @@
   <html>
  -<title>positiveScriptlet </title>
  +<title>positiveScriptlet</title>
   <body>
   <%  /**  Name:positiveScriptlet
  -         Description:Create a valid scriplet in the
  -              JSP page.Declare a variable and increment it.          
  -         Result: The page contents with the incremented
  -                 value of the variable
  -**/ %>                
  -<!--variable i=5 is incremented -->
  -<%! int i=5; %>
  -<% i++; %>
  -<% out.println(i); %>
  -<% i--; %>
  +         Description: Test a series of scriplets.
  +         Result: Output of all the scriplets in the order
  +                 they appear.
  +**/ %>
  +
  +<!-- Java-style comments -->
  +<%
  +// simple java comments
  +/* multiline java comments
  +*/
  +%>
  +
  +<!-- Multiline scriptlet -->
  +<%  int i=5;
  +    int j=10;
  +    if(j>i){
  +    %> 10 <% }
  +    else {
  +    %> 5 <% } %>
  +
  +<!-- Another version of a Multiline scriplet -->
  +<%! int k=5; %>
  +<%! int l=10; %>
  +<% if(l>k){ %>10 <%} else { %>
  +5 <% } %>
  +
  +<!-- A scriptlet accessing a bean -->
  +<jsp:useBean id="counter" scope="request" class="core_syntax.scripting.scriptlet.Counter" />
  +<%
  +    counter.setCounter(10);
  +    out.println(counter.getCounterValue());
  +%>
  +
  +<!-- A scriplet with try/throws/finally blocks -->
  +<%
  +    int q = 0;
  +    try {
  +        q = ( 9 / 0 );
  +    } catch ( ArithmeticException ae ) {
  +        out.println( "ArithmeticException caught!" );
  +    } finally {
  +        q = 0;
  +    }
  +%>
  +
   </body>
   </html>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>