Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2007, 01:55 PM
Member
 
Join Date: Jul 2007
Posts: 1
jainpankaj15m is on a distinguished road
javaBeans with JSP
Hello everyone..
i have one problem..
i want to use javaBeans with JSP in JBuilder(Eclipse) IDE.
i hv one JSP named :
'BeanJsp.jsp' with code :

<jsp:useBean id="the" class="CalcBean"/>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
int i = 4;
int j = the.doubleIt(i);
out.print("2*4=" + j);
%>
</BODY>
</HTML>

and one JavaBean named:
'CalcBean.java' with code :

public class CalcBean {
CalcBean(){ }
public int doubleIt(int number) {
return 2 * number;
}
}

while running on Tomcat 5.5 server it is giving error:
"org.apache.jasper.JasperException: /BeanJsp.jsp(2,0) The value for the useBean class attribute CalcBean is invalid."

this problem is only with JBuilder IDE..on Gel IDE it is working..
pls solve my problem n do reply soon...
Thanx.
:: pankaj

Last edited by jainpankaj15m : 07-25-2007 at 02:01 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-25-2007, 02:15 PM
Member
 
Join Date: Jul 2007
Location: England, Bath
Posts: 47
shanePreater is on a distinguished road
This looks like it is due to the fact that tomcat can not find the CalcBean class. Where are you saving CalcBean.java?

If it is not in the default package (I.E. no package declaration at the top of CalcBean.java) then you would need to add an import to the jsp page or fully qualify the CalcBean reference (If the CalcBean file was under com/onevisionsupport/example then the useBean would need to be com.onevisionsupport.example.CalcBean).

If this doesn't help let me know also if you could provide details of the structure you are using and I will see if I can work it out for you.
__________________
Shane Preater -
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception in JavaBeans bbq Enterprise JavaBeans 2 07-04-2007 09:33 AM
javabeans? sin Enterprise JavaBeans 1 05-15-2007 07:42 AM


All times are GMT +3. The time now is 10:37 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org