📄 editphotoaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.webalbum2.struts.action;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.DynaValidatorForm;
import com.webalbum2.bean.dbcontrol;
/**
* MyEclipse Struts
* Creation date: 06-16-2008
*
* XDoclet definition:
* @struts.action path="/editphoto" name="editphotoForm" input="/editphoto.jsp" scope="request" validate="true"
*/
public class EditphotoAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
DynaValidatorForm editphotoForm = (DynaValidatorForm) form;// TODO Auto-generated method stub
PrintWriter out = null;
try {
request.setCharacterEncoding("gbk");
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
response.setCharacterEncoding("gbk");
try {
out = response.getWriter();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//HttpSession session = request.getSession();
String a = (String)editphotoForm.get("photo_isdefault");
int photo_isdefault = Integer.parseInt(a);
String photo_des = (String)editphotoForm.get("photo_des");
String photo_name = (String)editphotoForm.get("photo_name");
String b = (String)editphotoForm.get("photo_id");
int photo_id = Integer.parseInt(b);
dbcontrol db=new dbcontrol();
try {
db.editphoto(photo_id, photo_des, photo_isdefault,photo_name);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
out.println("<script> alert('修改成功');history.go(-2); </script> ");
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -