This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question on attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question on attributes" Watch "Question on attributes" New topic

Question on attributes

Sandya Bhaskara
Ranch Hand

Joined: Aug 20, 2004
Posts: 73
page 255 of HFS says that in distributed applications http session objects and attributes move from one VM to another .servlet context/servletcontext attributes are replicated...i have a question...what happens if the attributes of servletcontext/configuration are changed in one virtual machine... will that affect the servletcontext attributes in a different virtual machine(will they be changed too)?

Sandy<br />SCJP1.4 SCWCD1.4<br />SCBCD(preparing)
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Can ServletContext values be changed at all?

Sandya Bhaskara
Ranch Hand

Joined: Aug 20, 2004
Posts: 73
i'm talking about the servletcontext attributes....u can set and get the in distributed applications if u set the servletcontext attributes on one VM will the servletcontext attributes on a different VM change?
Bahadar Khan
Ranch Hand

Joined: Jun 19, 2003
Posts: 81
ServletContext is duplicated per JVM. This implies that each VM should have its own ServletContext and no doubt each Context will have same context parameters but as there is one Context per VM, so any attribute change in one VM shouldn't be available to another VM. There seems a possibility that ContextListeners may be implemented in such a way that each change should trigger an event so the ServletContext's in other VM should update their attribute list. This is I THINK..but not sure. Hope somebody might shed a light on this subject. But definitly a very intelligent question.
I agree. Here's the link:
subject: Question on attributes
It's not a secret anymore!