You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jock Fung <jo...@yahoo.com> on 2003/10/13 19:18:29 UTC

JSP import command

Hi,

   When I use the following in the JSP using Tomcat 4.1.27, it doesn't
work,

<%@ page import="com.bcit.beans.*" %>
<jsp:useBean id="user" class="UserData" scope="session"/>

but I need to specify in the class comand the actual path, then it can
find UserData in the path. I can remove the page tag and it seems not
that useful

<jsp:useBean id="user" class="com.bcit.beans.UserData"
scope="session"/>

It seems that the 'import' does not work properly? Is it true?

Please advice.

Thanks.

Jock.



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: JSP import command

Posted by Stephan Melchior <St...@t-online.de>.
Hi Jock,

afaik, the class attribute always requires a FULL qualified classname of
the bean to construct. This is independent of the import directive.
This is the same behavior as the standard Java Class.forName(...) method.
In fact this is exact the way how the <jsp:useBean> tag is compiled!

Greetings
 Stephan


Jock Fung schrieb:

> Hi,
>
>    When I use the following in the JSP using Tomcat 4.1.27, it doesn't
> work,
>
> <%@ page import="com.bcit.beans.*" %>
> <jsp:useBean id="user" class="UserData" scope="session"/>
>
> but I need to specify in the class comand the actual path, then it can
> find UserData in the path. I can remove the page tag and it seems not
> that useful
>
> <jsp:useBean id="user" class="com.bcit.beans.UserData"
> scope="session"/>
>
> It seems that the 'import' does not work properly? Is it true?
>
> Please advice.
>
> Thanks.
>
> Jock.
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

--
Es wird immer weitergehen ---
--- Musik als Träger von Ideen



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: JSP import command

Posted by kgsat <kg...@kssnet.co.jp>.
Jock,

What u specified for class attribute of the useBean tag is the package
stucture i believe.
If it is so,then that is the way u need to specify the class name in the
tag.It is the right way of using the useBean tag.

sat
----- Original Message ----- 
From: "Jock Fung" <jo...@yahoo.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, October 14, 2003 2:18 AM
Subject: JSP import command


> Hi,
>
>    When I use the following in the JSP using Tomcat 4.1.27, it doesn't
> work,
>
> <%@ page import="com.bcit.beans.*" %>
> <jsp:useBean id="user" class="UserData" scope="session"/>
>
> but I need to specify in the class comand the actual path, then it can
> find UserData in the path. I can remove the page tag and it seems not
> that useful
>
> <jsp:useBean id="user" class="com.bcit.beans.UserData"
> scope="session"/>
>
> It seems that the 'import' does not work properly? Is it true?
>
> Please advice.
>
> Thanks.
>
> Jock.
>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org