首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Struts标签<bean:define>

2012-10-06 
Struts标签bean:define.Struts标签bean:define可以定义一个变量,例bean:define namestudentForm p

Struts标签<bean:define>.

Struts标签<bean:define>可以定义一个变量,例<bean:define name="studentForm" property="classID" id="CID"/>这样就定义变量CID,其值是studentForm中的classID。

可以在JavaScript的方法中用<%=CID%>来引用这个变量了,可以用它来拼装URL,或者其他一些操作

例如

url='<%=request.getContextPath()%>/Student/student.do?state=add&classID=<%=CID%>'

注意:用<bean:define>定义的变量有一定的域,如果在Form标签中使用了<bean:define>,则这个变量只在Form标签中可用,如果你的JS方法定义在Form标签以外,则无法引用这个变量。

?

热点排行