[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Getting this error : bean currentPageNumber not found in scope. (using Tomcat 3.3)

Posted on 2006-05-12
9
Medium Priority
?
410 Views
Last Modified: 2008-02-26
Hi all,

Where I call my bean is "<jsp:useBean id="currentPageNumber" type="java.lang.Integer" scope="request"/>"

But im getting the error:
bean currentPageNumber not found in scope.

The bean is referenced from a jar file, ive place the jar file tomcat/common/lib and in myWebApp/web-inf/lib.

Am I missing something?

Thanks
0
Comment
Question by:laptopcomputer
  • 5
  • 4
9 Comments
 
LVL 14

Expert Comment

by:boonleng
ID: 16665946
The id should be refering to the attribute name set in request.setAttirbute("AttributeName", theValue).
<jsp:useBean id="{AttributeName}" type="java.lang.Integer" scope="request"/>

If is a bean then the "type" should refer to your bean class name instead of java.lang.Integer.
<jsp:useBean id="{AttributeName}" type="{Bean Class Name}" scope="request"/>

0
 

Author Comment

by:laptopcomputer
ID: 16666036
"<jsp:useBean id="currentPageNumber" type="java.lang.Integer" scope="request"/>" is not in a bean, its actually a jsp file.

>>request.setAttirbute("AttributeName", theValue).
Is that located in the bean?
0
 
LVL 14

Expert Comment

by:boonleng
ID: 16666112
May I know currently what you want to achieve?
You trying to load a bean that set in request attibute, or initialise a bean that in your jar file.

If you want to initialise the bean then should define "class" attribute. E.g
   <jsp:useBean id="currentPageNumber" class="{Bean Class Name}"/>

hmm... but dun seem that you want to initialise a new bean...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:laptopcomputer
ID: 16666155

I want to initialise a bean that is in a jar file
0
 
LVL 14

Expert Comment

by:boonleng
ID: 16666172
Then should be as follow, use "scope" means that it will search for the bean with the define "id" in the scope(request/session/page) specified.

    <jsp:useBean id="currentPageNumber" class="{Bean Class Name}"/>
0
 
LVL 14

Expert Comment

by:boonleng
ID: 16666186
I means search for the attribute name equal to the "Id" defined in the tag in HttpServletRequest, HttpSession
:)
0
 

Author Comment

by:laptopcomputer
ID: 16666205

ok, how do I find what class currentPageNumber is in?

Thanks for the help
0
 
LVL 14

Accepted Solution

by:
boonleng earned 450 total points
ID: 16666247
You mention
> The bean is referenced from a jar file, ive place the jar file tomcat/common/lib and in myWebApp/web-inf/lib.

so the "class" of currentPageNumber should be the bean class name you want to refer to in the jar file.
0
 

Author Comment

by:laptopcomputer
ID: 16666384

i fixed that error, i was including the jar at hte top of jsp page.

Thanks anyway ;)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question