package com.nova.struts2.action;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
@Namespace("/")
@ParentPackage("json-default")
public class TestAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private String svgXml;
public String login() {
System.out.println("zhixingle....");
return SUCCESS;
}
@Action(value = "getSvg", results = { @Result(name = "success", location = "/svg.jsp") })
public String abc() {
/*
* try { svgXml = FileUtils .readFileToString(new File(
* "/home/xia/work/develop/server/apache-tomcat-myeclipse/webapps/struts2Demo/google.svg"
* )); } catch (IOException e) { e.printStackTrace(); }
*/
svgXml = "google.svg";
System.out.println(svgXml);
return SUCCESS;
}
@Action(value = "show", results = { @Result(name = "success", type = "json", params = {
"root", "svgXml" }) })
public String show() {
String temp = "";
try {
temp = FileUtils
.readFileToString(new File(
"/home/xia/work/develop/server/apache-tomcat-myeclipse/webapps/struts2Demo/google.svg"));
} catch (IOException e) {
e.printStackTrace();
}
svgXml = temp.substring(temp.indexOf("<svg"), temp.length());
System.out.println(svgXml);
return SUCCESS;
}
@Action(value = "getPath", results = { @Result(name = "success", type = "json", params = {
"root", "svgXml" }) })
public String getPath() {
svgXml = "google.svg";
return SUCCESS;
}
public String getSvgXml() {
return svgXml;
}
public void setSvgXml(String svgXml) {
this.svgXml = svgXml;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
struts2Demo.zip (53个子文件)
struts2Demo
src
com
nova
struts2
action
TestAction.java 2KB
LoginAction.java 1KB
test
Test.java 166B
struts.xml 562B
.classpath 1KB
.mymetadata 307B
.settings
com.genuitec.eclipse.j2eedt.core.prefs 1KB
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.jsdt.ui.superType.name 6B
.jsdtscope 488B
.myeclipse
.project 1KB
WebRoot
META-INF
MANIFEST.MF 36B
svg
scimitar-anim.svg 97KB
anim3.svg 4KB
anim1.svg 5KB
video1.svg 5KB
anim2.svg 5KB
scimitar.svg 95KB
google.svg 518B
heart.svg 209B
js
jquery.js 242KB
svg-htc.jsp 80B
svg.htc 6KB
svg.swf 51KB
svg.js 105KB
index.jsp 1KB
svg.jsp 512B
google.svg 517B
test.jsp 11KB
Svg.jsp 2KB
WEB-INF
classes
com
nova
struts2
action
TestAction.class 2KB
LoginAction.class 2KB
test
Test.class 516B
struts.xml 562B
lib
xwork-core-2.3.3.jar 612KB
commons-logging-1.1.1.jar 59KB
struts2-convention-plugin-2.3.3.jar 65KB
asm-3.3.jar 43KB
commons-fileupload-1.2.2.jar 58KB
asm-commons-3.3.jar 37KB
struts2-core-2.3.3.jar 764KB
commons-lang3-3.1.jar 308KB
freemarker-2.3.19.jar 909KB
ognl-3.0.5.jar 222KB
commons-io-2.0.1.jar 156KB
javassist-3.11.0.GA.jar 600KB
struts2-json-plugin-2.3.3.jar 69KB
web.xml 628B
content
failure.jsp 811B
abc.jsp 786B
login.jsp 532B
success.jsp 800B
login1.jsp 787B
共 53 条
- 1
xiaomengxia2008
- 粉丝: 0
- 资源: 25
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页