- 浏览: 10244655 次
- 性别:
- 来自: 深圳
博客专栏
-
Oracle基础
浏览量:463159
-
springMVC介绍
浏览量:1776522
-
Mybatis简介
浏览量:1399256
-
Spring整合JMS
浏览量:395268
-
Ehcache简介
浏览量:680350
-
Cas简介
浏览量:531412
-
Spring Securi...
浏览量:1185892
-
Spring基础知识
浏览量:469735
-
Spring Aop介绍
浏览量:151669
-
JAXB简介
浏览量:68509
最新评论
-
18335864773:
推荐用pageoffice 生成 word。POI处理Offi ...
POI生成Web版Word文件 -
234390216:
skran 写道大兄弟文章写的不错,排版有点问题,代码长了既没 ...
Spring Boot(05)——SpringApplication介绍 -
skran:
大兄弟文章写的不错,排版有点问题,代码长了既没换行也没滚动条
Spring Boot(05)——SpringApplication介绍 -
Caelebs:
Ehcache(04)——设置缓存的大小 -
234390216:
thaIm 写道不知道RestTemplate 默认的链接数、 ...
Spring(30)——RestTemplate介绍
文章列表
我使用js在父子之间进行传值主要是通过在子窗口调用父窗口的方法来实现传值的目的。
parent.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>parent.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3 ...
我们都知道连接MySQL一般用的语句就是
jdbc:mysql://localhost:3306/database,
但是当你要连接到其他机器上的mysql的时候,单单把上面的语句的localhost改成对应的ip是没有用的,因为Mysql默认开放的连接权限是localhost,当你需要连接到其他机器上的时候,需要其他机器上的MySQL开启除本地以外的其他ip连接的权限。
在局域网内连接MySQL首先要给MySQL开启远程连接的功能,在MySQL服务器上MySQL命令行执行以下命令:
grant all privileges on *.* to root@"%" ...
对数据进行加密是一个很常用的需求,因为我们经常要进行各种各样数据的校验和数据的传输,在校验的过程中我们往往是不希望用户看到真实的数据的,因为那样在某些情况下就失去了校验的意义了,所以对数据进行加密是一个很平常的需求。
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public ...
1.实现一个方法将一个字符串的奇数位取出,如传的是ahbhchd,就返回abcd
public class Test {
public static void main(String args[]) {
Test t = new Test();
String result = t.getJiShuChuan("ahbhchdhehf");
System.out.println(result);
}
public String getJiShuChuan(String src) {
StringBuffer buffer = ...
把中文变成zhongwen
- 博客分类:
- java
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
impor ...
以前在web环境下想直接读取spring的applicationContext,发现放在WEB-INF下的applicationContext.xml不能直接通过相对路径读取到,也就是说不能通过第一种方式读取到,第一种方式只用于进行单元测试的,而且一定要是在web项目部署后的绝对路径才行。
1.在没有WEB元素的情况下,直接在类里面通过路径获取
ApplicationContext context = new FileSystemXmlApplicationContext("/WebRoot/WEB-INF/applicationContext.xml"); ...
uploadInput页面:
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/& ...
CKEDITOR取值和设值
- 博客分类:
- CKEDITOR
var obj = CKEDITOR.replace("content");
取值:
obj.getData();
设值:
obj.setData("value");
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function(config) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.u ...
我一般使用struts2的时候都是匹配所有类型的,这时候就会出现一个问题,当去访问一个servlet的时候就系统会把它当作一个action来访问,就会出现找不到action的问题。所以这个时候就需要实现一个filter来过滤servlet,并且这个filter要放在struts2的filter之前,要在把它当作一个action之前直接把它进行跳转访问servlet
代码:
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List ...
html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ckeditor_upload.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv=" ...
code.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>code.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv=&quo ...
有时候我们需要动态的将图片的二进制在页面上进行显示,如我们需要弄一个验证码的功能,那么如果我们的验证码的图片在后台得到的是该图片的二进制,那么当我们需要在页面上点击一个按钮利用ajax进行切换的时候,如果在 ...
这个以后一点一点的完善
时间的显示:
我比较常用的方法:
${meeting.startTime?string("yyyy-MM-dd HH:mm:ss")}//?string后面表示显示的格式
循环语句list的应用,
在list循环中,有两个特殊的循环变量可用:
item_index:这是一个包含当前项在循环中的步进索引的数值。
item_has_next:来辨别当前项是否是序列的最后一项的布尔值。
其中的item是别名
如:
<#list persons as person>//persons是一个序列,可以是集合数组之类的, ...
下面的代码是以前一个项目中的一段代码改过来的。
String path = context.getRealPath("/template");
String filePath = context.getRealPath("/");
File dir = new File(path);
Configuration config = new Configuration();
try {
config.setDirectoryForTemplateLoading(dir);
FileWriter out = ...