📄 upload.java
字号:
package Pluto;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import Pluto.DBConnection;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class upload extends ActionSupport {
private String title;
private String singer;
private String special;
private String path;
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getSinger() {
return singer;
}
public void setSinger(String singer) {
this.singer = singer;
}
public String getSpecial() {
return special;
}
public void setSpecial(String special) {
this.special = special;
}
@Override
public String execute() throws Exception {
ServletActionContext.getResponse().setCharacterEncoding("GB2312");
PrintWriter out = ServletActionContext.getResponse().getWriter();
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = ServletActionContext.getRequest().getSession();
ServletActionContext.getResponse().setHeader("Pragma", "No-cache");
ServletActionContext.getResponse().setHeader("Cache-Control",
"no-cache");
ServletActionContext.getResponse().setDateHeader("Expires", 0);
String filePath = request.getParameter("path");
if (function.isInvalid(title) || function.isInvalid(singer)
|| function.isInvalid(special) || function.isInvalid(path)) {
out.println(function.PlutoJump("浠讳綍涓
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -