日期:2014-05-18  浏览次数:20692 次

关于struts标签中的bean:message,求一段代码
关于struts标签中的bean:message,求一段代码

          <html:select   property= "targetYear ">
                              <!--     <html:option   value= "2000 "/> -->   <!--   开始年份   -->
                                ???? <!--   循环在下拉列表中显示出所有年份   -->
                                <!-- <html:option   value= "2007 "/> --> <!--   现在年份   -->
                            </html:select>

开始年份是写在system.config的config文件中的,通过
<bean:message   key= 'pulldown.year '   bundle= 'system.config '/> %> 可以输出。
不太了解jsp,求助各位,如何将config文件中的值取出   再通过计算,设置到value里面去

------解决方案--------------------
for(int y=2000;y <2007;y++){
if(y==year){
out.println( " <option value= "+y+ " selected> "+y+ " </option> ");
}else{
out.println( " <option value= "+y+ "> "+y+ " </option> ");
}
}