jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject cvs commit: jakarta-taglibs/jsptl/examples/web/iterators DataTypes.jsp
Date Thu, 04 Oct 2001 02:37:30 GMT
shawn       01/10/03 19:37:30

  Modified:    jsptl/examples/src/org/apache/taglibs/jsptl/examples/startup
                        Init.java
               jsptl/examples/web index.html
               jsptl/examples/web/iterators DataTypes.jsp
  Log:
  Changes to avoid using System.getProperties() in the 'examples' application.
  No need to perform this potentially sensitive function (which might run
  into restrictions imposed by a typical security manager).  Instead, used
  an innocuous example built up manually.
  
  Revision  Changes    Path
  1.2       +16 -5     jakarta-taglibs/jsptl/examples/src/org/apache/taglibs/jsptl/examples/startup/Init.java
  
  Index: Init.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/examples/src/org/apache/taglibs/jsptl/examples/startup/Init.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Init.java	2001/07/08 16:27:24	1.1
  +++ Init.java	2001/10/04 02:37:30	1.2
  @@ -65,7 +65,7 @@
    * used in the "examples" webapp.
    *
    * @author Pierre Delisle
  - * @version $Revision: 1.1 $ $Date: 2001/07/08 16:27:24 $
  + * @version $Revision: 1.2 $ $Date: 2001/10/04 02:37:30 $
    */
   public class Init implements ServletContextListener {
       
  @@ -125,13 +125,24 @@
   	/**
   	 * Map (Properties)
   	 */
  -	Properties systemProperties = System.getProperties();
  -        sce.getServletContext().setAttribute("systemProperties", systemProperties);
  +	// we use a Hashtable so we can get an Enumeration easily, below
  +        Hashtable numberMap = new Hashtable();
  +	sce.getServletContext().setAttribute("numberMap", numberMap);
  +	numberMap.put(new Integer(1), "uno");
  +	numberMap.put(new Integer(2), "dos");
  +	numberMap.put(new Integer(3), "tres");
  +	numberMap.put(new Integer(4), "cuatro");
  +	numberMap.put(new Integer(5), "cinco");
  +	numberMap.put(new Integer(6), "seis");
  +	numberMap.put(new Integer(7), "siete");
  +	numberMap.put(new Integer(8), "ocho");
  +	numberMap.put(new Integer(9), "nueve");
  +	numberMap.put(new Integer(10), "diez");
   
   	/**
   	 * Enumeration
   	 */
  -	Enumeration enum = systemProperties.propertyNames();
  +	Enumeration enum = numberMap.keys();
           sce.getServletContext().setAttribute("enum", enum);
       }
       
  @@ -141,4 +152,4 @@
       private void p(String s) {
           System.out.println("[Init] " + s);
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +140 -140  jakarta-taglibs/jsptl/examples/web/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/examples/web/index.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.html	2001/07/08 16:27:27	1.1
  +++ index.html	2001/10/04 02:37:30	1.2
  @@ -1,140 +1,140 @@
  -<html><!-- #BeginTemplate "/web/Templates/ExamplesTemplate.dwt" -->
  -<head>
  -<!-- #BeginEditable "doctitle" --> 
  -<title>JSPTL: Examples Web Application</title>
  -<!-- #EndEditable -->
  -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  -<link rel="stylesheet" href="global.css" type="text/css">
  -</head>
  -
  -<body bgcolor="#FFFFFF" text="#000000">
  -<table width="100%" border="0" cellpadding="5">
  -  <tr>
  -    <td height="0"><font size="-1" color="#000099"><b>JSPTL Early Access</b></font></td>
  -    <td align="center" height="0"><font size="-1" color="#000099"> <b>Beware
&#151; 
  -      API and Tags may/will change</b></font></td>
  -    <td align="right" height="0"><font size="-1" color="#003399"><a href="mailto:taglibs-user@jakarta.apache.org"><b>support</b></a>

  -      &nbsp;&nbsp;<b><a href="mailto:taglibs-dev@jakarta.apache.org">development</a>&nbsp;&nbsp;

  -      <a href="mailto:jsr052-comments@sun.com">comments to JSR052 EG</a></b></font></td>
  -  </tr>
  -  <tr> 
  -    <td colspan="3" bgcolor="#CCCCFF"><font color="#CCFF00"><b><font
color="#000099">JSPTL 
  -      Examples</font><font color="#FFFFFF">&nbsp;&nbsp;&nbsp;&nbsp;<a
href="index.html">Introduction</a> 
  -      &#149; <a href="iterators/index.html">Iterators</a> &#149; <a
href="conditionals/index.html">Conditionals</a> 
  -      &#149; <a href="elsupport/index.html">EL Support </a></font><font
color="#CCFF00"><b><font color="#FFFFFF">&#149; 
  -      <a href="misc/index.html">Misc</a></font></b></font></b></font></td>
  -  </tr>
  -</table>
  -<!-- #BeginEditable "body" -->
  -<h1>Welcome to the jsptl-examples web application!</h1>
  -<p>This web application includes a variety of sample JSP pages that showcase the

  -  JSPTL tags currently being specified within the <a href="http://www.jcp.org/jsr/detail/52.jsp">JSR-052

  -  Expert Group</a>. 
  -<p><b>WARNING: This is EARLY ACCESS (EA). The goal of this EA program is to
keep 
  -  the community informed of the EG's progress as well as to give the community 
  -  a chance to experiment with the standard tag library (JSPTL) early in the specification

  -  process so that valuable feedback can quickly be channelled back to the Expert 
  -  Group.</b>
  -<h3>Documentation</h3>
  -<p>Documentation on the JSPTL tags is available at <a href="http://jakarta.apache.org/taglibs/doc/jsptl-doc">http://jakarta.apache.org/taglibs/doc/jsptl-doc</a>.

  -  It is also available as the jsptl-docs web application of the jsptl EA1 release.
  -<h3>Mailing Lists</h3>
  -<p>There are three ways to obtain information from or send your comments to the 
  -  JSR052 Expert Group: 
  -<ol>
  -  <li><b>Support</b>: For support/usage questions, please use the <a
href="mailto:taglibs-user@jakarta.apache.org">user 
  -    mailing list</a> of jakarta-taglibs. </li>
  -  <li><b>Development</b>: For bugs, development related questions, please
use 
  -    the <a href="mailto:taglibs-dev@jakarta.apache.org">developer mailing list</a>

  -    of jakarta-taglibs</li>
  -  <li><b>Comments to the JSR052 EG</b>: To provide the Expert Group with
feedback 
  -    on the JSPTL, use either the <a href="mailto:taglibs-dev@jakarta.apache.org">developers

  -    mailing list</a> at Jakarta, or you may contact the expert group privately 
  -    at <a href="mailto:jsr052-comments@sun.com">jsr052-comments@sun.com</a>.
All 
  -    comments will be read, but we cannot guarantee a personal reply to all messages 
  -    received.</li>
  -</ol>
  -<h3>Examples</h3>
  -<p>The JSPTL examples have been divided in the following category:</p>
  -<ul>
  -  <li><a href="iterators/index.html">Iterator Tags</a> (&lt;forEach&gt;,
&lt;forToken&gt;)</li>
  -  <li><a href="conditionals/index.html">Conditional Tags</a> (&lt;if&gt;,
&lt;choose&gt;)</li>
  -  <li><a href="elsupport/index.html">Expression Language Support Tags</a>
(&lt;expr&gt;, 
  -    &lt;set&gt;, &lt;define&gt;)</li>
  -  <li><a href="misc/index.html">Miscellaneous</a> (various tests)</li>
  -</ul>
  -<p>The navigation bar at the top of each index page provides quick navigation 
  -  to each set of example pages.</p>
  -<p>When navigating the examples, the following icons will allow you to look at 
  -  the source code as well as execute the example JSP page.</p>
  -<table border="1" align="center" cellpadding="10">
  -  <tr> 
  -    <td width="30"><img src="images/code.gif"></td>
  -    <td>Look at the source code of the example JSP page</td>
  -  </tr>
  -  <tr> 
  -    <td width="30"><img src="images/execute.gif"></td>
  -    <td>Execute the example JSP page</td>
  -  </tr>
  -</table>
  -<h3>Infrastructure</h3>
  -<p>The source code for the JSPTL examples includes class <code>startup.Init</code>

  -  to initilialize the objects used in the examples. This allows us to mimic the 
  -  environment that would normally be used within an MVC architecture: the Controller 
  -  invokes the business logic, saves the objects required by the web application 
  -  into JSP scoped attributes (usually request), and then invokes the proper JSP 
  -  page. For the sake of this &quot;examples&quot; webapp, all objects are saved

  -  in the application scope.</p>
  -<p>The application attributes are:</p>
  -<ul>
  -  <li><code>customers</code><br>
  -    A collection of Customer objects</li>
  -  <li><code>intArray</code><br>
  -    An array of int's</li>
  -  <li><code>stringArray</code><br>
  -    An array of Strings</li>
  -  <li><code>systemProperties</code><br>
  -    Properties object containing all the system properties</li>
  -  <li><code>enum</code><br>
  -    An enumeration on the systemProperties object above.<br>
  -  </li>
  -</ul>
  -<p>The classes of interest that hold the information manipulated by the JSP pages

  -  are:</p>
  -<ul>
  -  <li>Customer 
  -    <ul>
  -      <li>int key</li>
  -      <li>String lastName</li>
  -      <li>String firstName</li>
  -      <li>Date birthDate</li>
  -      <li>Address address<br>
  -        <br>
  -      </li>
  -    </ul>
  -  </li>
  -  <li>Address 
  -    <ul>
  -      <li>String line1</li>
  -      <li>String line2</li>
  -      <li>String city</li>
  -      <li>String state</li>
  -      <li>String country</li>
  -    </ul>
  -  </li>
  -</ul>
  -<!-- #EndEditable -->
  -<hr noshade color="#000099">
  -<table width="100%" border="0" cellpadding="5">
  -  <tr> 
  -    <td height="24"><font size="-1" color="#000099"><b>JSPTL Early Access</b></font></td>
  -    <td align="center" height="24"><font size="-1" color="#000099"> <b>Beware

  -      &#151; API and Tags may/will change</b></font></td>
  -    <td align="right" height="24"><font size="-1" color="#003399"><a href="mailto:taglibs-user@jakarta.apache.org"><b>support</b></a>

  -      <b>&nbsp;&nbsp; <a href="mailto:taglibs-dev@jakarta.apache.org">development</a>

  -      &nbsp;&nbsp;<a href="mailto:jsr052-comments@sun.com">comments to JSR052

  -      EG</a></b></font></td>
  -  </tr>
  -</table>
  -</body>
  -<!-- #EndTemplate --></html>
  +<html><!-- #BeginTemplate "/web/Templates/ExamplesTemplate.dwt" -->
  +<head>
  +<!-- #BeginEditable "doctitle" --> 
  +<title>JSPTL: Examples Web Application</title>
  +<!-- #EndEditable -->
  +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  +<link rel="stylesheet" href="global.css" type="text/css">
  +</head>
  +
  +<body bgcolor="#FFFFFF" text="#000000">
  +<table width="100%" border="0" cellpadding="5">
  +  <tr>
  +    <td height="0"><font size="-1" color="#000099"><b>JSPTL Early Access</b></font></td>
  +    <td align="center" height="0"><font size="-1" color="#000099"> <b>Beware
&#151; 
  +      API and Tags may/will change</b></font></td>
  +    <td align="right" height="0"><font size="-1" color="#003399"><a href="mailto:taglibs-user@jakarta.apache.org"><b>support</b></a>

  +      &nbsp;&nbsp;<b><a href="mailto:taglibs-dev@jakarta.apache.org">development</a>&nbsp;&nbsp;

  +      <a href="mailto:jsr052-comments@sun.com">comments to JSR052 EG</a></b></font></td>
  +  </tr>
  +  <tr> 
  +    <td colspan="3" bgcolor="#CCCCFF"><font color="#CCFF00"><b><font
color="#000099">JSPTL 
  +      Examples</font><font color="#FFFFFF">&nbsp;&nbsp;&nbsp;&nbsp;<a
href="index.html">Introduction</a> 
  +      &#149; <a href="iterators/index.html">Iterators</a> &#149; <a
href="conditionals/index.html">Conditionals</a> 
  +      &#149; <a href="elsupport/index.html">EL Support </a></font><font
color="#CCFF00"><b><font color="#FFFFFF">&#149; 
  +      <a href="misc/index.html">Misc</a></font></b></font></b></font></td>
  +  </tr>
  +</table>
  +<!-- #BeginEditable "body" -->
  +<h1>Welcome to the jsptl-examples web application!</h1>
  +<p>This web application includes a variety of sample JSP pages that showcase the

  +  JSPTL tags currently being specified within the <a href="http://www.jcp.org/jsr/detail/52.jsp">JSR-052

  +  Expert Group</a>. 
  +<p><b>WARNING: This is EARLY ACCESS (EA). The goal of this EA program is to
keep 
  +  the community informed of the EG's progress as well as to give the community 
  +  a chance to experiment with the standard tag library (JSPTL) early in the specification

  +  process so that valuable feedback can quickly be channelled back to the Expert 
  +  Group.</b>
  +<h3>Documentation</h3>
  +<p>Documentation on the JSPTL tags is available at <a href="http://jakarta.apache.org/taglibs/doc/jsptl-doc">http://jakarta.apache.org/taglibs/doc/jsptl-doc</a>.

  +  It is also available as the jsptl-docs web application of the jsptl EA1 release.
  +<h3>Mailing Lists</h3>
  +<p>There are three ways to obtain information from or send your comments to the 
  +  JSR052 Expert Group: 
  +<ol>
  +  <li><b>Support</b>: For support/usage questions, please use the <a
href="mailto:taglibs-user@jakarta.apache.org">user 
  +    mailing list</a> of jakarta-taglibs. </li>
  +  <li><b>Development</b>: For bugs, development related questions, please
use 
  +    the <a href="mailto:taglibs-dev@jakarta.apache.org">developer mailing list</a>

  +    of jakarta-taglibs</li>
  +  <li><b>Comments to the JSR052 EG</b>: To provide the Expert Group with
feedback 
  +    on the JSPTL, use either the <a href="mailto:taglibs-dev@jakarta.apache.org">developers

  +    mailing list</a> at Jakarta, or you may contact the expert group privately 
  +    at <a href="mailto:jsr052-comments@sun.com">jsr052-comments@sun.com</a>.
All 
  +    comments will be read, but we cannot guarantee a personal reply to all messages 
  +    received.</li>
  +</ol>
  +<h3>Examples</h3>
  +<p>The JSPTL examples have been divided in the following category:</p>
  +<ul>
  +  <li><a href="iterators/index.html">Iterator Tags</a> (&lt;forEach&gt;,
&lt;forToken&gt;)</li>
  +  <li><a href="conditionals/index.html">Conditional Tags</a> (&lt;if&gt;,
&lt;choose&gt;)</li>
  +  <li><a href="elsupport/index.html">Expression Language Support Tags</a>
(&lt;expr&gt;, 
  +    &lt;set&gt;, &lt;define&gt;)</li>
  +  <li><a href="misc/index.html">Miscellaneous</a> (various tests)</li>
  +</ul>
  +<p>The navigation bar at the top of each index page provides quick navigation 
  +  to each set of example pages.</p>
  +<p>When navigating the examples, the following icons will allow you to look at 
  +  the source code as well as execute the example JSP page.</p>
  +<table border="1" align="center" cellpadding="10">
  +  <tr> 
  +    <td width="30"><img src="images/code.gif"></td>
  +    <td>Look at the source code of the example JSP page</td>
  +  </tr>
  +  <tr> 
  +    <td width="30"><img src="images/execute.gif"></td>
  +    <td>Execute the example JSP page</td>
  +  </tr>
  +</table>
  +<h3>Infrastructure</h3>
  +<p>The source code for the JSPTL examples includes class <code>startup.Init</code>

  +  to initilialize the objects used in the examples. This allows us to mimic the 
  +  environment that would normally be used within an MVC architecture: the Controller 
  +  invokes the business logic, saves the objects required by the web application 
  +  into JSP scoped attributes (usually request), and then invokes the proper JSP 
  +  page. For the sake of this &quot;examples&quot; webapp, all objects are saved

  +  in the application scope.</p>
  +<p>The application attributes are:</p>
  +<ul>
  +  <li><code>customers</code><br>
  +    A collection of Customer objects</li>
  +  <li><code>intArray</code><br>
  +    An array of int's</li>
  +  <li><code>stringArray</code><br>
  +    An array of Strings</li>
  +  <li><code>numberMap</code><br>
  +    A Map instance associating Integer objects with their Spanish names</li>
  +  <li><code>enum</code><br>
  +    An enumeration on numberMap from above.<br>
  +  </li>
  +</ul>
  +<p>The classes of interest that hold the information manipulated by the JSP pages

  +  are:</p>
  +<ul>
  +  <li>Customer 
  +    <ul>
  +      <li>int key</li>
  +      <li>String lastName</li>
  +      <li>String firstName</li>
  +      <li>Date birthDate</li>
  +      <li>Address address<br>
  +        <br>
  +      </li>
  +    </ul>
  +  </li>
  +  <li>Address 
  +    <ul>
  +      <li>String line1</li>
  +      <li>String line2</li>
  +      <li>String city</li>
  +      <li>String state</li>
  +      <li>String country</li>
  +    </ul>
  +  </li>
  +</ul>
  +<!-- #EndEditable -->
  +<hr noshade color="#000099">
  +<table width="100%" border="0" cellpadding="5">
  +  <tr> 
  +    <td height="24"><font size="-1" color="#000099"><b>JSPTL Early Access</b></font></td>
  +    <td align="center" height="24"><font size="-1" color="#000099"> <b>Beware

  +      &#151; API and Tags may/will change</b></font></td>
  +    <td align="right" height="24"><font size="-1" color="#003399"><a href="mailto:taglibs-user@jakarta.apache.org"><b>support</b></a>

  +      <b>&nbsp;&nbsp; <a href="mailto:taglibs-dev@jakarta.apache.org">development</a>

  +      &nbsp;&nbsp;<a href="mailto:jsr052-comments@sun.com">comments to JSR052

  +      EG</a></b></font></td>
  +  </tr>
  +</table>
  +</body>
  +<!-- #EndTemplate --></html>
  
  
  
  1.2       +33 -33    jakarta-taglibs/jsptl/examples/web/iterators/DataTypes.jsp
  
  Index: DataTypes.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/examples/web/iterators/DataTypes.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DataTypes.jsp	2001/07/08 16:27:29	1.1
  +++ DataTypes.jsp	2001/10/04 02:37:30	1.2
  @@ -1,40 +1,40 @@
  -<%@ taglib prefix="jx" uri="http://java.sun.com/jsptl/ea/jx" %>
  -
  +<%@ taglib prefix="jx" uri="http://java.sun.com/jsptl/ea/jx" %>
  +
   <html>
   <head>
     <title>JSPTL: Iterator Support -- Data Types Example</title>
   </head>
   <body bgcolor="#FFFFFF">
  -<h3>Data Types</h3>
  -
  -<h4>Array of primitives (int)</h4>
  -
  -<jx:forEach var="i" items="$intArray">
  -  <jx:expr value="$i"/> &#149;
  -</jx:forEach>
  -
  -<h4>Array of objects (String)</h4>
  -
  -<jx:forEach var="string" items="$stringArray">
  -  <jx:expr value="$string"/><br>
  -</jx:forEach>
  -
  -<h4>Enumeration (warning: this only works until enumeration is exhausted!)</h4>
  -
  -<jx:forEach var="item" items="$enum" begin="2" end="10" step="2">
  -  <jx:expr value="$item"/><br>
  -</jx:forEach>
  -
  -<h4>Properties (Map)</h4>
  -
  -<jx:forEach var="prop" items="$systemProperties" begin="1" end="5">
  -  <jx:expr value="$prop.key"/> = <jx:expr value="$prop.value"/><br>
  -</jx:forEach>
  -
  -<h4>String (Comma Separated Values)</h4>
  -
  -<jx:forEach var="token" items="bleu,blanc,rouge">
  -  <jx:expr value="$token"/><br>
  -</jx:forEach>
  +<h3>Data Types</h3>
  +
  +<h4>Array of primitives (int)</h4>
  +
  +<jx:forEach var="i" items="$intArray">
  +  <jx:expr value="$i"/> &#149;
  +</jx:forEach>
  +
  +<h4>Array of objects (String)</h4>
  +
  +<jx:forEach var="string" items="$stringArray">
  +  <jx:expr value="$string"/><br>
  +</jx:forEach>
  +
  +<h4>Enumeration (warning: this only works until enumeration is exhausted!)</h4>
  +
  +<jx:forEach var="item" items="$enum" begin="2" end="10" step="2">
  +  <jx:expr value="$item"/><br>
  +</jx:forEach>
  +
  +<h4>Properties (Map)</h4>
  +
  +<jx:forEach var="prop" items="$numberMap" begin="1" end="5">
  +  <jx:expr value="$prop.key"/> = <jx:expr value="$prop.value"/><br>
  +</jx:forEach>
  +
  +<h4>String (Comma Separated Values)</h4>
  +
  +<jx:forEach var="token" items="bleu,blanc,rouge">
  +  <jx:expr value="$token"/><br>
  +</jx:forEach>
   </body>
   </html>
  
  
  

Mime
View raw message