Andre and Sean,
thank you very much for your prompt reply and helpful pointers. Both examples are very
helpful. However, it has not worked yet.
Andre,
I followed your example,
In your JSP/Servlet
(Map) session.getAttribute("yourCFApplicationName").put("foo","bar");
And then you can access it in a .cfm like this:
#session.foo#
but, when I try to access attribute in my CFM page, I would get
UndefinedElementExceptoin.
and I also tried accessing application variable to see if at least that would work.
application.setAttribute("yourCFApplicationNam.foo","bar");
In you .cfm you access it like this:
#application.foo#
I would get the same exception when tyring to access it.
I used my own variables during the test but followed the exact syntax you outlined.
May I ask do you have this working on CFMX and WebLogic 7.0?
I contacted Macromedia, and they said that sharing session between JSP/Servlet on
WebLogic7.0 with CFMX has a bug, that it is not an issue with WebSphere, that I was
the first person to have reported this issue. I find it amazing that I am the only
one who has encountered this issue so far, Has anyone else seen this?
Sean,
The IBM article is very good! I further simplied the example to only 3 classes. but,
I am unable to access the attribute in CFM which was set in my JSP either. (obviously,
for the same reason). Be happy to provide stackTrace if you are interested.
Again, any comments/info on sharing J2EE session in WebLogic 7.0 with CFMX will be
greatly appreciated!!
While we are on this subject, I am trying to use CFMX and WebLogic 7.0 together to
build our web app. Architecture would be CFMs constitute the View tier, Servlets
being the Controller, and EJBs being the Model. (if only I could get the CFMs to share
session with Servlets). If anyone has experience in building an app using CFMX and
WebLogic in a hybrid fashion, could you drop me a line or two letting me know if you
liked the experience?
thx!
Steven
Date: 06/05/2003 10:36 AM
Author: Andre Mohamed
Short Link: http://www.houseoffusion.com/lists.cfm?link=m:4:24562:123485
Unfortunately it�s not quite as simple as being able to see each others
session or application variables in the same way. Request variables can
be seen as you would expect.
To put a variable into a ColdFusion session you have to do something
like this:
In your JSP/Servlet
(Map) session.getAttribute("yourCFApplicationName").put("foo","bar");
And then you can access it in a .cfm like this:
#session.foo#
Application variables are easier:
application.setAttribute("yourCFApplicationNam.foo","bar");
In you .cfm you access it like this:
#application.foo#
The key to remember is that it is all oriented around the application
name you defined for your ColdFusion app using <cfapplication>
I believe there is more comprehensive coverage in the cfdocs.
Regards,
Andr�
-----Original Message-----
From: Steve [mailto:[EMAIL PROTECTED]
Sent: 05 June 2003 15:07
To: CF-Talk
Subject: how to share servlet's session with Cold Fusion MX template?
Hello everyone,
I deployed ColdFusion MX as a web application to WebLogic7.0.
I have a J2EE servlet that invokes a CFM page. This works. However, if I
try to set an attribute in the servlet's session, and try to pass that
session along to the CFM Page, in the CFM Page, it will NOT understand
that attribute.
In the CFM page, i have
// test forwarding to cfm page.
String userArr[] = new String[1];
userArr[0] = "Wednesday";
HttpSession session = request.getSession(true);
session.setAttribute("sess", userArr);
getServletConfig().getServletContext().getRequestDispatcher
("/test/UserResultForm.cfm").forward(request, response);
And in the invoked CFM page, I cfdump the session info with this line,
<cfdump var=#session#>
I don't see "sess" as a valid attribute! in fact, when I try to access
it with
<!--- cfoutput> debug : #session.sess#</cfoutput --->
ColdFusion would throw an error saying sess is NOT defined.
In the Cold fusion Adminstrator, i have certainly turned on "Enable
Session Variables" and "Use J2EE session variables" flags and restarted
the server. and in my application.cfm, I already have the following
attributes set, as follows,
<cfapplication name="form175" SESSIONMANAGEMENT="YES"
SESSIONTIMEOUT=#CREATETIMESPAN(0,0,30,0)#>
Thx a lot in advance for any suggestions/examples!
Steven
---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).
[Top] [Parent] [Reply] Date: 06/05/2003 12:48 PM
Author: Sean A Corfield
Short Link: http://www.houseoffusion.com/lists.cfm?link=m:4:24562:123518
On Thursday, Jun 5, 2003, at 07:07 US/Pacific, Steve wrote:
> I deployed ColdFusion MX as a web application to WebLogic7.0.
> I have a J2EE servlet that invokes a CFM page. This works. However, if
> I try to set an attribute in the servlet's session, and try to pass
> that session along to the CFM Page, in the CFM Page, it will NOT
> understand that attribute.
There's a great article on IBM's DeveloperWorks site that shows how to
do this for WebSphere so something similar should work for WebLogic. I
don't have the URL to have but I blogged it only yesterday so you
should be able to find it easily enough on my blog...
Sean A Corfield -- http://www.corfield.org/blog/
---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4