========================
javascript 用 jsp 变量
直接 var t = "<%=xxx %>";
=========================
js跳转url:
window.location.href(url);
===========================
struts 1.2 action 转 url
return new ActionForward(url,true);
============================
struts.xml中
<result type="redirect">*.jsp</result>
采用 type="redirect" action 中的值传不到 .jsp中
===================================
页面取值
<s:iterator value="%{#request.infoBean}">
<input type="text" name="information_title" style="font-size: 18pt; font-weight: bold" size="60" value ="<s:property value = "information_title"></s:property>">
</td></tr><tr><td>
<textarea rows="15" name="information" cols="80" style="font-size: 18pt; font-weight: bold">
<s:property escape="false" value = "information"></s:property></font>
</textarea>
<s:property escape="false" value = "#request.information"></s:property>
</td></tr><tr><td>
===================================
MySql 取自动增长列值
select LAST_INSERT_ID()
====================================
struts2上传文件:
enctype="multipart/form-data"
=====================================
上传下载 下载两个包
=====================================
struts2 action以后 css 在jsp中,以项目根为相对路径,
单jsp,以本jsp为相对路径
=====================================
数据库中的\n\r 在 textarea 中即可回行。
========================================
struts2:显示泛型list的值
action:
private List<Integer> fileIDList;
private List<String> fileIDListStr = new ArrayList();
fileIDList = fd.getFileIDByNewsID(newsid);
for(int i = 0; i < fileIDList.size(); i++){
System.out.println("//*** fileid = " + fileIDList.get(i));
try{
fileIDListStr.add(String.valueOf(fileIDList.get(i)));
}catch(Exception e){
e.printStackTrace();
}
}
for (int i = 0; i < fileIDListStr.size(); i++) {
System.out.println("//*** === " + fileIDListStr.get(i));
}
struts2 jsp:
<s:iterator value="%{fileIDListStr}">
fileID==:<s:property ></s:property>
</s:iterator>
<s:iterator value="%{fileIDList}">
fileID==:<s:property ></s:property>
</s:iterator>
=========================================
javascript 用 jsp 变量
直接 var t = "<%=xxx %>";
=========================
js跳转url:
window.location.href(url);
===========================
struts 1.2 action 转 url
return new ActionForward(url,true);
============================
struts.xml中
<result type="redirect">*.jsp</result>
采用 type="redirect" action 中的值传不到 .jsp中
===================================
页面取值
<s:iterator value="%{#request.infoBean}">
<input type="text" name="information_title" style="font-size: 18pt; font-weight: bold" size="60" value ="<s:property value = "information_title"></s:property>">
</td></tr><tr><td>
<textarea rows="15" name="information" cols="80" style="font-size: 18pt; font-weight: bold">
<s:property escape="false" value = "information"></s:property></font>
</textarea>
<s:property escape="false" value = "#request.information"></s:property>
</td></tr><tr><td>
===================================
MySql 取自动增长列值
select LAST_INSERT_ID()
====================================
struts2上传文件:
enctype="multipart/form-data"
=====================================
上传下载 下载两个包
=====================================
struts2 action以后 css 在jsp中,以项目根为相对路径,
单jsp,以本jsp为相对路径
=====================================
数据库中的\n\r 在 textarea 中即可回行。
========================================
struts2:显示泛型list的值
action:
private List<Integer> fileIDList;
private List<String> fileIDListStr = new ArrayList();
fileIDList = fd.getFileIDByNewsID(newsid);
for(int i = 0; i < fileIDList.size(); i++){
System.out.println("//*** fileid = " + fileIDList.get(i));
try{
fileIDListStr.add(String.valueOf(fileIDList.get(i)));
}catch(Exception e){
e.printStackTrace();
}
}
for (int i = 0; i < fileIDListStr.size(); i++) {
System.out.println("//*** === " + fileIDListStr.get(i));
}
struts2 jsp:
<s:iterator value="%{fileIDListStr}">
fileID==:<s:property ></s:property>
</s:iterator>
<s:iterator value="%{fileIDList}">
fileID==:<s:property ></s:property>
</s:iterator>
=========================================
![]() |
冬日娜刻薄提问雷哭史冬鹏(图)
那些“与祖国为敌”的教练们
为朗平和美国女排加油
|
![]() |
离奇的巧合 脸上有青春痘的奥运冠军们 盘点这些冠军身边火辣辣的模特演员女友 |
![]() |
![]() |
![]() |


档案
日志
相册
视频








评论
想第一时间抢沙发么?