• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP +Bean/EJB

 
james_deshpande
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am storing my bean in classes of java web server ,
other code is:
<jsp:useBean id="SimpleBean1" class="SimpleBean1" />
<jsp:setProperty name="SimpleBean1"
property="message"
value="Hello WWW" />

<H1>Message: <I>
<jsp:getProperty name="SimpleBean1" property="message" />
</I></H1>
I AM GETTING ERROR:Class pagecompile.jsp.SimpleBean1 not found in type declaration
HOW COME ERROR OCCURES?
THE SAME ERROR I AM GETTING FOR EJB ALSO
 
Saran Vel
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Its better to store your beans in a package and give the full path of the bean class file while declaring..
for example:
store u'r simplebean in a package com.test.SampleBean1
and while declaring use this full path.
Make sure that the bean class files r in the weblogic classpath..
Saran
 
james_deshpande
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI BHIDU(FRIEND),
I HAVE BEANS IN A FOLDER OF TOMCAT/WEBAPPS.
WHEN I TRY TO ACCESS BEAN IN JSP I GET ERROR THAT BEAN NOT FOUND.
DO I NEED TO SET CLASS PATH OF BEAN??
PLZ LEMME KNOW EXACT STEPS OF USING BEAN:
WHERE TO STORE THEN WHAT??
THEN JSP:USEBEAN ETC.
 
raghavan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi James..
Pls Check whether you have imported SimpleBean1.class in this jsp page.that is before using useBean Tag. u will be writing page language="java" and then import ="java..." like wise u have import this SimpleBean class also.in your case i will like
TOMCAT/WEBAPPS/SimpleBean1.class
try this
 
faisal mahmood
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can place them in the lib directory for it to be automatically included in the classpath. You will still need the import statement unless it is in the root directory of the classpath.
Faisal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic