Vincent
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
posts - 5, comments - 7, trackbacks - 0
<
2025年6月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(2)
給我留言
查看公開留言
查看私人留言
隨筆分類
snmp(4)
隨筆檔案
2009年6月 (5)
文章分類
JavaScript(8)
JDBC(1)
JfreeChart(1)
JSF(13)
JXL(2)
POI(9)
Print(8)
richfaces(4)
SQL(1)
Swing
tomcat
XML(5)
文章檔案
2008年12月 (2)
2008年11月 (42)
jsf
JSF中文技術文摘
JSF中文技術文摘
JSF中文技術文摘
Webservice技術學習專題
搜索
積分與排名
積分 - 55825
排名 - 927
最新評論
1.?re: POI實現Excel插入圖片[未登錄]
能不能在頁腳或者頁眉插入圖片呢
--lsy
2.?re: C# Sample code to talk to a printer using SNMP to get its status.
評論內容較長,點擊標題查看
--KCC
3.?re: C# Sample code to talk to a printer using SNMP to get its status.
評論內容較長,點擊標題查看
--phaneendra
4.?re: java報表JXL和POI打印設置[未登錄]
aaaaaaaaaaaaaa
--aaa
5.?re: POI實現Excel插入圖片
非常好 ! 謝謝!
--estc
閱讀排行榜
1.?C# Sample code to talk to a printer using SNMP to get its status. (6565)
2.?Cisco常用OID(2891)
3.?OID(1531)
4.?Communicating with SNMP using C# - The Very Beginning (1517)
5.?OID(707)
評論排行榜
1.?C# Sample code to talk to a printer using SNMP to get its status. (2)
2.?Communicating with SNMP using C# - The Very Beginning (1)
3.?OID(0)
4.?OID(0)
5.?Cisco常用OID(0)
jsf 另存為的實現
public
String btnSaveXML_action()
{
//
TODO: Process the action. Return value is a navigation
//
case name where null will return to the same page.
try
{
//
get the appId
Integer appId
=
Integer.valueOf(txtMemory1.getText().toString());
String appName
=
datamanagementservice.getAppNameByAppId(appId);
Document doc
=
writeXML(appId, appName);
TransformerFactory tFactory
=
TransformerFactory.newInstance();
Transformer transformer
=
tFactory.newTransformer();
DOMSource source
=
new
DOMSource(doc);
//
the file's loadpath
String loadPath
=
"
c:\\temp\\
"
+
appName
+
"
.xml
"
;
//
if the file no exist then create it
File f
=
new
File(
"
c:\\temp\\
"
);
f.mkdirs();
StreamResult result
=
new
StreamResult(
new
java.io.File(loadPath));
transformer.transform(source, result);
//
new a download file
File t_file
=
new
File(loadPath);
long
l;
for
(l
=
0L
; l
==
0L
; l
=
t_file.length())
{
t_file
=
new
File(loadPath);
}
InputStream in
=
new
FileInputStream(t_file);
if
(in
!=
null
)
{
String filename
=
t_file.getName();
filename
=
java.net.URLEncoder.encode(filename,
"
utf-8
"
);
FacesContext.getCurrentInstance().responseComplete();
HttpServletResponse httpServletResponse
=
(HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
httpServletResponse.reset();
httpServletResponse.setContentType(
"
application/x-msdownload
"
);
String rrr
=
"
attachment; filename=
"
+
filename;
httpServletResponse.setHeader(
"
Content-Disposition
"
, rrr);
httpServletResponse.setContentLength((
int
) l);
byte
b[]
=
new
byte
[
2048
];
for
(
int
len
=
0
; (len
=
in.read(b))
>
0
;)
{
httpServletResponse.getOutputStream().write(b,
0
, len);
}
in.close();
}
}
catch
(Exception e)
{
e.printStackTrace();
}
getRequestBean1().setSelectAppId((Integer) dropDown1.getSelected());
return
null
;
}
posted on 2008-11-27 10:39
Vincent-chen
閱讀(260)
評論(0)
編輯
收藏
所屬分類:
JSF
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
相關文章:
JSF問題集錦
jsf結束session
生成Excel并在客戶端下載的JSF實現
JSF實現文件下載
JSF 文件上傳
jsf 另存為的實現
JSF和Richfaces中使用框架頁(Frameset),包括了PanelMenu
JSF(Java Server Faces)的StateHolder的作用和使用方法
在JSF控件中操作框架頁Frameset
JSF頁面中支持的Expression Language(EL)
Powered by:
BlogJava
Copyright ©2025 Vincent-chen
主站蜘蛛池模板:
大同市
|
什邡市
|
江川县
|
松阳县
|
丹东市
|
栖霞市
|
白水县
|
新余市
|
千阳县
|
库车县
|
田阳县
|
育儿
|
铁岭县
|
金溪县
|
景德镇市
|
南康市
|
航空
|
抚宁县
|
桃园市
|
永登县
|
临洮县
|
石城县
|
阿拉尔市
|
旬邑县
|
宁明县
|
铁力市
|
尉犁县
|
文成县
|
久治县
|
来凤县
|
阳曲县
|
松潘县
|
宜城市
|
鄂温
|
同江市
|
峡江县
|
湘乡市
|
安宁市
|
曲松县
|
华阴市
|
楚雄市
|