Forums Register Login

jsp:useBean tag Rules

+Pie Number of slices to send: Send
Hi all
I am a bit confused re tag Rules.
On Heads First Servlets n Jsp Book pg 354, it says that i can code a useBean tag with a 'type' attribute on its own as long as the bean ALREADY EXISTS.
Coincidentally at work im using this code:

and i know for sure i have a bean object set in my request, so how come i am getting an Instantiation Exception still, saying i should declare either a class or a beanName.
Please help.
Thanks lots
Rina
+Pie Number of slices to send: Send
Hi Rina,

Are you sure you have bean call imap in the request scope?

If scope is missing, by default it will find in the page scope only.
You have used scope="request", so in the request scope there must
be a bean called imap in order to be able to use:

<jsp:useBean id="imap" type="java.lang.Object" scope="request"/>



Thanks,
[ August 15, 2007: Message edited by: Chandra Bhatt ]
+Pie Number of slices to send: Send
Hi Chandra
thanks for your quick reply.
i just thought i could use any id n that i only needed d id to be able to call the bean in my jsp page later . So now this code works:

One other thing please, any suggestion why EL doesnt work for me, i thought this was enabled by default. I checked my DD for any settings but don't know what else to do, any ideas please
thnx a million
Rina
+Pie Number of slices to send: Send
One other thing please, any suggestion why EL doesnt work for me, ...


EL is only enabled by default when using a JSP 2.0 compliant container (make sure you're using Tomcat 5.x or later) and a Deployment Descriptor version 2.4 or higher.

See your Deployment Descriptor (DD).

Thanks,
+Pie Number of slices to send: Send
Hi Chandra
im using Weblogic 8.1.3 and my DD says:

so i guess i can't use EL in my app.
I have used JSTL but would i be able to embed scripting inside my JSTL eg.
<c:if test="<%request.ge.........
thanks
Rina
+Pie Number of slices to send: Send
I have used JSTL but would i be able to embed scripting inside my JSTL eg.
<c:if test="<%request.ge.........



Yeah, of-course you can use!

+Pie Number of slices to send: Send
thanks Chandra, im so used to scripting, so bit shaky till i get d hang of all this jstl,el etc.
regards
Rina
+Pie Number of slices to send: Send
And Rina

For

One other thing please, any suggestion why EL doesnt work for me, ...



Try to include this
<%@ page isELIgnored="false"%>
in your JSP page.

And see whether it works.
As it's going to override all the previous declarations/steps which might be resulting to this problem.

I think, it should work.

Regards,
Khushhal
+Pie Number of slices to send: Send
Rina,
if Weblogic 8 does not support servlets 2.4, I strongly recommend you to get a servlets 2.4 compliant container to study for the exam, or may find it difficult to get on with the examples of your book.
+Pie Number of slices to send: Send
is it only EL i wouldn't be able to practice on or something else also please?
thanks
regards
Riina
+Pie Number of slices to send: Send
2.3 and 2.4 have significant differences. Some of these features will not work properly with a 2.3 container. Tomcat 5.5 is fine.
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1352 times.
Similar Threads
Custom Tags & UseBean Tag
jsp:useBean
Problem with using jsp:useBean
from HF page 356, Be the Container..
using jsp:useBean tag
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:52:56.