나만 몰랐나?? 아래처럼 하니까 되네여 ㅋ
struts 제공 태그는 사용안함...
<input type="text" name="work" onclick="goCalendar('work','0')" style="cursor:hand" />
위와 같은 태그가 한개 있을 경우 Struts FormBean 에서는 아래와 같이 코딩하면 받을 수 있다.
private String work;
public void setWork(String work){ .... }
public String getWork(){ return work; }
그런데 work 라는 TextField 가 여러개 있을 경우에는???
<input type="text" name="work[]" onclick="getDate('work','0')" style="cursor:hand" />
<input type="text" name="work[]" onclick="getDate('work','1')" style="cursor:hand" />
<input type="text" name="work[]" onclick="getDate('work','2')" style="cursor:hand" />
<input type="text" name="work[]" onclick="getDate('work','3')" style="cursor:hand" />
위와 같은 형식으로 사용해도 된다.
또는...
<input type="text" name="work" onclick="getDate('work','0')" style="cursor:hand" />
<input type="text" name="work" onclick="getDate('work','1')" style="cursor:hand" />
<input type="text" name="work" onclick="getDate('work','2')" style="cursor:hand" />
<input type="text" name="work" onclick="getDate('work','3')" style="cursor:hand" />
위에처럼 배열표시를 빼도.. 알아 듣는다..
배열로 쓸때의 Struts FormBean 은 아래처럼 배열처리해줘야 하겠쥐~~
private String[] work = new String[10];
public void setWork(String[] work){ this.work = work; }
public String[] getWork(){ return this.work; }
일케 하믄 되더만 ㅡㅡ 허무 ......
'JAVA > JSP_Servlet' 카테고리의 다른 글
[펌] requestmon - 톰캣과의 사투중 발견한 유용한 정보.. (0) | 2004.11.10 |
---|---|
[펌] Developing a Spring Framework MVC application step-by-step (0) | 2004.10.30 |
[펌] Best practices to improve performance in JDBC (0) | 2004.09.24 |
Commons Pool + DBCP 사용법 (0) | 2004.09.07 |
dbcp (0) | 2004.09.06 |