1

im trying to do my first practices in JSP. I need instanciate a Java Bean using standard actions. I have the next bean:

package bean;

public class Cotizacion implements java.io.Serializable {

    private static final long serialVersionUID = 1L;
    // Some properties ...

    public Cotizacion(){
        // Nothing ...
    }
    // Accessors & toString ...
}

So, in my JSP:

<%@ page import="bean.Cotizacion" %>
<%@ page session="true" %>

// HTML
<jsp:useBean id="bean" type="bean.Cotizacion" scope="session"></jsp:useBean>

When i load the page, an exception is catched:

javax.servlet.ServletException: java.lang.InstantiationException: bean bean not found within scope

Whats wrong with my code ?

EDIT: Sory, i found the solution in this thread, i need to use the "class" attribute instead "type" for first time.

Community
  • 1
  • 1
ramiromd
  • 2,019
  • 8
  • 33
  • 62

0 Answers0