`
tenderuser
  • 浏览: 59339 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
收藏列表
标题 标签 来源
EJB3
	/**
	 * given the service name and return the reference of the service entity, 
	 * if the service with the serviceName doesn't exist, then throw an NamingException
	 * @param serviceName
	 * @return
	 * @throws NamingException
	 */
	public static Object getService(String serviceName) throws NamingException {
		Object service = serviceRegistry.get(serviceName);
		
		if(service == null){
			Hashtable<String, String> c = new Hashtable<String, String>();
			c.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
			c.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
			c.put("java.naming.provider.url","jnp://"+jbossIp);
			ctx = new InitialContext(c);
			service = ctx.lookup(serviceName + "/"+jbossStyle);
			if(service != null)
				serviceRegistry.put(serviceName, service);
			return service;
		}
		return service;
	}
excel下载
response.setCharacterEncoding("GBK");
response.setHeader("Content-Type","application/msexcel");
response.setHeader("Content-Disposition", "attachment;filename="+table_name+".xls");
不要这么写代码啊啊 可以尝试build模式 waring!!!!!! 看到这么雷人的代码,我觉得呆在公司里真是悲催
public CktsQfxxHsh(String hjBh, String fqfZt, String jsfZt, String qcrDm,
			String qcrXm, String fhrDm, String fhrXm, String qfrDm,
			String qfrXm, String nsrsbhGf, String nsrxmGf, String nsrsbhXf,
			String nsrxmXf, String swjgDmJsf, String swjgDmFqf,
			String swjgJcFqf, String swjgJcJsf, String bfpryDm, String bspryMc,
			String lxrXm, String lxrDh, String lxrDz, String lxrYb, Date sjSc,
			Date sjFs, Date sjTjfh, Date sjTjqf, String hjLx, BigDecimal fpfs,
			BigDecimal jeHj, BigDecimal seHj, BigDecimal jshjHj, String qtqk, BigDecimal tseY,
			BigDecimal tseZbbl, String fhsm, Date fuhjzrq, Date rqTk, Date sjFuhfs,
			String dyfhBh, String yqfhBz, String fhBz, String cbBz, Date sjCbhfs) {
		this.hjBh = hjBh;
		this.fqfZt = fqfZt;
		this.jsfZt = jsfZt;
		this.qcrDm = qcrDm;
		this.qcrXm = qcrXm;
		this.fhrDm = fhrDm;
		this.fhrXm = fhrXm;
		this.qfrDm = qfrDm;
		this.qfrXm = qfrXm;
		this.nsrsbhGf = nsrsbhGf;
		this.nsrxmGf = nsrxmGf;
		this.nsrsbhXf = nsrsbhXf;
		this.nsrxmXf = nsrxmXf;
		this.swjgDmJsf = swjgDmJsf;
		this.swjgDmFqf = swjgDmFqf;
		this.swjgJcFqf = swjgJcFqf;
		this.swjgJcJsf = swjgJcJsf;
		this.bfpryDm = bfpryDm;
		this.bspryMc = bspryMc;
		this.lxrXm = lxrXm;
		this.lxrDh = lxrDh;
		this.lxrDz = lxrDz;
		this.lxrYb = lxrYb;
		this.sjSc = sjSc;
		this.sjFs = sjFs;
		this.sjTjfh = sjTjfh;
		this.sjTjqf = sjTjqf;
		this.hjLx = hjLx;
		this.fpfs = fpfs;
		this.jeHj = jeHj;
		this.seHj = seHj;
		this.jshjHj = jshjHj;
		this.qtqk = qtqk;
		this.tseY = tseY;
		this.tseZbbl = tseZbbl;
		this.fhsm = fhsm;
		this.fuhjzrq = fuhjzrq;
		this.sjFuhfs = sjFuhfs;
		this.dyfhBh = dyfhBh;
		this.yqfhBz = yqfhBz;
		this.fhBz = fhBz;
		this.cbBz = cbBz;
		this.sjCbhfs = sjCbhfs;
	}
Boolean的使用不能想当然的用==来做判断 notice http://zhang-xzhi-xjtu.javaeye.com/blog/760512
BooleanUtils.isTrue(Boolean.TRUE)  = true  
BooleanUtils.isTrue(Boolean.FALSE) = false  
BooleanUtils.isTrue(null)          = false  


BooleanUtils.toBoolean(Boolean.TRUE)  = true  
BooleanUtils.toBoolean(Boolean.FALSE) = false  
BooleanUtils.toBoolean(null)          = false  
Global site tag (gtag.js) - Google Analytics