Skip to content

Commit

Permalink
临时解决Jsessionid不同步问题,后续需调整shiro配置。
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxb committed Mar 30, 2015
1 parent 9812066 commit 3bb9853
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/com/cnvp/paladin/handler/SessionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@
import javax.servlet.http.HttpSession;

import com.jfinal.handler.Handler;

/**
* session参数填入到request
* @author 刘声凤
* 2012-9-4 下午10:22:19
*
* @author 刘声凤 2012-9-4 下午10:22:19
*/
public class SessionHandler extends Handler {

@Override
public void handle(String target, HttpServletRequest request,
HttpServletResponse response, boolean[] isHandled) {
HttpSession session=request.getSession();
Enumeration<String> atts=session.getAttributeNames();
while(atts.hasMoreElements()==true){
String an=atts.nextElement();
HttpSession session = request.getSession();
Enumeration<String> atts = session.getAttributeNames();
while (atts.hasMoreElements() == true) {
String an = atts.nextElement();
request.setAttribute(an, session.getAttribute(an));
}
nextHandler.handle(target, request, response, isHandled);

int index = target.indexOf(";jsessionid".toUpperCase());

if (index != -1) {
target = target.substring(0, index);
}

nextHandler.handle(target, request, response, isHandled);
}

}

0 comments on commit 3bb9853

Please sign in to comment.