⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xxlybliuyanaction.java

📁 采用struts+hibernet+javabean+jsp 些得shop购物网站,此系本人原创.
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.hnzt.struts.action;

import java.text.SimpleDateFormat;
import java.util.Date;

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 com.hnzt.dao.Dao;
import com.hnzt.po.Customlyb;
import com.hnzt.po.Lyb;


public class XxlybliuyanAction extends Action {

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {

		Dao d = new Dao();
		Customlyb l = new Customlyb();
		
		String content = request.getParameter("content");
		String headImg = request.getParameter("headImg");
		
		SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");//转换日期格式
	    Date now = new Date();//提取当天日期。

	    String pjdata = s.format(now);//转换日期
	    
	    String user = request.getSession().getAttribute("username").toString();
	    
	    l.setName(user);
	    l.setContent(content);
	    l.setRecontent("无");
	    l.setLevel(Integer.valueOf(2));
	    l.setHeadimg(headImg);
	    l.setLtime(pjdata);
	    d.insertdb(l);
		
		return mapping.findForward("success");
	}
}

⌨️ 快捷键说明

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