木子响日记
木子响日记 · 共 34 篇文章
OpenSessionInView无效的可能原因
首先,我在此写下的是我的项目中设置OpenSessionInView无效的情况下的解决方式,网络上有很多关于OpenSessionInView无效的解决方法,大家在试过后还是没法解决问题的话,可以参考我的错误,看看是不是犯了一样的错误。 我的解决方法是把OpenSessionInView这个Filter设置在Struts的Filter之前(注:web.xml文件中)。 <!-- 这个OpenSessionInView必须配置在下面struts的filter的前面 --> <filter> <filter-name>OpenSessionInViewFilter</filter-name> <…
2012-12-18 09:21 · Spring · 评论(0)
jsessionid释疑解惑(之二)
(1) 这是一个保险措施 因为Session默认是需要Cookie支持的 但有些客户浏览器是关闭Cookie的 这个时候就需要在URL中指定服务器上的session标识,也就是5F4771183629C9834F8382E23BE13C4C 用一个方法(忘了方法的名字)处理URL串就可以得到这个东西 这个方法会判断你的浏览器是否开启了Cookie,如果他认为应该加他就会加上去 (2) 链接1:wapbrowse.jsp?curAlbumID=9 ; 链接2:wapbrowse.jsp;jsessionid=5AC6268DD8D4D5D1FDF5D41E9F2FD960?curAlbumID…
2012-05-03 16:00 · web · 评论(0)
ExtJS中的Apply方法(Ext.apply & Ext.applyIf)
apply及applyIf方法都是用于实现把一个对象中的属性应用于另外一个对象中,相当于属性拷贝。 不同的是apply将会覆盖目标对象中的属性,而applyIf只拷贝目标对象中没有而源对象中有的属性。 apply方法的签名为“apply( Object obj, Object config, Object defaults ) : Object”, 该方法包含三个参数: 第一个参数是要拷贝的目标对象, 第二个参数是拷贝的源对象, 第三个参数是可选的,表示给目标对象提供一个默认值。 可以简单的理解成把第三个参数(如果有的话)及第二个参数中的属性拷贝给第一个参数对象。 看下面的代码: var b…
2012-05-02 16:29 · ExtJS · 评论(0)
Servlet( ServletConfig & ServletContext)
开发第一个Servlet入门应用 打开myeclipse,新建一个web工程,名为day04,在src目录下新建一个包为it.cast,如下: 同时在web.xml文件中会自动产生代码: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/…
2012-05-02 10:33 · web · 评论(0)
ServletContext(之二)
声明转帖自 http://flybaggio.blogbus.com/logs/6840649.html 感谢原作者 不同应用之间servlet的调用 package bao1; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import j…
2012-05-02 09:45 · web · 评论(0)
jsessionid释疑解惑(之一)
在web应用的开发中我们会经常看到这样的url:http://www.xxx.com /xxx_app;jsessionid=xxxxxxxxxx?a=x&b=x...。这跟一般的url基本一样,只有一个地方有区别,那就是 “;jessionid=xxxxxxxx”。这个参数有时候有,有时候又没有,说它是参数可又跟一般传递的参数不同,它是紧跟在url后面用分号来分隔 的,用一般的request.getParameter()方法还取不到。那这个参数到底是干嘛用的呢?要了解它还要先了解session的实现方式。 session的实现方式 做web开发的同学都知道,http是无状态的会话协议,也就…
2012-04-29 10:13 · web · 评论(0)
ServletRequest.getRequestDispatcher() and ServletContext.getRequestDispatcher()
The difference between ServletRequest.getRequestDispatcher(String path) and ServletContext.getRequestDispatcher(String path) is that the former can accept a relative path as well whereas the latter can accept paths relative to the current context root only. If the path starts with a ‘/’ in the getR…
2012-04-29 10:08 · web · 评论(0)
ServletContext(之一)
API中ServletContext接口的定义: public interface ServletContext Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file. There is one context per "web application" per Java Virtual Machin…
2012-04-28 17:52 · web · 评论(0)
What is "Principal", and what is meant by "Principal authentication"?
What is "Principal", and what is meant by "Principal authentication"? Linda Gricius (March, 1998): Principal authentication is the process of proving your identity to the security enforcing components of the system so that they can grant access to information and services based on who you are. This…
2012-03-07 11:20 · Acegi · 评论(0)
Ext Tree 加载超时 Timeout 问题的解决办法
这几天老板让我将师姐曾经做过的一个预案推荐的功能跑起来,算法我没有深究,功能就是将推荐出来的预案按照树形显示出来,异步加载,点击根节点,才去后台取数据一次性将所有子节点获取,并展开。部署到服务器,页面也能访问,点击根节点,也能执行加载过程,后台运作也正常,但是前台总是超时,根节点停止获取数据,死掉了。 查寻这方面的资料实在是少,因为大部分应用很难遇到这种情况,出现节点很多的,人家都是采取异步加载,点击一个父节点,才展开一个子节点,而这个是全部获取,另外师姐这个时间主要浪费在了预案推荐算法的执行上了,这是大头,具体算法没有研究,暂时提不出优化方案,目前就只是在现有情况下实现解决。 将解决方法提…
2012-03-01 09:11 · ExtJS · 评论(0)
汇总推荐几个JSON串格式校验工具
第一个 http://jsonformatter.curiousconcept.com/#jsonformatter 第二个 http://jsonlint.com/ 第三个 http://www.bejson.com/go.html?u=http://www.bejson.com/index.php 先推荐这么多吧。如果能遇到更好的,我会继续推荐。
2012-02-28 16:27 · ExtJS · 评论(0)
Acegi中JdbcDaoImpl内MappingSqlQuery的讲解
MappingSqlQuery is a reusable query in which concrete subclasses must implement the abstract mapRow(..) method to convert each row of the supplied ResultSet into an object of the type specified. The following example shows a custom query that maps the data from the t_actor relation to an instance o…
集成ACEGI 进行权限控制
集成ACEGI 进行权限控制 http://littlefermat.blog.163.com/blog/static/597711672008711115943843/
SQL中的Limit用法
In MySQL, this is accomplished using the LIMIT keyword. The syntax for LIMIT is as follows: Sometimes we may not want to retrieve all the records that satsify the critera specified in WHERE or HAVING clauses. [SQL Statement 1] LIMIT [N] where [N] is the number of records to be returned. Please note…
2011-12-05 20:45 · SQL · 评论(0)