nongchanpin/src/com/action/UserValidateAction.java

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.dao.CommonDAO;
import com.model.Sysuser;
import com.opensymphony.xwork2.ActionSupport;

public class UserValidateAction extends ActionSupport {
	 private static final long serialVersionUID = 1L;

     @Resource

     private CommonDAO commonDAO;

     public String msgStr;
 	 public String uname;

     public void check() throws IOException
 	{
    	 System.out.println(uname);
    	 ArrayList<Sysuser> list = (ArrayList<Sysuser>)commonDAO.findByHql("from Sysuser where uname='"+uname+"' and type='会员' ");
    	 int responseContext;
    	 System.out.println("aa=="+list.size());
    	 if(list.size()==0){
    		 responseContext = 0;
    	 }else{
    		 responseContext=1;
    	 }
    	 
 		System.out.println(responseContext);
 		HttpServletResponse response=ServletActionContext.getResponse();
 		response.setContentType("text/html");
 		PrintWriter out = response.getWriter();
 		out.println(responseContext);
 		out.flush();
 		out.close();
 		 
 	}


//     @JSON(serialize= false)

     //声明uname不需要转化为json格式

     //@JSON

     //@Json struts将将返回的数据类型转换为json格式


	public CommonDAO getCommonDAO() {
		return commonDAO;
	}
后面还有 27 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。