1:web Action
String pauseResultStr = HttpAgentSender.send(url + CommonConstant.ACTION_PAUSE_REQUESTFILES, batchReqFileListBean.getJsonString(), createUserPasswordParam());
send的实现
public static String send(String url, String content, Map<String, String> params) throws PlatformException
{
try
{
if (url == null || "".equals(url.trim()))
{
throw new PlatformException(IErrorCode.E_INN_DB_001, "The IP or port of the system deploy is null, Please check the configuration for the system deploy."); //$NON-NLS-1$
}
URL httpURL = new URL(url);
HttpURLConnection httpConn = null;
URLConnection conn = httpURL.openConnection();
conn.setConnectTimeout(HTTP_CONNECT_TIMEOUT);
if (conn instanceof HttpURLConnection)
{
httpConn = (HttpURLConnection) conn;
setParams(params, httpConn);
httpConn.setDoOutput(true);
PrintWriter output = null;
try
{
output = new PrintWriter(new OutputStreamWriter(httpConn.getOutputStream(), "UTF-8"));
output.print(content);
}
finally
{
FileUtils.closeStream(output);
}
}
else
{
throw new PlatformException("The url type is not http, url=" + url); //$NON-NLS-1$
}
String ret = readContent(httpConn);
httpConn.disconnect();
return ret;
}
catch (MalformedURLException e)
{
throw new PlatformException("The url is not correct, url=" + url, e); //$NON-NLS-1$
}
catch (IOException e)
{
throw new PlatformException("Can not connect to the http server, url=" + url, e); //$NON-NLS-1$
}
}
分享到:
相关推荐
struts2一个action处理多个请求
资源中示例了一个struts2的配置文件中配置的action的result结果为另外一个action的配置,该跳转的过程中是带所有参赛调整的,在另外一个action中可以接受到当前action的所有参数,此配置文件是我日常开发中的经验...
Web Performance in Action: Building Faster Web Pages by Jeremy Wagner English | 2017 | ISBN: 1617293776 | 376 pages | PDF The content of the web is maturing and increasing in complexity, but internet...
为了学习AFNetwork,自己搭建整理了一下AFNetwork向后台发送请求和后台返回json数据的整个处理过程。利用Struts2搭建了一个后台,提供Action并返回json数据
In Web Components in Action you'll learn to design, build, and deploy reusable Web Components from scratch. Foreword by Gray Norton. Purchase of the print book includes a free eBook in PDF, Kindle,...
1.论坛的数据库设计 ...3.实现菜单栏菜单增删查改功能 4.实现后台权限配置页面 5.EASYUI左侧栏和选项卡效果 不同权限的管理员登录进去 只能看到自己有权限...另外 还进行了 不登录标注 增加一个标注 就可以不进行登录判断
Web Performance in Action Building Faster Web Pages 英文mobi 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
java发送url请求进行文件的提交以及后台struts2的action接收处理 1、java模拟表单方式发送url请求进行文件的提交 /** * * @作者 王建明 * @创建日期 2013-06-27 * @创建时间 19:28:18 * @...
通用web层action,完美解决shiro注解权限控制,读取子类泛型
Amazon Web Services in Action introduces you to computing, storing, and networking in the AWS cloud. You'll start with a broad overview of AWS and learn how to spin-up servers manually and from the ...
在web.xml中配置action或.do,附上详细的文档
Web Performance in Action Building Faster Web Pages 英文无水印pdf pdf使用FoxitReader和PDF-XChangeViewer测试可以打开
extjs向action提交的方法,由Ext界面提交到action的两种方法,点击id为save的按钮时,执行loginFun函数。
Amazon Web Services in Action, Second Edition is a comprehensive introduction to computing, storing, and networking in the AWS cloud. Readers will find clear, relevant coverage of all the essential ...
利用Struts 2框架创建一个web项目chap2_e22,实现用户登录过程。具体要求是在loginAction类中分别用login()和registered()处理用户登录和注册的过程,分别创建login.jsp和register.jsp两个页面实现登录和注册的...
方式一:Action本身作为Model对象,通过属性注入(Setter)方法讲参数数据封装到Action中 具体为:在Action中,提供和参数名相同的几个属性,并...参数名的方式,然后在Action中,需要定义一个Model的一个具体对象,并为该对象
Amazon.Web.Services.in.Action.2015.9.pdf
Web Performance in Action is your companion guide to making websites faster. Throughout the course of this book, you'll learn techniques that speed the delivery of your site's assets to the user, ...
首先,Struts的ActionServlet接收到一个请求,然后根据struts-config.xml的配置定位到相应的mapping (映射);接下来如果form的范围是request或者在定义的范围中找不到这个form,创建一个新的form实例;取得form...
jquery ztree 自动生成树,从action返回json类型的数据,树会自动解析,可以为树节点添加其他详细的信息