<jsp:useBean> unexpected behavior
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
In servlet if we have
jsp code :
In the generated servlet:
Runtime exception is thrown
and in case we have something apart from null in the request attribute:
the generated servlet has:
Why the null condition has diffeent behaviour in both cases in the generated servlet?
jsp code :
In the generated servlet:
Runtime exception is thrown
and in case we have something apart from null in the request attribute:
the generated servlet has:
Why the null condition has diffeent behaviour in both cases in the generated servlet?
SCJP6:80%, OCWCD 88 %
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Whooaah! Very strange.
From what I have learnt, I think the generated servlet for a given jsp should be the same irrespective of what some other servlet does before calling it.
Could someone please clarify.
ps: which container are you using?
From what I have learnt, I think the generated servlet for a given jsp should be the same irrespective of what some other servlet does before calling it.
Could someone please clarify.
ps: which container are you using?
Cheers,
Roy.
Sun Certified Java Programmer 1.5,
Sun Certified Web Component Developer 5.
"No pain. No Gain"
http://cs.nyu.edu/~rpm319
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi, Shwetha.
Can you please post, how you are accessing jsp:useBean in the above case?
Can you please post, how you are accessing jsp:useBean in the above case?
SCJP5.0, SCWCD5.0, OCEJPAD6, OCPJWSD6
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I missed the difference in usage.
If we dont specify the class attribute for the jsp:use bean, then Instanciation Exception is thrown in case the bean is not present in session or its null
results in
and in case we give class attribute
results in
If we dont specify the class attribute for the jsp:use bean, then Instanciation Exception is thrown in case the bean is not present in session or its null
results in
and in case we give class attribute
results in
SCJP6:80%, OCWCD 88 %
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
From the syntax ref:
The <jsp:useBean> element locates or instantiates a JavaBeans component. <jsp:useBean> first attempts to locate an instance of the Bean. If the Bean does not exist, <jsp:useBean> instantiates it from a class or serialized template.
| Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |







