RE: Sessions and absolute URLs
The usage of a -handcrafted- session bean would be the preffered way. You loose your session cookie because they are server+context specific and the change to https will be a change to another server. encodeURL wouldn't help because tomcat is buggy here. Regards, Andreas -Original Message- From: Sen, Puny [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 6:20 PM To: [EMAIL PROTECTED] Subject: Sessions and absolute URLs Hi, I've just recently joined the list so forgive me if this topic has been discussed before. I've been having the following experiences with sessions: Links with absolute URLs do not retain the same session (even if they refer to the same webapp). Relative URLs are fine. So if I have a link to a secure page from a non-secure page, then I lose the session, beause I have to specify "https:" in the link. But this only happens on certain browsers. For example, Internet Explorer 5 on Windows NT 4 works fine, but Netscape 4.7 on Windows NT 4 does not. Can this problem be solved through URL rewriting (by wrapping the link in encodeURL()"? Thanks, Puna
RE: Sessions and absolute URLs
Title: RE: Sessions and absolute URLs A bean is just java code with some conventions. You can definitely access a bean from a servlet. A JSP gets compiled into a servlet. -Original Message- From: Sen, Puny [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 1:02 PM To: '[EMAIL PROTECTED]' Subject: RE: Sessions and absolute URLs OK - I'll try that. Excuse the lack of knowledge, but is it possible to access a bean from a servlet (not a jsp)? -Original Message- From: Michael Quinn [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 9:40 AM To: [EMAIL PROTECTED] Subject: RE: Sessions and absolute URLs One way you can maintain the session is to create a java bean, and make it's scope the session. Then depending on your hardware, you should be able to maintain a 1.1 connection and retain session information. -Original Message- From: Sen, Puny [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 9:20 AM To: [EMAIL PROTECTED] Subject: Sessions and absolute URLs Hi, I've just recently joined the list so forgive me if this topic has been discussed before. I've been having the following experiences with sessions: Links with absolute URLs do not retain the same session (even if they refer to the same webapp). Relative URLs are fine. So if I have a link to a secure page from a non-secure page, then I lose the session, beause I have to specify https: in the link. But this only happens on certain browsers. For example, Internet Explorer 5 on Windows NT 4 works fine, but Netscape 4.7 on Windows NT 4 does not. Can this problem be solved through URL rewriting (by wrapping the link in encodeURL()? Thanks, Puna
RE: Sessions and absolute URLs
OK - I'll try that. Excuse the lack of knowledge, but is it possible to access a bean from a servlet (not a jsp)? -Original Message- From: Michael Quinn [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 9:40 AM To: [EMAIL PROTECTED] Subject: RE: Sessions and absolute URLs One way you can maintain the session is to create a java bean, and make it's scope the session. Then depending on your hardware, you should be able to maintain a 1.1 connection and retain session information. -Original Message- From: Sen, Puny [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 9:20 AM To: [EMAIL PROTECTED] Subject: Sessions and absolute URLs Hi, I've just recently joined the list so forgive me if this topic has been discussed before. I've been having the following experiences with sessions: Links with absolute URLs do not retain the same session (even if they refer to the same webapp). Relative URLs are fine. So if I have a link to a secure page from a non-secure page, then I lose the session, beause I have to specify "https:" in the link. But this only happens on certain browsers. For example, Internet Explorer 5 on Windows NT 4 works fine, but Netscape 4.7 on Windows NT 4 does not. Can this problem be solved through URL rewriting (by wrapping the link in encodeURL()"? Thanks, Puna
RE: Sessions and absolute URLs
Yup you just grab it from the session object and cast it to whatever object that it is. -Original Message- From: Sen, Puny [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 10:41 AM To: '[EMAIL PROTECTED]' Subject: RE: Sessions and absolute URLs OK - I'll try that. Excuse the lack of knowledge, but is it possible to access a bean from a servlet (not a jsp)? -Original Message- From: Michael Quinn [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 9:40 AM To: [EMAIL PROTECTED] Subject: RE: Sessions and absolute URLs One way you can maintain the session is to create a java bean, and make it's scope the session. Then depending on your hardware, you should be able to maintain a 1.1 connection and retain session information. -Original Message- From: Sen, Puny [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 9:20 AM To: [EMAIL PROTECTED] Subject: Sessions and absolute URLs Hi, I've just recently joined the list so forgive me if this topic has been discussed before. I've been having the following experiences with sessions: Links with absolute URLs do not retain the same session (even if they refer to the same webapp). Relative URLs are fine. So if I have a link to a secure page from a non-secure page, then I lose the session, beause I have to specify "https:" in the link. But this only happens on certain browsers. For example, Internet Explorer 5 on Windows NT 4 works fine, but Netscape 4.7 on Windows NT 4 does not. Can this problem be solved through URL rewriting (by wrapping the link in encodeURL()"? Thanks, Puna
RE: Sessions and absolute URLs
OK - I'll try that. Excuse the lack of knowledge, but is it possible to access a bean from a servlet (not a jsp)? There is a rough equivalence between JSP bean "scopes" and servlet code: * jsp:useBean id="name" class="..." scope="page"/ servlet equiv. is a local variable in the doXyz (e.g. doGet) method * jsp:useBean id="name" class="..." scope="request"/ class name = (class) request.getAttribute("name") * jsp:useBean id="name" class="..." scope="session"/ HttpSession session = request.getSession(); class name = (class) session.getAttribute("name") * jsp:useBean id="name" class="..." scope="application"/ ServletContext context = getServletContext(); class name = (class) context.getAttribute("name") You can set the bean in a servlet by using an equivalent setAttribute method (except for "page" scope). This allows servlets to set beans that are then may be used by JSP pages. -Bryan