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>
<name>Spring Security - Heavy Duty Sample</name>
<packaging>war</packaging>
<version>2.0.2-SNAPSHOT</version>
<version>2.0.3-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
@ -166,7 +166,7 @@
</build>
<properties>
<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>
</project>

View File

@ -1,6 +1,7 @@
package heavyduty.web;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@ -23,10 +24,15 @@ public class TestMultiActionController extends MultiActionController {
}
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 {
logger.info("x = " + Arrays.asList(request.getParameterValues("x")));
return createView("step2");
}

View File

@ -6,7 +6,9 @@
<body>
<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' />
</form>
</body>