You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mauricio Tia Ni Gong Lin <li...@fua.br> on 2002/06/09 20:15:04 UTC

Using bean in JSP files

-------- Mensagem Original --------
Assunto: Using bean is JSP files
De: <li...@fua.br>
Data: Sun, June 9, 2002 2:12 pm
Para: <to...@jakarta.apache.org>

Hi all,

Is there any difference between the following code in order to
use bean?

<%@ page import="java.sql.*"%>
<jsp:useBean id="connection" class="br.fua.ppgi.ConnectionBean"
scope="session"/>

<%@ page import="java.sql.*,br.fua.ppgi.*"%>
<jsp:useBean id="connection" class="ConnectionBean" scope="session"/>


The former code (I followed the core servlets and JSP
book's idea) is doing well , but the latter code (I followed the Web
Development with JavaServer Pages book's idea) shows me an error on the
browser as:

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

Could anyone help me?

Regards,

Lin.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using bean in JSP files

Posted by James Williamson <ja...@nameonthe.net>.

Mauricio Tia Ni Gong Lin wrote:

>
> Hi all,
>
> Is there any difference between the following code in order to
> use bean?
>
> <%@ page import="java.sql.*"%>
> <jsp:useBean id="connection" class="br.fua.ppgi.ConnectionBean"
> scope="session"/>
>
> <%@ page import="java.sql.*,br.fua.ppgi.*"%>
> <jsp:useBean id="connection" class="ConnectionBean" scope="session"/>
>

The JSP 1.2 specification actually states that the class attribute should contain

the fully qualified name of the class. To quote:

The fully qualified name of the class that defines the
implementation of the object. The class name is case
sensitive.

Regards,

James Williamson
www.nameonthe.net

>
> The former code (I followed the core servlets and JSP
> book's idea) is doing well , but the latter code (I followed the Web
> Development with JavaServer Pages book's idea) shows me an error on the
> browser as:
>
> javax.servlet.ServletException: ConnectionBean
> ....
> ....
> root cause
> java.lang.InstantiationException: ConnectionBean
> ....
> ....
>
> Could anyone help me?
>
> Regards,
>
> Lin.
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>