资源简介
用ssh实现的登录注册 还有文件的上传下载
代码片段和文件信息
package com.action;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.Date;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.service.ArticleHandle;
import com.table.Article;
import com.table.Category;
public class Artic extends ActionSupport {
private String title;
private String content;
private Date createTime;
private Date updateTime;
private Category category;
private int score;
private int visitor;
private int commentor;
private String savePath;
private ArticleHandle articleHandle;
public String gettitle() {
return title;
}
public void settitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public int getVisitor() {
return visitor;
}
public void setVisitor(int visitor) {
this.visitor = visitor;
}
public int getCommentor() {
return commentor;
}
public void setCommentor(int commentor) {
this.commentor = commentor;
}
public String getSavePath() {
return savePath;
}
public void setSavePath(String savePath) {
this.savePath = savePath;
}
public void setArticleHandle(ArticleHandle articleHandle) {
this.articleHandle = articleHandle;
}
public String execute() throws Exception{
String path1=savePath+“\\“+gettitle();
File f=new File(“f:“+File.separator+“SSH实例“+File.separator+“blog“+File.separator+“WebRoot“+File.separator+savePath+File.separator+gettitle()+“.txt“);
OutputStream out=new FileOutputStream(f);
String str=content;
byte[] b=str.getBytes();
out.write(b);
out.close();
if(articleHandle.add(titlepath1createTimeupdateTimescorevisitorcommentor)){
return SUCCESS;
}
else return ERROR;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-06-05 15:43 blog\
文件 4391 2013-05-18 08:51 blog\.classpath
目录 0 2013-06-08 09:28 blog\.myeclipse\
文件 285 2013-05-16 21:30 blog\.myme
文件 1277 2013-05-16 21:37 blog\.project
目录 0 2013-06-05 15:43 blog\.settings\
文件 330 2013-05-16 21:30 blog\.settings\org.eclipse.jdt.core.prefs
目录 0 2013-06-05 15:43 blog\WebRoot\
目录 0 2013-06-05 15:43 blog\WebRoot\me
文件 36 2013-05-16 21:30 blog\WebRoot\me
目录 0 2013-06-05 15:43 blog\WebRoot\WEB-INF\
文件 1912 2013-06-05 12:28 blog\WebRoot\WEB-INF\actionContext.xm
文件 3844 2013-06-05 12:29 blog\WebRoot\WEB-INF\bean.xm
目录 0 2013-06-05 15:43 blog\WebRoot\WEB-INF\classes\
文件 5365 2013-06-05 12:30 blog\WebRoot\WEB-INF\classes\.struts.mex
目录 0 2013-06-05 15:43 blog\WebRoot\WEB-INF\classes\com\
目录 0 2013-06-05 15:43 blog\WebRoot\WEB-INF\classes\com\Dao\
文件 441 2013-06-05 12:37 blog\WebRoot\WEB-INF\classes\com\Dao\ArticleDao.class
文件 2270 2013-06-05 12:43 blog\WebRoot\WEB-INF\classes\com\Dao\ArticleDaoImpl.class
文件 344 2013-05-30 17:06 blog\WebRoot\WEB-INF\classes\com\Dao\CategoryDao.class
文件 1588 2013-05-30 18:02 blog\WebRoot\WEB-INF\classes\com\Dao\CategoryDaoImpl.class
文件 256 2013-06-03 19:00 blog\WebRoot\WEB-INF\classes\com\Dao\PhotoDao.class
文件 1419 2013-06-03 19:35 blog\WebRoot\WEB-INF\classes\com\Dao\PhotoDaoImpl.class
文件 405 2013-06-02 16:48 blog\WebRoot\WEB-INF\classes\com\Dao\UserDao.class
文件 1834 2013-06-02 17:29 blog\WebRoot\WEB-INF\classes\com\Dao\UserDaoImpl.class
目录 0 2013-06-05 15:43 blog\WebRoot\WEB-INF\classes\com\action\
文件 3529 2013-06-04 16:46 blog\WebRoot\WEB-INF\classes\com\action\Artic.class
文件 753 2013-05-30 17:33 blog\WebRoot\WEB-INF\classes\com\action\Categor.class
文件 271 2013-06-03 19:06 blog\WebRoot\WEB-INF\classes\com\action\DeletePo.class
文件 1906 2013-06-02 10:37 blog\WebRoot\WEB-INF\classes\com\action\Login.class
文件 706 2013-05-27 21:58 blog\WebRoot\WEB-INF\classes\com\action\Query.class
............此处省略155个文件信息
川公网安备 51152502000135号
评论
共有 条评论