JSP知识

1. display:table框架

首先我们定义一个list

<% 
List test = new ArrayList( 6 ); 
test.add( "Test String 1" ); 
test.add( "Test String 2" ); 
test.add( "Test String 3" ); 
test.add( "Test String 4" ); 
test.add( "Test String 5" ); 
test.add( "Test String 6" ); 
request.setAttribute( "test", test ); 
%> 

当我们想在jsp页面上显示这个list时,我们只需要写一句话

  <display:table name="test" /> 

display tag会自动生成一个table

如果list是从控制层抛出来的,name可使用EL表达式表示

  <display:table name="${test}" /> 

 

posted @ 2022-05-17 16:58  一路向北√  阅读(15)  评论(0编辑  收藏  举报

web应用开发&研究 -

业精于勤而荒于嬉。

工作,使我快乐。


Font Awesome | Respond.js | Bootstrap中文网