📄 forum_sortaction.java
字号:
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.1/xslt/JavaClass.xslpackage com.bbs.forumsort;import java.io.IOException;import java.io.PrintWriter;import javax.servlet.ServletException;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;/** * MyEclipse Struts Creation date: 08-27-2008 * * XDoclet definition: * * @struts.action path="/forum_sort" name="forum_sortForm" * input="/admin/forum_sort.jsp" scope="request" validate="true" */public class Forum_sortAction extends Action { // --------------------------------------------------------- Instance // Variables // --------------------------------------------------------- Methods /** * Method execute * * @param mapping * @param form * @param request * @param response * @return ActionForward * @throws IOException * @throws ServletException */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println("************************"); Forum_sortForm forum_sortForm = (Forum_sortForm) form; SortInfo sortinfo = new SortInfo(); sortinfo.setSort_name(new String(forum_sortForm.getSort_name() .getBytes("ISO-8859-1"), "gb2312")); System.out.println("添加到form中的数据显示:" + sortinfo.getSort_name()); // 设置客户端的编码 response.setCharacterEncoding("gb2312"); PrintWriter out = response.getWriter(); SortParent sortparent = SortFactory.getInstance(); sortparent.setSortinfo(sortinfo); if (sortparent.insertSort().equals("error")) { out.print("<script>alert('添加失败!');</script>"); } else { out .print("<script>alert('添加成功!');window.location='forum_sort.jsp';</script>"); } return null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -