[jboss-user] [JBoss Portal] - Re: Accessing HttpServletRequest from RenderRequest

david.hoffman do-not-reply at jboss.com
Wed Nov 29 09:10:48 EST 2006


Sure, I thought I had posted this, but I guess I didn't.

the request object in the sample below is JBossRenderRequest.


  | public String getCookieValue(String cookieName) {
  | 	
  | 	String value = "";
  | 
  | 	cookieName = "JSESSION";
  | 		
  | 	try {
  | 		HttpServletRequest req = (HttpServletRequest)request.getAttribute("javax.portlet.request");
  | 		Cookie[] cookies = req.getCookies();
  | 		for (int j=0; j<cookies.length; j++) {
  | 			Cookie cookie = cookies[j];
  | 			if (cookie.getName().equalsIgnoreCase(cookieName)) {
  | 				value = cookie.getValue();
  | 			}
  | 		}
  | 	} catch (Exception e) {
  | 		log.error("Error in getCookieValue()", e);
  | 	}
  | 
  | 	return value;
  | }
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989695#3989695

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989695



More information about the jboss-user mailing list