码迷,mamicode.com
首页 > 其他好文 > 详细

project notes

时间:2014-06-27 17:06:19      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:style   class   blog   http   ext   color   

1、根目录:

String rootPath = application.getRealPath("/");

 

2、文件是否可写:

public boolean isCanWrite(String dirPath) {
File file = new File(dirPath);
if(!file.exists()) {
file.mkdir();
}
if(file.canWrite()) {
return true;
} else{
return false;
}
}

 

3、两个工具类需要导入的包

<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.io.FileSystemUtils"%>

StringUtils.equals(欲验证字符串,"欲验证字符串的值");

参看:apache.commons.io真的很不错 http://hi.baidu.com/chenxiaowen/item/275004c3f834622def466545

 

4、admin目录输入任何地址都定位到login.jsp 应该是shiro的配置,待研

其中 org.springframework.context.ApplicationContextAware 使用理解  需要注意 ,普通类拿任何spring bean的方法 需要继承该接口

String base = request.getContextPath();
ApplicationContext applicationContext = SpringUtils.getApplicationContext();
if (applicationContext != null) {
response.sendRedirect("login.jsp");
}  这个跳转 需要研究,为何判断 applicationContext != null

 

5、动态参数

JDK1.5特性
void fun(Object... objs){}
拿这个举例子
你调用fun方法
fun(里面写多少参数都OK);
比如fun(1,"s");fun(1,2,"s");fun("s");
都可以
动态参数

 6、LocaleResolver(本地化解析器)

参看 http://blog.csdn.net/wendellup/article/details/8532038

 

 

project notes,布布扣,bubuko.com

project notes

标签:style   class   blog   http   ext   color   

原文地址:http://www.cnblogs.com/appzhang/p/3809985.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!