• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tell me error in code of jsp:useBean

 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to use <jsp:useBean> , what all code i have to write because i have write the code :

<jsp:useBean id="myBean" class="test1.BeanClass" scope="application">
</jsp:useBean>

then it give the following error :

E:\Program Files\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\bean_jsp.java:56: cannot resolve symbol
symbol : class BeanClass
location: class org.apache.jsp.bean_jsp
BeanClass myBean = null;

what extra should i write to meke it run , i have also cteated a BeanClass under test1.BeanClass.

Please suggest.
Thanks
Gaurav
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have also cteated a BeanClass under test1.BeanClass.

Is it in /WEB-INF/classes/test1/BeanClass.class ?
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see http://faq.javaranch.com/view?BeansNotFound
 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya , it is there in the WEB-INF\classes\test1\BeanClass , i am not able to understand that why it is not working.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did u import BeanClass in your jsp?

<%@ page import="test.BeanClass" %>
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In BeanClass.java, did you set the package to test1 ?
And is your bean public ?

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Corleone:
did u import BeanClass in your jsp?

<%@ page import="test.BeanClass" %>


Mike,
Two things:

First:
We're pleased to have you here with us in the JSP forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here


Second:
In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here. In particular, please see UseRealWords.

Abbreviations such as "ur" instead of "you are" confound language translation software which makes your posts difficult for non-English speaking members to read.

Thank you for your attention to these details.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!