| Author |
Doubt in UrlRewriting
|
Ankur Gargg
Ranch Hand
Joined: Sep 11, 2011
Posts: 47
|
|
HI Ranchers
I have got two doubts
1)session.setAttribute("a",5);
Will this work in JEE 6?I mean to ask whether autoboxing feature is available in JEE6 .I know it is available in JDK 1.6.
2)Upon a user's first visit to website which two operations are always performed when the getSession() is called without arguments on a servlet
a)All URLS' returned are encoded.
b)An HttpSession object is created if necessary.
c)Session ID is stored as cookie in response.
As per me answer should be a) and c).Am I correct ranchers?
|
|
 |
Piyush Joshi
Ranch Hand
Joined: Jun 10, 2011
Posts: 206
|
|
1) of course it will work. Java EE 6 is built on top of Java SE 6.
2) wrong.
Option "a" is wrong because url rewriting does not happen automatically.
Option "b" is correct because this is what getSession() does.
Option "c" is correct because container is required to support cookies as session tracking mechanism.
|
OCPJP 6, OCE-JSP and Servlet Developer
|
 |
Ankur Gargg
Ranch Hand
Joined: Sep 11, 2011
Posts: 47
|
|
Hi Piyush
What if I was writing the SCWCD 5 exam then what would have been your answer for 1).
|
 |
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 742
|
|
Hi Ankurr,
What if I was writing the SCWCD 5 exam then what would have been your answer for 1).
This depends on your servlet-container provider. If you check the servlet specifications (e.g. Servlet 2.4, SRV 1.2):
J2SE 1.3 is the minimum version of the underlying Java platform with which
servlet containers must be built.
Have you tried Tomcat 5.5? I guess it does support Java SE 1.5 and therfore autoboxing.
Regards,
Frits
|
 |
Ankur Gargg
Ranch Hand
Joined: Sep 11, 2011
Posts: 47
|
|
Hi
In exam we are not given the container provider details.
So suppose I am writing SCWCD 5 then can I consider autoboxing as automatic?
I mean will autoboxing occur.
Regards
Ankur Garg
|
 |
Piyush Joshi
Ranch Hand
Joined: Jun 10, 2011
Posts: 206
|
|
JRE version of JVM, that container uses to run, can be changed as needed (Just set the JAVA_HOME environment variable).
In exam you can assume that Java EE5 container runs Java SE5 JVM, so the autoboxing will work.
|
 |
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 742
|
|
So suppose I am writing SCWCD 5 then can I consider autoboxing as automatic?
I agree with Piyush (if I had to choose an option in such a question).
An exam question involving autoboxing without mentioning Java SE1.5 wouldn't be fair as it isn't mandated by the specifications (and those are the subject of the certification), so I guess it won't happen.
Regards,
Frits
|
 |
 |
|
|
subject: Doubt in UrlRewriting
|
|
|