added elements for POST method testing
authormaxcooper <maxcooper>
Sat, 14 Jun 2003 14:10:42 +0000 (14:10 +0000)
committermaxcooper <maxcooper>
Sat, 14 Jun 2003 14:10:42 +0000 (14:10 +0000)
src/example/org/securityfilter/example/Constants.java
web/share/index.jsp
web/share/logout.jsp
web/share/securePage.jsp

index 1568297..0fa4ebd 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * $Header: /cvsroot/securityfilter/securityfilter/src/example/org/securityfilter/example/Constants.java,v 1.2 2003/06/09 12:05:17 maxcooper Exp $
- * $Revision: 1.2 $
- * $Date: 2003/06/09 12:05:17 $
+ * $Header: /cvsroot/securityfilter/securityfilter/src/example/org/securityfilter/example/Constants.java,v 1.3 2003/06/14 14:10:42 maxcooper Exp $
+ * $Revision: 1.3 $
+ * $Date: 2003/06/14 14:10:42 $
  *
  * ====================================================================
  * The SecurityFilter Software License, Version 1.1
@@ -59,7 +59,7 @@ package org.securityfilter.example;
  * Constants - constants for the example applications to facilitate testing
  *
  * @author Max Cooper (max@maxcooper.com)
- * @version $Revision: 1.2 $ $Date: 2003/06/09 12:05:17 $
+ * @version $Revision: 1.3 $ $Date: 2003/06/14 14:10:42 $
  */
 public interface Constants {
 
@@ -71,14 +71,20 @@ public interface Constants {
 
    // home page constants
    public static final String HOME_TITLE = COMMON_TITLE_BASE + "Home";
-   
+   public static final String HOME_FORM_ID = "homeForm";
+   public static final String HOME_POST_FIELD = "postMe";
+
    // login form constants
    public static final String LOGIN_TITLE = COMMON_TITLE_BASE + "Login Page";
-   public static final String LOGIN_FORM_ID = "login";
+   public static final String LOGIN_FORM_ID = "loginForm";
    public static final String LOGIN_FORM_ACTION = "j_security_check";
    public static final String LOGIN_USERNAME_FIELD = "j_username";
    public static final String LOGIN_PASSWORD_FIELD = "j_password";
 
    // secure page constants
    public static final String SECURE_TITLE = COMMON_TITLE_BASE + "Secure Page";
+   public static final String SECURE_POSTED_VALUE_ID = "postedValue";
+
+   // logout page constants
+   public static final String LOGOUT_TITLE = COMMON_TITLE_BASE + "Logout";
 }
index 55b7995..6a1f05d 100644 (file)
@@ -9,5 +9,14 @@
 <h1><%=Constants.HOME_TITLE%></h1>
 <%@include file="/menu.jsp" %>
 Welcome to the Security Filter example application. Use the menu above to navigate the site.
+
+<h2>POST to the Secure Page</h2>
+This form POSTs to the Secure Page. By entering a value here and clicking the submit button below, you can
+verify that POSTed parameters are maintained through the login sequence.
+<form id="<%=Constants.HOME_FORM_ID%>" action="<%=request.getContextPath()%>/securePage.jsp" method="POST">
+<input type="text" name="<%=Constants.HOME_POST_FIELD%>">
+<input type="submit">
+</form>
+
 </body>
 </html>
\ No newline at end of file
index d1cb839..3254a18 100644 (file)
@@ -1,13 +1,18 @@
+<%@ page import="org.securityfilter.example.Constants"%>
+
 <html>
+
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>SecurityFilter Example Application: Logout</title>
+<title><%=Constants.LOGOUT_TITLE%></title>
 </head>
+
 <body>
-<h1>SecurityFilter Example Application: Logout</h1>
+<h1><%=Constants.LOGOUT_TITLE%></h1>
 <%@include file="/menu.jsp" %>
 <% session.invalidate(); %>
 You have been logged out of the SecurityFilter example application.<p>
 This operation was achieved with a simple call to <code>session.invalidate()</code>.
 </body>
+
 </html>
\ No newline at end of file
index 0deaa05..159ca40 100644 (file)
 
 Welcome <i><%=request.getRemoteUser()%></i>, you are viewing a secure page.
 
+<%
+   String postedValue = request.getParameter(Constants.HOME_POST_FIELD);
+   if (postedValue != null) {
+%>
+<h2>You POSTed a value from the Home Page!</h2>
+The value you posted was &quot;<span id="<%=Constants.SECURE_POSTED_VALUE_ID%>"><%=postedValue%></span>&quot;.
+<%
+   }
+%>
+
 </body>
 </html>
\ No newline at end of file