Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:useBean tag Rules

 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Chandra, im so used to scripting, so bit shaky till i get d hang of all this jstl,el etc.
regards
Rina
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it only EL i wouldn't be able to practice on or something else also please?
thanks
regards
Riina
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic