Author: jfrederic.clere(a)jboss.com
Date: 2008-06-19 06:02:03 -0400 (Thu, 19 Jun 2008)
New Revision: 673
Added:
sandbox/webapps/html/test_form.html
sandbox/webapps/html/test_form.jsp
Modified:
sandbox/webapps/myapp.xml
sandbox/webapps/src/TestFilter.java
Log:
Add a simple test for JBAS-5645
Added: sandbox/webapps/html/test_form.html
===================================================================
--- sandbox/webapps/html/test_form.html (rev 0)
+++ sandbox/webapps/html/test_form.html 2008-06-19 10:02:03 UTC (rev 673)
@@ -0,0 +1,15 @@
+<html>
+<head>
+ <title>Form test Example</title>
+</head>
+<body>
+
+<b> Send something...</b>
+<form name="myform" action="test_form.jsp"
method="post">
+ Specify your name:<br />
+ <input type="text" name="name"
size="15"/><br/>
+ <input type="submit" name="Submit" value="Submit your
files"/>
+</form>
+
+</body>
+</html>
Added: sandbox/webapps/html/test_form.jsp
===================================================================
--- sandbox/webapps/html/test_form.jsp (rev 0)
+++ sandbox/webapps/html/test_form.jsp 2008-06-19 10:02:03 UTC (rev 673)
@@ -0,0 +1,28 @@
+<html>
+<head>
+ <title>Form test Example</title>
+</head>
+<body>
+
+<%
+String value = request.getParameter("name");
+if (value != null) {
+%>
+ <h1>Data Received at the Server</h1>
+
+Name <%= value %><br/>
+<%
+} else {
+%>
+<b> Nothing received</b>
+<form name="myform" action="test_form.jsp"
method="post">
+ Specify your name:<br />
+ <input type="text" name="name"
size="15"/><br/>
+ <input type="submit" name="Submit" value="Submit your
files"/>
+</form>
+<%
+}
+%>
+
+</body>
+</html>
Modified: sandbox/webapps/myapp.xml
===================================================================
--- sandbox/webapps/myapp.xml 2008-06-19 03:21:52 UTC (rev 672)
+++ sandbox/webapps/myapp.xml 2008-06-19 10:02:03 UTC (rev 673)
@@ -166,11 +166,13 @@
<url-pattern>/TestDispatch</url-pattern>
</servlet-mapping>
+
<!-- Security testings -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Security Tests</web-resource-name>
<url-pattern>/UTF8.jsp</url-pattern>
+ <url-pattern>/test_form.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
Modified: sandbox/webapps/src/TestFilter.java
===================================================================
--- sandbox/webapps/src/TestFilter.java 2008-06-19 03:21:52 UTC (rev 672)
+++ sandbox/webapps/src/TestFilter.java 2008-06-19 10:02:03 UTC (rev 673)
@@ -77,8 +77,11 @@
chain.doFilter(request, response);
return;
}
+ if (path.endsWith(".jsp")) {
+ chain.doFilter(request, response);
+ return;
+ }
-
// get action
String action = req.getParameter("do");
if (action == null) {