aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes attributeReplaced method of HttpSessionAttributeListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "attributeReplaced method of HttpSessionAttributeListener" Watch "attributeReplaced method of HttpSessionAttributeListener" New topic
Author

attributeReplaced method of HttpSessionAttributeListener

Kamal Tripathi
Ranch Hand

Joined: Oct 02, 2008
Posts: 86
Consider this piece of code

Employee.java


Person.java


HSAL.java


S1.java




Assume that HttpSessionAttributeListener is configured properly in the DD and /S1 is mapped to S1.java and name of application is sample. Also result.jsp is a simple jsp with some jsp:useBean, jsp:setProperty, jsp:getProperty tags

Now when I execute http://localhost:8080/sample/S1, I am getting this in the console as output



Can anyone explain the second output.
REPLACED: Name: person, Value = (pName: "KT")

I think I read somewhere in HFSJ that in case attribute is replaced, getValue method returns the OLD value of the attribute, hence here I was expecting stmt 2 to be

REPLACED: Name: person, Value = (pName: "nisha")


Kamal Tripathi
SCJP 1.4 90%, SCWCD5 94%, Next SCDJWS--> In Naescent stage. Researching abt exam and material itself.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Somebody has already raised that issue here. That's strange. Maybe an implementation issue.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: attributeReplaced method of HttpSessionAttributeListener