LoginSignup
2
2

More than 5 years have passed since last update.

StrutsのActionFormで配列を扱う

Last updated at Posted at 2013-12-10

as3からstrutsで作ったAPIに配列を渡すときにハマったのでメモ。

XxxForm.java
private List<String> tags = new ArrayList<String>();

public String getTags(int index){
    return tags.get(index);
}

public void setTags(int index, String value){
    tags.add(index, value);
}

xxx.do?tags[0]=aaa&tags[1]=bbb
のようなアクセスをすればフォームに配列がセットされる。

2
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2