09 2016 档案
摘要:<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="
阅读全文
摘要:<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags"%><
阅读全文
摘要:java代码: package action; import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException; import org.apac
阅读全文
摘要:<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache
阅读全文
摘要:/* * 用来生成where子句 len数组的长度 */ private String toWhereSql(int len) { StringBuilder sb = new StringBuilder("userId in("); for(int i = 0; i < len; i++) { s
阅读全文
摘要:// 给客户端返回一个json对象 StringBuilder sb = new StringBuilder("{"); sb.append("\"name\"").append(":").append(user.getName()); sb.append(","); sb.append("\"ge
阅读全文
摘要:package com.pb.down;import java.io.File;import java.io.FileInputStream;import java.io.IOException; import javax.servlet.ServletException;import javax.
阅读全文
摘要:// 保存用户到session req.getSession().setAttribute("sessionUser", user); // 获取用户名保存到cookie中 String loginname = user.getLoginname(); loginname = URLEncoder.
阅读全文
摘要:1.java类: import java.io.IOException;import javax.servlet.Filter;import javax.servlet.FilterChain;import javax.servlet.FilterConfig;import javax.servle
阅读全文
摘要:<!-- 配置Spring的用于初始化容器对象的监听器 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context
阅读全文
摘要:<!-- 配置Struts2的核心的过滤器 --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFil
阅读全文
摘要:1.编写生成验证码的工具类: import java.awt.BasicStroke;import java.awt.Color;import java.awt.Font;import java.awt.Graphics2D;import java.awt.image.BufferedImage;i
阅读全文
摘要:<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> *{margin: 0;padding: 0;} #box{width: 880px;height: 480px
阅读全文
摘要:import java.io.IOException;import java.io.UnsupportedEncodingException; import org.junit.Test; import sun.misc.BASE64Encoder;import sun.misc.BASE64Dec
阅读全文
摘要:依赖的jar包:commons-fileupload-1.2.2.jar commons-io-1.4.jar form3.jsp代码: <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%@ taglib pr
阅读全文
摘要:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>树形菜单</title> <script type="text/javascript" src="js/jquery.js" ></script> <script type="tex
阅读全文
摘要:ActionContext.getContext().put("list", list); ActionContext.getContext().getValueStack().push(listName);//准备回显数据 session中放数据: ActionContext.getContext
阅读全文
摘要:在login.jsp中加入即可 // 在被嵌套时就刷新上级窗口 if(window.parent != window){ window.parent.location.reload(true); }
阅读全文
摘要:<s:if test="#session.user.hasPrivilegeByName(name)"> hasPrivilegeByName(name) 为User类中的一个java方法
阅读全文
摘要:java代码: public class InitListener implements ServletContextListener { public void contextInitialized(ServletContextEvent sce) { // 获取容器与相关的Service对象 A
阅读全文
摘要:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>li导航</title> <style type="text/css"> *{padding: 0;margin: 0;} #box{width: 100%;background:
阅读全文
摘要:<s:radio name="gender" list="{'男', '女'}"></s:radio> <s:select name="viewType" list="#{0:'精华题', 1:'普通题'}"/> <s:select name="asc" list="#{false:'降序', tr
阅读全文
摘要:/** * 显示多颗树的所有节点的信息 * * @param departmentList */ private void showTreeList(Collection<Department>departmentList) { for (Department top : departmentLis
阅读全文
摘要:在web.xml添加如下,注意:在配置在struts2的拦截器之前,只能解决请求时出现的懒加载异常;如果没有请求,还需要lazy属性的添加(比如过滤器) <!-- 配置Spring的用于解决懒加载问题的过滤器 --> <filter> <filter-name>OpenSessionInViewFi
阅读全文
摘要:var val = $("#id").val(); var reg =/垃圾|你大爷|你妹的/g; if(val){ // false : isNaN-- 0-- undefind--"" -null--'' val = val.replace(reg,function(s){ var str =
阅读全文
摘要:document.querySelector("#id");
阅读全文
摘要:<s:form action="role_%{ id == null ? 'add' : 'edit' }"> <s:hidden name="id"></s:hidden>
阅读全文
摘要:第一种方式: /** 列表 */ public String list() throws Exception { List<Role> roleList = roleService.findAll(); ActionContext.getContext().put("roleList", roleL
阅读全文

浙公网安备 33010602011771号