- 浏览: 50400 次
- 性别:
- 来自: 上海
最新评论
-
beimyy:
//通过以下方法可以模拟页面参数提交 //fil ...
httpClient上传文件
文章列表
JAVA手机网[www.cnjm.net]import java.io.InputStream;
import java.io.InputStreamReader;
iimport java.io.UnsupportedEncodingException;
import java.util.*;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
...
public class FileUploader {
private ClientAppLogger appLogger = ClientAppLogger.getInstance();
private String servletUrl;
public FileUploader(String servletUrl) {
this.servletUrl = servletUrl;
}
public void upload(NameValuePair pair, File[] files ...
Using the POST Method
Listing 9-2 shows an example where you enclose an Extensible Markup Language (XML) file within a request and send it using the POST method to a JSP named GetRequest.jsp. The JSP will just print the request headers it receives. These headers will show if the request got across pr ...
Using the GET Method
The GET method is the most common method used to send an HTTP request. Every time you click a hyperlink, you send an HTTP request using the GET method. You will now see an example of sending a GET request using HttpClient based Java code. The code in Listing 9-1 sends a GET reque ...
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
public cl ...
public class Birth
{
static HashMap<String, String> map = new HashMap<String, String>();
public static void main(String[] args)
{
File file = new File("D:/birthday.txt");
BufferedReader reader = null;
StringBuffer sb = new StringBuffer();
String str = "";
...
Ms-SqlServer自动备份
打开SQLserver,
打开数据库列表,在你想要备份的数据库上点右键——所有任务——备份数据库。
在弹出的设置窗口中选择“数据库——完全”,键备份到列表右边的“添加”,填出备份文件的路径及名称。
在重写选项中选择“重写现有媒体”,
选中“调度”选项,点击调度框后面的“..."图标进行调度编辑,
选中"反复出现",点"更改",选择”每周“,”每1周“,”星期一“,
在每日频率中选择你想做备份的时间,然后依次按”确定“即可完成自动备份设置。
/**
* 声音文件的位置
*/
private static final String[] sounds =
{
"start.wav",
"over.wav",
"pause.wav",
"continue.wav",
"down.wav",
"swift.wav",
"scoring.wav",
"level.wav",
"winning.wav"
};
pr ...
--创建分页过程
create or replace procedure fenye(
v_tableName in varchar2,--表名
v_pageSize in number,--每页显示的记录数
v_pageNum in number,--当前页码
v_countRows out number,--总记录数
v_countPages out number,--总页数
p_cursor out test_package.test_cursor --返回的结果集 ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value=&qu ...
private static final int BUFFER_SIZE = 16 * 1024;
/** 上传的文件*/
private File loadFile;
/** 上传的文件类型*/
private String contentType;
private String imageFileName;
private String caption;
/**上传文件存放地址*/
private final String UPLOADPATH = "D:/myfile";
...
<body>
<s:form id="myform" name="myform" action="ManyUpLoad" method="post" enctype="multipart/form-data">
<div style="width: 100%;" id="uploadfiles">
<div id="MyFile">
<s:file labe ...
strtus2.0实现上传
实现原理
Struts 2是通过Commons FileUpload文件上传。
1.Commons FileUpload通过将HTTP的数据保存到临时文件夹,
2.然后Struts使用fileUpload拦截器将文件绑定到Action的实例中。从而我们就能够以本地文件方式的操作浏览器上传 ...
我不去想是否能够成功
既然选择了远方
便只顾风雨兼程
我不去想是否能够赢得爱情
既然钟情于玫瑰
就勇敢地吐露真诚……
http://www.iteye.com/topic/679770
http://www.iteye.com/topic/692629 分页
http://www.iteye.com/topic/687378