You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by ab...@apache.org on 2004/06/10 15:59:06 UTC
cvs commit: jakarta-taglibs-sandbox/image/examples/web index.jsp
abey 2004/06/10 06:59:06
Modified: image/examples/web index.jsp
Log:
Added one more example working using the servlet context dir - Abey
Revision Changes Path
1.5 +49 -8 jakarta-taglibs-sandbox/image/examples/web/index.jsp
Index: index.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs-sandbox/image/examples/web/index.jsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- index.jsp 3 May 2004 15:47:42 -0000 1.4
+++ index.jsp 10 Jun 2004 13:59:06 -0000 1.5
@@ -11,7 +11,7 @@
<h1 align="center">Image Tag examples</h1>
<table width="100%" border="0" cellpadding="2">
<tr align="center">
- <td colspan="3">A Tag example.</td>
+ <td colspan="3"><h2>Example 1:</h2> <b>Saved within the context and accessed as a static image</b></td>
</tr>
<tr>
<td> </td>
@@ -19,8 +19,35 @@
<img:image src="/images/splash.jpg"
dir="generated"
+ name="splash-new-local.jpg"
+ attributes="border='0' alt='a sample dynamic image'">
+ <img:text text="Saved within the context"
+ x="10%"
+ y="75%"
+ font="Arial"
+ bold="true"
+ size="14"
+ color="0x0000ff"
+ />
+</img:image>
+
+ </td>
+ <td> </td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><hr/></td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><h2>Example 2:</h2> <b>Saved in the context temp dir and streamed by a servlet</b></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td align="center">
+
+<img:image src="/images/splash.jpg"
name="splash-new-gray.jpg"
- refresh="true"
attributes="border='0' alt='a sample dynamic image'">
<img:grayscale/>
<img:overlay x="55%" y="50%">
@@ -33,6 +60,14 @@
<img:border width="5" height="3"
color="0x005d00"/>
<img:resize bestfit="true" width="200" height="400"/>
+ <img:text text="Saved in the context temp dir"
+ x="10%"
+ y="75%"
+ font="Arial"
+ bold="true"
+ size="12"
+ color="0xff0000"
+ />
</img:image>
</td>
@@ -48,9 +83,7 @@
it (GIF on JPEG).
<pre>
<img:image src="/images/splash.jpg"
- dir="generated"
name="splash-new-gray.jpg"
- refresh="true"
attributes="border='0' alt='a sample dynamic image'">
<img:grayscale/>
<img:overlay x="55%" y="60%">
@@ -63,13 +96,21 @@
<img:border width="5" height="3"
color="0x005d00"/>
<img:resize bestfit="true" width="200" height="400"/>
+ <img:text text="Saved in the context temp dir"
+ x="10%"
+ y="75%"
+ font="Arial"
+ bold="true"
+ size="12"
+ color="0xff0000"
+ />
</img:image>
</pre>
The sequence of operations to generate the output image: -
<ol>
- <li>The image file "splash.jpg" is loaded (each time since the "refresh"
- is set to "true"). Otherwise it checks for "splash-new-gray.jpg"
- in the "generated" directory and loads it. </li>
+ <li>The image file "splash.jpg" is loaded the first time this tag/ page is accessed
+ (to load it each time the "refresh" must be set to "true").
+ Otherwise it checks if "splash-new-gray.jpg" is in the context's temp directory. </li>
<li>The image is converted to grayscale. </li>
<li>The "new.gif" is overlaid/ painted on the base image at location 5% right
and 60% below (percentages of base image's current "width" and "height"
@@ -85,7 +126,7 @@
<li>The image is saved as "splash-new-gray.jpg" in the "generated"
directory. </li>
<li>An <code><img></code> tag similar to <code><img border='0' alt='a sample dynamic image'
- src="/generated/splash-new-gray.jpg" width="200" height="132"></code>
+ src="/image-examples/gen-image/splash-new-gray.jpg" width="200" height="132"></code>
is written. The "width" and "height" are that of the resulting image.</li>
</ol>
</blockquote>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org