The user wants to add a tag and its related files. He will access the Struts2 action by following query URL:
Test/addTag?tag=java&files[]=1.java&files[]=2.java&files[]=3.java
In the past I was using HttpServletRequest.getParameterValues()
method to parse the files[]
parameter and it worked perfectly.
But after migrating the architecture to Struts2 (I was using JSP+Servlet before), it doesn't work anymore. I tried following ways to define the files[] field in Struts2 Acton, but neither works (it always return null when calling the getter method)
private String files;
private String[] files;
private List<String> files;
(By the way the tag
parameter could be parsed correctly)