`
fenglingxuewqk
  • 浏览: 81994 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
要在Listener中获取HttpServletRequest,方法其实很简单: ServletRequestAttributes rervletRequestAttributes = (ServletRequestAttributes)RequestContextHolder.currentRequestAttributes(); HttpServletRequest request = rervletRequestAttributes.getRequest(); 但是有一种情况要特别注意, 就是请求不是来自于DispatcherServlet/DispatcherPortlet,例 ...
1. tf(t in d) correlates to the term's frequency, defined as the number of times term t appears in the currently scored document d. Documents that have more occurrences of a given term receive a higher score. 2. idf(t) stands for Inverse Document Frequency. This value correlates to the inverse of ...
Spring的这个Util还是很好用的,它会自动过滤null的field而只copy有值的field。 不过有一点需要注意的是当我们处理Object中含有nested Object时,它对于nested Object只copy reference。所以我们对于这些nested Object做改动时就会影响到source object。
设置系统环境  Java代码   sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-7u7/bin/javac 1    sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-7u7/bin/java 1    sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-7u7/bin/javaws ...

CAS +LDAP实现

    博客分类:
  • SSO
1.编辑CAS下的deployerConfigContext.xml,注释其中的SimpleTestUsernamePasswordAuthenticationHandler验证Handler,添加以下代码: <property name="authenticationHandlers"> <list> <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHan ...

CAS server搭建

    博客分类:
  • SSO
1.用JDK自带的keytool工具生成证书:   keytool -genkey -alias tomcat-server -keyalg RSA -keystore .keystore  (其中:tomcat-server是证书别称,.keystore是证书名称,由部署人员自行配置)   然后根据提示输入相应的信息,包括keystore密码、first name/last name等等,对于first name/last name,需用域名或者主机名,不建议使用IP地址或者localhost。完成之后,会在当前目录路下生成一个名为.keystore的证书。 2.将证书与tomc ...
1.在$MATLAB\bin\$ARCH路径下新建java.opts文件。 其中$MATLAB是根路径。$ARCH是系统架构。 或者执行文件的目录。   2.编辑java.opts文件。输入-Xmx1g   3.重启matlab,敲入java.lang.Runtime.getRuntime.maxMemory。显示最大内存改变,设置成功。

JVM内存学习

1.freeMemory(),totalMemory(),maxMemory() java.lang.Runtime类中的 freeMemory(), totalMemory(), maxMemory()这几个方法的反映的都是 java这个进程的内存情况,跟操作系统的内存根本没有关系。   maxMemory()这个方法返回的是java虚拟机(这个进程)能构从操作系统那里挖到的最大的内存,以字节为单位,如果在运行java程序的 时 候,没有添加-Xmx参数,那么就是jvm默认的可以使用内存大小,client为64M,server为1G。如果添加了-Xmx参数,将以这个参数后 面的值为准 ...

matlab bug收集

Summary Redirecting a MATLAB file into matlab -nodisplay can cause "Type-ahead Buffer Overflow" errors Description One way to have MATLAB execute a MATLAB file on a UNIX system is to redirect that file into MATLAB with the command matlab -nodisplay < myMfile.m at the shell prompt. ...
1.0E-130 <= number <1.0E126. -1.0E126 < number <= -1.0E-130  
SimpleDateFormat有线程安全问题。 在多线程的环境下,不使用SimpleDateFormat,或者不使用成员变量/静态成员变量的SimpleDateFormat。 Date formats are not synchronized. * It is recommended to create separate format instances for each thread. * If multiple threads access a format concurrently, it must be synchronized 在Sun自己的网站上。在 ...
用BeanUtils.describe()时,发现Object的List变量没有正确的转化到Map中去,而是只取了List中的第一个成员。   不过只需要加入以下代码就可以了:   BeanUtilsBean.setInstance(new BeanUtilsBean2()); ArrayConverter converter = new ArrayConverter(String[].class, new StringConverter(), 0); converter.setOnlyFirstToString(false); ConvertUtils.register(conv ...

Quartz job 整理

1. 可以用web.xml初始化SchedulerFactory。 <servlet> <servlet-name>QuartzDBJobInitializer</servlet-name> <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class> <init-param> <param-name>servlet-context-fac ...
use gawk or /usr/xpg4/bin/awk to replace of /usr/bin/awk
加载Spring配置文件时,如果Spring配置文件中所定义的Bean类实现了ApplicationContextAware 接口,那么在加载Spring配置文件时,会自动调用ApplicationContextAware 接口中的 public void setApplicationContext(ApplicationContext context) throws BeansException 方法,获得ApplicationContext 对象。 前提必须在Spring配置文件中指定该类。     public class SpringContextHolde ...
Global site tag (gtag.js) - Google Analytics