tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: Problem with class
Date Thu, 12 Oct 2000 12:25:33 GMT
Hi,

First of all, the "import" tag works just like import in java; you can give
it a package name, so that you can use class names in your code
without specifying the package prefix. You do *not* use it to
declare all the bean classes that you use, as it seems you are trying
to do. So for example if you have a class "fr.monsite.Site", then
<%@ page import="fr.monsite.*" %> will allow you to refer to
the class as "Site" within the jsp code. Of course, it is not mandatory
to use an import, you could use the fully qualified name of your class
everywhere instead.

Secondly, you need to put the corresponding .class file in the
WEB-INF/classes subdir of your webapp, eg
yourapproot/WEB-INF/classes/fr/monsite/Site.class

And lastly, the jsp:setProperty property field should start
with a lower-case letter. eg
<jsp:setProperty name="site" property="name" value="fred" />
will generate a call to
site.setName("fred")

Note the case used above: the method is setName, but the
property is "name". This is standard java bean behaviour.

Sorry I couldn't answer in French - I'm learning, but have a 
way to go before I can talk technical in Francais....

Cheers,

Simon 


> -----Original Message-----
> From:	Cedric [SMTP:cedric@eolas.fr]
> Sent:	Thursday, October 12, 2000 2:06 PM
> To:	tomcat-user@jakarta.apache.org
> Subject:	Problem with class
> 
> Hi,
>  
> I'm a new french user of tomcat and I encours some problem with class
>  
> I write a jsp like this :
> <%@ page import="Site"%>
> <jsp:useBean id="site" scope="page" class="Site">
>      <jsp:setProperty name="site" property="Name" value="www.MonSite.fr"
> />
> </jsp:useBean>
>  
> and I get the following error in my navigator :
> 
> 
> 
> 	Error: 500
> 
> 
> 	Location: /dns/gestionGroupe2.jsp
> 
> 	try to access class Site from class
> _0002fgestionGroupe_00032_0002ejspgestionGroupe2_jsp_3 
> 
>  
> Maybe I have badly configure the server.xml file conf ???????,
>  
> Thanks
>  
> ______________
> Cedric Dumetz
> cedric@eolas.fr <mailto:cedric@eolas.fr>
> FRANCE
>  

Mime
View raw message