小弟跪求解决如何在JSP读取COOKIE 在线等急!!!!!
我在WEBLOGIC中部署了两个APPLICATION 现想用COOKIE的方式将其中一个APPLICATION中的值传到另一个APPLICATION中 ,写完后发现一个问题 COOKIE文件以生成,在同一APPLICATION中的页面可以读到COOKIE的内容 但在不同的APPLICATION中就无法读取了 请问该怎么写?
Cookie cookie = new Cookie("login",type);
cookie.setMaxAge(300000);
cookie.setPath("/");
response.addCookie(cookie); //写COOKIE type为页面中读Session的一变量
Cookie[] cookies =request.getCookies();
for (int i = 0;i<cookies.length;i++){
Cookie c = cookies[i];
String name = c.getName();
if(name.equals("login")){
out.println("cookie" + c.getValue());
}
} //读COOKIE