Heavyduty sample additions to check multiple-parameter values

This commit is contained in:
Luke Taylor 2008-06-23 13:27:08 +00:00
parent 57558de3ec
commit 125f5911c0
3 changed files with 12 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<artifactId>spring-security-heavyduty</artifactId> <artifactId>spring-security-heavyduty</artifactId>
<name>Spring Security - Heavy Duty Sample</name> <name>Spring Security - Heavy Duty Sample</name>
<packaging>war</packaging> <packaging>war</packaging>
<version>2.0.2-SNAPSHOT</version> <version>2.0.3-SNAPSHOT</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
@ -166,7 +166,7 @@
</build> </build>
<properties> <properties>
<spring.version>2.5.4</spring.version> <spring.version>2.5.4</spring.version>
<spring.security.version>2.0.2-SNAPSHOT</spring.security.version> <spring.security.version>2.0.3-SNAPSHOT</spring.security.version>
</properties> </properties>
</project> </project>

View File

@ -1,6 +1,7 @@
package heavyduty.web; package heavyduty.web;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -23,10 +24,15 @@ public class TestMultiActionController extends MultiActionController {
} }
public void step1(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { public void step1(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.getRequestDispatcher("/testMulti.htm?action=step1xtra").forward(request, response); String[] x = request.getParameterValues("x");
logger.info("x= " + (x == null ? "null" : Arrays.asList(x)));
String[] y = request.getParameterValues("y");
logger.info("y = " + (y == null ? "null" : Arrays.asList(y)));
request.getRequestDispatcher("/testMulti.htm?action=step1xtra&x=5&x=5").forward(request, response);
} }
public ModelAndView step1xtra(HttpServletRequest request, HttpServletResponse response) throws ServletRequestBindingException { public ModelAndView step1xtra(HttpServletRequest request, HttpServletResponse response) throws ServletRequestBindingException {
logger.info("x = " + Arrays.asList(request.getParameterValues("x")));
return createView("step2"); return createView("step2");
} }

View File

@ -6,7 +6,9 @@
<body> <body>
<form action="testMulti.htm"> <form action="testMulti.htm">
<input name="action" value="${nextAction}" type="text"/> <input name="action" value="${nextAction}" type="text"/> <br/>
<input name="x" value="5" type="text"/> <br/>
<input name="y" value="5" type="text"/> <br/>
<input type='submit' value='submit' /> <input type='submit' value='submit' />
</form> </form>
</body> </body>