Erro useBean

3 respostas
juniior1993

esta dando o seguinte erro

HTTP Status 500 -

type Exception report

message

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

exception

javax.servlet.ServletException: java.lang.InstantiationException: MinhaClasse
root cause

java.lang.InstantiationException: MinhaClasse
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.

Segue os arquivos

MinhaClasse.java:
package Example;

public class MinhaClasse {


    public static void test() {
        
        System.out.println("Nada");
        
    }
    
    
    
}
index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"
        import="Example.MinhaClasse"%>
<jsp:useBean class="MinhaClasse" id="myBean" scope="page" />
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%= myBean.toString() %>
    </body>
</html>
Alguem sabe oq pode ser ?

3 Respostas

juniior1993

Ninguem ?

luiz_renato

juniior1993,

Tente implementar toString().

juniior1993

Continua com o erro…

Entao mesmo seu comentar a linah myBeam.toString e so deixar a chamada da clase no useBean ja da o erro!

Criado 20 de dezembro de 2012
Ultima resposta 20 de dez. de 2012
Respostas 3
Participantes 2