Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CF- JSP Session Variables

1 view
Skip to first unread message

vayumahesh

unread,
Mar 10, 2005, 11:58:42 AM3/10/05
to
Hi, My question is related to 'Session Variables' in ColdFusion MX7 on J2EE
environment. I have 3 files; login.jsp, application.cfm and page1.cfm. I am
setting a session variable in login.jsp and I want to access that session
variable in page1.cfm. Here is the code I currently have ... login.jsp =======
1. session.setAttribute('id',request.getParameter('id')); 2. Hello, <%=
session.getAttribute( 'id' ) %> 3. <% ((Map)
(session.getAttribute('testApp'))).put('myvar','Successful'); %> 4. <script
language='javascript'> 5. location.href = '/cfJsp/page1.cfm'; 6. </script>
application.cfm ============ 1. <cfapplication name='testApp'
sessionmanagement='yes'> page1.cfm ======== 1.
<cfoutput>#session.myvar#</cfoutput> The Code is working fine if I take out
the Line 3. in login.jsp file (Redirecting to page1.cfm and throwing error on
myvar). But, with Line 3. present in login.jsp file, I am getting 'Page Cannot
be Displayed'. Line 3. is the main code which makes the JSP Session variable
available in CFM page and I am not sure what is wrong with that code. Please
Help. Thanks, VMRao

0 new messages