Results 1 to 3 of 3
  1. #1
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default Description the server encountered an internal error

    Hi,
    I have a problem with the java beans and I can't resolve it

    my code is:
    javabean.jsp

    Java Code:
    <html>
    <head>
    <title>JavaBean example</title>
    </head>
    <body>
    <jsp:useBean id="m" scope="page" class="Message" />
    <&#37;m.showMessage("hi world");%>
    </body>
    </html>
    I'm using tomcat 6.10.0 and this is the directory tree


    webapps
    practice
    jsp
    javabean.jsp
    WEB-INF
    classes
    Message.class


    this is the bean

    Java Code:
    public class Message
    {
     private String Message;
    
     public Message(String Message)
     {
      this.Message= new String(Message);
     }
     
     public void showMessage()
     {
      System.out.println(Message);
     }
    }
    and the exception is:
    Java Code:
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception 
    
    org.apache.jasper.JasperException: /jsp/javabean.jsp(6,0) The value for the useBean class attribute Mensaje is invalid.
    	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
    	org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200)
    	org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1155)
    	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
    	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
    	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
    	org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
    	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
    	org.apache.jasper.compiler.Generator.generate(Generator.java:3394)
    	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
    	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    
    
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.
    what is the problem????
    any ideas?

  2. #2
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    Default

    According to the error you can't use the Message class with this tag.

  3. #3
    Ed
    Ed is offline Senior Member
    Join Date
    Jun 2007
    Posts
    110
    Rep Power
    0

    Default

    I think that the problem is in the constructor:
    try this
    Java Code:
    package version01;
    
    public class Message
    {
        private String message;
    
        public void Message(String message)
        {
            this.message= new String(message);
        }
        
        public String getMessage()
        {
            return message;
        }
    }
    javabean.jsp

    Java Code:
            <jsp:useBean id="m" scope="page" class="version01.Message" />
            <&#37; m.setMessage("Hello"); %>
            <%=m.getMessage()%>

Similar Threads

  1. Replies: 28
    Last Post: 10-26-2010, 04:39 AM
  2. Replies: 2
    Last Post: 07-15-2008, 06:11 PM
  3. Tomcat Server : Error filterStart
    By kasipandian in forum Web Frameworks
    Replies: 0
    Last Post: 03-30-2008, 03:50 PM
  4. Eclipse's internal Tomcat
    By vadimf in forum Eclipse
    Replies: 0
    Last Post: 02-14-2008, 09:37 AM
  5. an internal error occurred during refresh
    By christina in forum Eclipse
    Replies: 1
    Last Post: 08-06-2007, 09:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •