Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / December 2004

Tip: Looking for answers? Try searching our database.

newbie - java beans

Thread view: 
Xarky - 21 Dec 2004 15:53 GMT
Hi,
 I have type the following code

**** BeanTest.jsp ****
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>Reusing Java Beans</title>
</head>

<body>

<jsp:useBean id="test" class="Beans.SimpleBean"/>
<jsp:setProperty name="test" property="message" value="aw ras"/>

Message:
<jsp:getProperty name="test" property="message"/>

</body>
</html>

**** SimpleBean.java ****
package Beans;

public class SimpleBean
{
    private String message = "No message specified";
   
    public String getMessage()
    {
        return (message);
    } // end method getMessage
   
    public void setMessage(String message)
    {
        this.message = message;
    } // end method setMessage
   
} // end class SimpleBeans

I have placed the two files in the same location, compiled the Simple
Bean, which generated the folder Beans with SimpleBean.class in it.
Then I opened my browser and tried to run the BeanTest.jsp.... and
gave me the following errors.

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

org.apache.jasper.JasperException: /cal/BeanTest.jsp(10,0) The value
for the useBean class attribute Beans.SimpleBean is invalid.
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
    org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1227)
    org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Generator.generate(Generator.java:3272)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache
Tomcat/5.0.30 logs.

--------------------------------------------------------------------------------

Apache Tomcat/5.0.30

Can someone help me out

Thanks in Advance
Bob Kranson - 31 Dec 2004 16:23 GMT
<jsp:useBean id="test" class="Beans.SimpleBean"/>

Beans.SimpleBean should be beans.SimpleBean by naming convention.

Check that the "/> is actually " + space + />.

Is this bean registered to the server?

Easiest yet, which IDE or workbench are you using and rerun/rebuild the
sample code from the tutorial.

Just some context/syntax suggestions.

> Hi,
>  I have type the following code
[quoted text clipped - 88 lines]
>
> Thanks in Advance


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.