cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beyaNet Consultancy <>
Subject How to determine if a session object has already been created
Date Wed, 14 Apr 2004 21:53:54 GMT
How do I determine, in XSP:LOGIC, whether a session object has already 
been created? Basically I am trying to persist an object, in this case 
an Order object, in a session:

				//1.Determine if an order has been created
				Order newOrder = (Order)session.getAttribute("ORDER");
				if (newOrder == null){
					newOrder = new Order();
				//2.check that stock exists
				Stock newStk = 
				//3.Add stock item
				//4.Update Session object
				session.setAttribute("ORDER", newOrder);

The problem is that the if statement is not working, and as a result a 
new Order object is being created on each pass of the page. What am I 
doing wrong?

View raw message