aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes j2ee certificate ques Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "j2ee certificate ques" Watch "j2ee certificate ques" New topic
Author

j2ee certificate ques

singh santosh
Ranch Hand

Joined: Jan 13, 2006
Posts: 136
hi ,

i have few doubts over this
option 2:how can we rely on ServletConfig ,they can be configured to have diff value?

option4)can we share HttpSession ,doesnt sharing different from session migration?

guys help me out ?

thanks & regards
-santosh
Sandeep Singh Kunwar
Ranch Hand

Joined: Feb 27, 2006
Posts: 52
Hi santosh!
option 2:how can we rely on ServletConfig ,they can be configured to have diff value?

I also want some clarification.

option4)can we share HttpSession ,doesnt sharing different from session migration?

what i understand is that sharing is different from session migration.
And while session migration a object can be in only and only one session at a time.

More clarifications are needed.


OfCourse Learner...<br />SCJP 5, SCWCD1.4<br />Blogs: <a href="http://sandeepkunwar.blogspot.com" target="_blank" rel="nofollow">http://sandeepkunwar.blogspot.com</a>
Shivani Chandna
Ranch Hand

Joined: Sep 18, 2004
Posts: 380
Even I am very unsure of the answers. Can someone point out the right answer to this question.

Regards,
Shivani.


/** Code speaks louder than words */
Mohd Fuzail
Ranch Hand

Joined: Feb 20, 2002
Posts: 107
1.You cannot rely on the ServletContext to share data.
Since we have Servlet Context per app per VM

2. You cannot rely on ServletConfig for distributed web-applications.
Since we have Servlet Config per Servlet

3. Each JVM has a separate instance of a servlet context.
I think this should be also a part of answers!!! Unless we have one app distributed accross multiple VM, in which case option 1 should not be a part of answer !!! Comments please

4. HttpSessions can be shared across distributable web-applications.
When HttpSessions is required in Distributed Application, it is migrated to the VM where it's required. So sharing is possible


Being defeated is often a temporary condition. Giving up is what makes it permanent.
akshay pandit
Ranch Hand

Joined: Jun 15, 2003
Posts: 44
Hi Fuzail,

4. HttpSessions can be shared across distributable web-applications.
When HttpSessions is required in Distributed Application, it is migrated to the VM where it's required. So sharing is possible


In my opinion sharing of session is not possible.. it can be migrated.. but not shared, by sharing what I understood was that after the session is migrated from one VM (VM1)to another(VM2), still VM1 can use the session, which I think is not possible. Once the session is migrated to VM2, VM1 will no longer be able to access the session..

Guru's please comment .....


Thanks..
Akshay
Amit Tayal
Ranch Hand

Joined: Apr 25, 2006
Posts: 51
Hi All
I have a different interpretation for first two options:

1.You cannot rely on the ServletContext to share data.
True, As each we have one ServletContext per VM and if we add any new attribute added to one ServletContext, it cannot be moved to other Servlet context automatically.

2. You cannot rely on ServletConfig for distributed web-applications.
False, Even though we do have one ServletConfig per VM, we can not add or modify any variable in it, so it can be considered as safe. (Here I made one assumption that same application has been deployed at all the servers)

Please let me know is it fine or not.

Amit
Mohd Fuzail
Ranch Hand

Joined: Feb 20, 2002
Posts: 107
Possible scenrio of Session sharing in Distributed Environment

Lets say we have 2 VM, VM1 and VM2. Request comes for a servlet1 on VM1, so its handled there, and the reponse is send back. In the mean time due to load sharing/distribution Servlet1 is moved to VM2, now same client make a reply or send some more information in the same session to Servlet1, the Container will see that now the servlet has been moved to VM2, so the HttpSession will be migrated from VM1 to VM2, to continue to send the request to Servlet1. At one time one HttpSession can be present at one place only and from client perspective it might see a little delay and laod balancing is totally transparent

You cannot rely on ServletConfig for distributed web-applications.
We have one servlet config per Servlet not per VM
Amit Tayal
Ranch Hand

Joined: Apr 25, 2006
Posts: 51
Hi Fuzail
I have a query related to Distributed web-application.

As per my understanding of distributed web-applications, each VM has it's own copy of web-application but as per above mentioned reply we are migrating the complete servlet for the sake of load balancing.

So, it means we can migrate the servlet while doing load balancing.

Amit

PS: I have a very small knowledge of Distributed web-application, so please don't get offended by my silly question.
Mohd Fuzail
Ranch Hand

Joined: Feb 20, 2002
Posts: 107
No questions is silly or great.. question is question..

Each VM has it's own copy of Config and Context Objects. Session object is shared accross VM by migration.

It's upto web container to do migration in case of load sharing among differrent VMs
Amit Tayal
Ranch Hand

Joined: Apr 25, 2006
Posts: 51
As each VM has it's own copy of config so can not we say that ServletConfig is reliable in distributed environment as we can not add or modify (at runtime)anything in ServletConfig.

Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: j2ee certificate ques