`
wuhaidong
  • 浏览: 349776 次
  • 性别: Icon_minigender_1
  • 来自: 青岛
社区版块
存档分类
最新评论
文章列表
Hibernate是对JDBC的轻量级对象封装,Hibernate本身是不具备Transaction处理功能的,Hibernate的Transaction实际上是底层的JDBC Transaction的封装   Connection conn = ...; <--- session = sf.openSession();; conn.setAutoCommit(false); <--- tx = session.beginTransactioin();; ... ...

获取Servlet对象

//模拟HttpSession Map<String,Object> session=ActionContext.getContext().getSession(); //模拟Application Map<String,Object> application=ActionContext.getContext().getApplication(); //取得HttpServletRequest HttpServletRequest request=ServletActionContext.getRequest(); //取得Http ...
$(document).ready(function(){ $("#submitButton").live("click",function(){//进入后台系统 var checkInfo=$("#checkInfo"); var userName=$("#administrator").val(); var password=$("#password").val(); var checkCode=$("#checkCode").val(); ...

刷新页面

1.定时刷新:<META HTTP-EQUIV="Refresh" content="10; URL=http://自己的URL"> 2.用js手动刷新: function refresh() {    window.location.reload(); }  
parent.frames['main'].getAdmin();  
String ieheader=request.getHeader("user-agent");//客户端浏览器的版本号、类型 Integer timeout=request.getSession().getMaxInactiveInterval();//身份过期 String webServerName=request.getScheme()+"://"+request.getServerName();//服务器域名 ServletActionContext.getServletContext().getServerInfo();//脚本解释引擎 ...
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http:/ ...
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" ...
<!-- 配置拦截器站 --> <interceptors> <interceptor name="loginInterceptor" class="org.cric.interceptor.LoginInterceptor"></interceptor> <interceptor-stack name="myStack"> <interceptor-ref name="loginInterceptor"> ...
一段JavaScript脚本程序,负责关闭窗口,如果网页不是通过脚本程序打开的(window.open()),调用window.close()脚本关闭窗口前,必须先将window.opener对象置为null,否则浏览器(IE7、IE8)会弹出一个确定关闭的对话框。 <script language="javaScript"> function closeWindow() {  window.opener = null;  window.open(' ', '_self', ' ');  window.close(); } </script> ...

get提交处理中文

    博客分类:
  • SE
解决乱码问题传参需要转码: 服务器端:String name = URLDecoder.decode(request.getParameter("name"),"UTF-8"); 客户端参数:encodeURI(encodeURI($('#name').val())); 也可以把参数放到form表单中,通过提交form表单的方式解决乱码问题。     byte[]bytes=title.getBytes("ISO-8859-1"); String strTitle=new String(bytes);  

Cookie

    博客分类:
  • SE
写入Cookie Cookie 存在客户端中于Session 区别     现在服务器中创建一个Cookie Cookie myCookie=new Cookie(String name,String value); 设置Cookie存在的时间,不设置的话,Cookie将不会保存 myCookie.setMaxAge(20); 将该Cookie写回到客户端 response.addCookie(myCookie) /////////////////////////// 站在服务器的角度考虑问题。。。。。 从客户端得到所有Cookie信息 Cookie[] al ...
package org.cric.util; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.awt.*; import java.awt.image.*; import java.util.*; import javax.imageio.*; public class AuthImg extends HttpServlet { private static final long serialVersionUID = 1L; //设置字体 privat ...

if else

    博客分类:
  • SE
if(obj!=null){       System.out.println("对象不是null");}else{       System.out.println("对象是null'"); }   if(){}else{} 只能满足条件就是执行里面的代码,主要你记住这里只能满足一个条件!
<input type="checkbox" name="myStatus" value="1"/>     假设Action层接收的数据 private Integer myStatus; 如果你选中checkbox 的话,到Action 层 String 会转换成Integer 类型,数据为myStatus=1; 否则数据为myStatus=null;     if(myStatus==1){ }else{ }   当myStatus=1的时候,没有问题,当myStatus=null的时候,会报空 ...
Global site tag (gtag.js) - Google Analytics