customlable_action.java

来自「新闻管理--jsf+struts+jstl实现」· Java 代码 · 共 31 行

JAVA
31
字号
package com.v246;
import org.apache.struts.action.*;
import javax.servlet.http.*;
public class CustomLable_action extends org.apache.struts.action.Action
{
	public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)
	{
		CustomLable_form custom=(CustomLable_form)form;
		CustomLable_bean bean=new CustomLable_bean();
		String re=null;
		String tmp=null;
		try
		{
			tmp=bean.addCustomLable(custom);//执行数据库写入并接收返回信息
			if(tmp.equals("error"))//如果返回error则查找出错页
			{
				re="customError";
			}
			else//否则查找正确页面
			{
				re="custom";
			}
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		request.setAttribute("custom",custom);
		return mapping.findForward(re);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?