大家好!我有两个问题:
1.Struts1的自动回填机制是怎么回事,如果不同Struts1该怎么实现自动回填?
2.我要用iterate标签在画面上输出十行两列的text文本框有什么好办法?一下是我的笨招,因为以前都是用iterate循环输出装有bean的List,而这次直接在List中装入String不知道如何是好!见笑啦大伙,求助啊~ActionForm
private List<TextsBean> tabList = new ArrayList<TextsBean>();
public void setTabList(List<TextsBean> tabList) {
this.tabList = tabList;
}
public List<TextsBean> getTabList() {
for(int i=0;i<20;i++){
tabList.add(new TextsBean());
}
return tabList;
}
装入List中的bean
private String textValue = null; public String getTextValue() {
return textValue;
} public void setTextValue(String textValue) {
this.textValue = textValue;
}
前台Jsp
<table border="0">
<logic:iterate name="testTabForm" property="tabList" id="tabList" indexId="index">
<logic:lessThan value="20" name="index">
${index%2==0?"<tr>":""}
<td>
${index}<html:text name="tabList" property="textValue" indexed="true"/>
</td>
${index%2==1?"</tr>":""}
</logic:lessThan>
</logic:iterate>
</table>请大伙帮帮忙,弟弟在这儿先谢谢您啦!
1.Struts1的自动回填机制是怎么回事,如果不同Struts1该怎么实现自动回填?
2.我要用iterate标签在画面上输出十行两列的text文本框有什么好办法?一下是我的笨招,因为以前都是用iterate循环输出装有bean的List,而这次直接在List中装入String不知道如何是好!见笑啦大伙,求助啊~ActionForm
private List<TextsBean> tabList = new ArrayList<TextsBean>();
public void setTabList(List<TextsBean> tabList) {
this.tabList = tabList;
}
public List<TextsBean> getTabList() {
for(int i=0;i<20;i++){
tabList.add(new TextsBean());
}
return tabList;
}
装入List中的bean
private String textValue = null; public String getTextValue() {
return textValue;
} public void setTextValue(String textValue) {
this.textValue = textValue;
}
前台Jsp
<table border="0">
<logic:iterate name="testTabForm" property="tabList" id="tabList" indexId="index">
<logic:lessThan value="20" name="index">
${index%2==0?"<tr>":""}
<td>
${index}<html:text name="tabList" property="textValue" indexed="true"/>
</td>
${index%2==1?"</tr>":""}
</logic:lessThan>
</logic:iterate>
</table>请大伙帮帮忙,弟弟在这儿先谢谢您啦!
解决方案 »
- 为软件编写接口!
- 求JSP代码加亮规则,有截图最好
- org.apache.jasper.JasperException: An exception occurred processing JSP page /sh
- 谁知道哪能下外文的关于java相关的资料,文献啊!~
- 请高手帮我解决一下客户端的javascript问题
- javascript中的这个方法isNaN是不是判断是数字的?
- jsp中怎么查询数据库里表是否存在呀?
- 有个高级需求问题,请高手赐教。。。。。。。。。。。。。。。。。
- 救助!! 急!!!我的程序是用strus构架 , 现在在做画面处理的得时候遇到大麻烦!
- javabean的小问题
- 如何叫jsp页面输出错误信息??我生成静态页面的程序有错,我想叫他输出错误信息到网页上以便我改错。
- 页面删掉后,但还是跳到旧页面上去,重启weblogic,重新部署都不行
,自动回填时就是从这个属性范围中取值。如果你想自己写回填,那用el表达式输出这个form的值就行了。