I have created cookies.jsp and it include in Default.jsp
I had used java script ways to add cookies. I had created a separate Cookie.jsp
Include Cookie.jsp in defualt.jsp at bottom
<%@ include file="./Cookie.jsp" %>
Retrieve cookies in jsp
String user_name=null;
Cookie cokkies[] = request.getCookies();
for(int i = 0 ; i < cokkies.length ; i++ ){
if(cokkies[i].getName().equalsIgnoreCase("user_name")){
user_name = cokkies[i].getValue();
}
Code in cookies.jsp
View source this page to get code
*********************code started******************************************
<%-- Licensed Materials - Property of IBM, 5724-E76, (C) Copyright IBM Corp. 2001, 2004, 2006 - All Rights reserved. --%>
<%@ page session="false"%>
<%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-logic" prefix="portal-logic" %>
<%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-core" prefix="portal-core" %>
*********************code end ******************************************
No comments:
Post a Comment