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 gl...@apache.org on 2001/07/15 18:23:11 UTC
cvs commit: jakarta-taglibs/response/examples/web index.html response.jsp senderror.jsp sendredirect.jsp
glenn 01/07/15 09:23:11
Modified: response/examples/web index.html response.jsp senderror.jsp
sendredirect.jsp
Log:
Implement new tag design guidelines
Revision Changes Path
1.3 +5 -5 jakarta-taglibs/response/examples/web/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-taglibs/response/examples/web/index.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- index.html 2000/12/04 01:41:00 1.2
+++ index.html 2001/07/15 16:23:10 1.3
@@ -2,9 +2,9 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.74 [en] (X11; U; FreeBSD 3.4-RELEASE i386) [Netscape]">
+ <title>Jakarta RESPONSE Taglib Example</title>
</head>
-<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
+<body bgcolor="#FFFFFF">
<center>
<h1>
@@ -15,10 +15,10 @@
<br><br>
View the <a href="response.jsp">response.jsp</a> example page.
<br>
-See the source from the <a href="response.txt">response.jsp</a> example page.
+See the source from the <a href="response.html">response.jsp</a> example page.
<br>
-See the source from the <a href="senderror.txt">senderror.jsp</a> example page.
+See the source from the <a href="senderror.html">senderror.jsp</a> example page.
<br>
-See the source from the <a href="sendredirect.txt">sendredirect.jsp</a> example page.
+See the source from the <a href="sendredirect.html">sendredirect.jsp</a> example page.
</body>
</html>
1.2 +31 -32 jakarta-taglibs/response/examples/web/response.jsp
Index: response.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/response/examples/web/response.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- response.jsp 2000/09/26 20:00:35 1.1
+++ response.jsp 2001/07/15 16:23:11 1.2
@@ -2,10 +2,9 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.74 [en] (X11; U; FreeBSD 3.4-RELEASE i386) [Netscape]">
<title>Jakarta RESPONSE Taglib Example</title>
</head>
-<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
+<body bgcolor="#FFFFFF">
<center>
<h1>
@@ -16,62 +15,62 @@
<p>
<pre>
Test to see if response output is committed:
-<res:iscommitted>
+<res:isCommitted>
Response is already committed!
-</res:iscommitted>
-<res:iscommitted value="false">
+</res:isCommitted>
+<res:isCommitted value="false">
Response is not committed yet.
-</res:iscommitted>
+</res:isCommitted>
Add a Cookie using tag attributes and JSP:
-<res:addcookie name="test1" value="First test cookie" comment="response addcookie tag" maxage="-1" path="/example-response/" secure="false" version="1">
+<res:addCookie name="test1" value="First test cookie" comment="response addCookie tag" maxAge="-1" path="/example-response/" secure="false" version="1">
Now add the domain dynamically, any of the attributes except <b>name</b>
can be added dynamically. The domain is obtained from the JSESSIONID
cookie if it exists.
- <req:existscookie name="JSESSIONID">
+ <req:existsCookie name="JSESSIONID">
<req:cookies id="sess" name="JSESSIONID">
<res:domain><jsp:getProperty name="sess" property="domain"/></res:domain>
</req:cookies>
- </req:existscookie>
-</res:addcookie>
+ </req:existsCookie>
+</res:addCookie>
See if the Expires HTTP header exists:
-<res:containsheader name="Expires">
+<res:containsHeader name="Expires">
Expires header already exists!
-</res:containsheader>
-<res:containsheader name="Expires" value="false">
+</res:containsHeader>
+<res:containsHeader name="Expires" value="false">
Set Expires HTTP Header to 0:
- <res:setintheader name="Expires">0</res:setintheader>
-</res:containsheader>
+ <res:setIntHeader name="Expires">0</res:setIntHeader>
+</res:containsHeader>
Now see if the Expires HTTP header exists:
-<res:containsheader name="Expires">
+<res:containsHeader name="Expires">
Expires header exists.
-</res:containsheader>
-<res:containsheader name="Expires" value="false">
+</res:containsHeader>
+<res:containsHeader name="Expires" value="false">
Expires header does not exist.
-</res:containsheader>
-Test addheader by adding the Cache-Control header:
+</res:containsHeader>
+Test addHeader by adding the Cache-Control header:
Cache-Control:no-cache
- <res:addheader name="Cache-Control">no-cache</res:addheader>
+ <res:addHeader name="Cache-Control">no-cache</res:addHeader>
Cache-Control:no-store
- <res:addheader name="Cache-Control">no-store</res:addheader>
+ <res:addHeader name="Cache-Control">no-store</res:addHeader>
Test flushing output buffer:
-<res:flushbuffer/>
+<res:flushBuffer/>
Now see if response output is committed:
-<res:iscommitted>
+<res:isCommitted>
Response is already committed!
-</res:iscommitted>
-<res:iscommitted value="false">
+</res:isCommitted>
+<res:isCommitted value="false">
Response is not committed yet.
-</res:iscommitted>
-Test the encodeurl tag:
-Try the <a href="<res:encodeurl>sendredirect.jsp</res:encodeurl>">sendredirect.jsp</a> page, it redirects you back to index.html.
-Try the <a href="<res:encodeurl>senderror.jsp</res:encodeurl>">senderror.jsp</a> page, it returns back an unathorized error (401).
+</res:isCommitted>
+Test the encodeUrl tag:
+Try the <a href="<res:encodeUrl>sendredirect.jsp</res:encodeUrl>">sendredirect.jsp</a> page, it redirects you back to index.html.
+Try the <a href="<res:encodeUrl>senderror.jsp</res:encodeUrl>">senderror.jsp</a> page, it returns back an unathorized error (401).
Test setting the status code for the response to SC_OK:
-<res:setstatus status="SC_OK"/>
+<res:setStatus status="SC_OK"/>
Test setting the content type to text/html:
-<res:setcontenttype>text/html</res:setcontenttype>
+<res:setContentType>text/html</res:setContentType>
</pre>
1.2 +3 -4 jakarta-taglibs/response/examples/web/senderror.jsp
Index: senderror.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/response/examples/web/senderror.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- senderror.jsp 2000/09/26 20:00:37 1.1
+++ senderror.jsp 2001/07/15 16:23:11 1.2
@@ -2,14 +2,13 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.74 [en] (X11; U; FreeBSD 3.4-RELEASE i386) [Netscape]">
<title>Jakarta RESPONSE Taglib Example</title>
</head>
-<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
+<body bgcolor="#FFFFFF">
<%@ taglib uri="http://jakarta.apache.org/taglibs/response-1.0" prefix="res" %>
-<res:senderror error="SC_UNAUTHORIZED" reset="true">
+<res:sendError error="SC_UNAUTHORIZED" reset="true">
Test of RESPONSE tag library senderror!
-</res:senderror>
+</res:sendError>
</body>
</html>
1.2 +4 -3 jakarta-taglibs/response/examples/web/sendredirect.jsp
Index: sendredirect.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/response/examples/web/sendredirect.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sendredirect.jsp 2000/09/26 20:00:35 1.1
+++ sendredirect.jsp 2001/07/15 16:23:11 1.2
@@ -2,16 +2,17 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.74 [en] (X11; U; FreeBSD 3.4-RELEASE i386) [Netscape]">
<title>Jakarta RESPONSE Taglib Example</title>
</head>
-<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
+<body bgcolor="#FFFFFF">
<center>
<h1>
Jakarta RESPONSE Taglib Example</h1></center>
<br>
<%@ taglib uri="http://jakarta.apache.org/taglibs/response-1.0" prefix="res" %>
-<res:sendredirect><res:encoderedirecturl>index.html</res:encoderedirecturl></res:sendredirect>
+<res:sendRedirect>
+ <res:encodeRedirectUrl>index.html</res:encodeRedirectUrl>
+</res:sendRedirect>
</body>
</html>