You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Anne-Marie Ternes <An...@cie.etat.lu> on 2001/04/10 16:15:01 UTC
jsp + servletbean (problem 2)
Hi again,
I've written a small JSP here, which calls a simple servletbean through
<jsp:usebean> tags. The aim is only to play around with the getProperty
and SetProperty things, and to get jsp and servlet to work together.
When I try to access the jsp, I get a strange 500 Error.
This is what I have done.
- I have added a context to server.xml:
<Context path="/javaapps"
docBase="/oas/oashome/apps/javaapps"
crossContext="true"
debug="0"
reloadable="true" >
</Context>
- I have added the following to my copied-and-cut tomcat-apache file:
Alias /javaapps "/oas/oashome/apps/javaapps"
<Directory "/oas/oashome/apps/javaapps">
Options Indexes FollowSymLinks
</Directory>
ApJServMount /javaapps/servlet /javaapps
<Location "/javaapps/WEB-INF/">
AllowOverride None
deny from all
</Location>
<Location "/javaapps/META-INF/">
AllowOverride None
deny from all
</Location>
-The directory structure:
Under /oas/oashome/apps/javaapps, I've got a subdirectory "jsp" where my
"jsp" file is, I've got a subdirectory WEB-INF/classes where my bean is
located.
- Both subdirectories are in my profile CLASSPATH, and I checked that
Tomcat also considers them to be in his classpath
If it can help you, I can post you the exact error the browser gives me,
as well as my small JSP and my also small bean. But I didn't know if I
should post them inline or as attachments?
I'd be glad if someone could give me a hint on what I'm doing wrong...
Thanx,
Anne-Marie
P.S. "No-bean" JSPs and servlets work fine.
--
=====================================
Anne-Marie Ternes
Informaticien diplômé
Centre Informatique de l'Etat
B.P. 1111
L-1011 Luxembourg
Tél: 49 925 642
E-Mail: anne-marie.ternes@cie.etat.lu
=====================================
Re: jsp + servletbean (problem 2)
Posted by Anne-Marie Ternes <An...@cie.etat.lu>.
Hi,
I solved my little problem described below, thanks to some messages I found
here!
Three things I got wrong:
- The "B" in "useBean" has to be a capital B... (arrrgghh)
- The bean classname as well as the file name has to begin with a capital
letter, i.e. DatabaseAccess.java, and class DatabaseAccess
- I've got to put a page import statement into my JSP file:
<%@ page import = "DatabaseAccess" %>
Now this works!
am
Anne-Marie Ternes wrote:
> Hi again,
>
> I've written a small JSP here, which calls a simple servletbean through
> <jsp:usebean> tags. The aim is only to play around with the getProperty
> and SetProperty things, and to get jsp and servlet to work together.
>
> When I try to access the jsp, I get a strange 500 Error.
>
> This is what I have done.
> - I have added a context to server.xml:
> <Context path="/javaapps"
> docBase="/oas/oashome/apps/javaapps"
> crossContext="true"
> debug="0"
> reloadable="true" >
> </Context>
> - I have added the following to my copied-and-cut tomcat-apache file:
> Alias /javaapps "/oas/oashome/apps/javaapps"
> <Directory "/oas/oashome/apps/javaapps">
> Options Indexes FollowSymLinks
> </Directory>
> ApJServMount /javaapps/servlet /javaapps
> <Location "/javaapps/WEB-INF/">
> AllowOverride None
> deny from all
> </Location>
> <Location "/javaapps/META-INF/">
> AllowOverride None
> deny from all
> </Location>
>
> -The directory structure:
> Under /oas/oashome/apps/javaapps, I've got a subdirectory "jsp" where my
> "jsp" file is, I've got a subdirectory WEB-INF/classes where my bean is
> located.
>
> - Both subdirectories are in my profile CLASSPATH, and I checked that
> Tomcat also considers them to be in his classpath
>
> If it can help you, I can post you the exact error the browser gives me,
> as well as my small JSP and my also small bean. But I didn't know if I
> should post them inline or as attachments?
>
> I'd be glad if someone could give me a hint on what I'm doing wrong...
>
> Thanx,
>
> Anne-Marie
>
> P.S. "No-bean" JSPs and servlets work fine.
> --
> =====================================
> Anne-Marie Ternes
>
> Informaticien diplômé
>
> Centre Informatique de l'Etat
> B.P. 1111
> L-1011 Luxembourg
>
> Tél: 49 925 642
> E-Mail: anne-marie.ternes@cie.etat.lu
> =====================================
--
=====================================
Anne-Marie Ternes
Informaticien diplômé
Centre Informatique de l'Etat
B.P. 1111
L-1011 Luxembourg
Tél: 49 925 642
E-Mail: anne-marie.ternes@cie.etat.lu
=====================================