Hi Arno,
thanks a lot for your help! You were right, in every point! (normally ;-) it should
run..)
Thanks too for that link to the jndi docu.
With that import I got the allmost perfect stage to read the variable from server.xml
or web.xml.
BUT my class cannot continue with that entry because I get "/home/inovit/inorms/"
instead of
/home/inovit/inorms/.
That means, if I insert manually the value it works fine, but don't if it was read
from server.xml.
Than I tryed to ommit the "" in server.xml and/or web.xml. Bad idea, I think!
The result is catastrophical - I'm in a black hole - I cann't start tomcat with any
kind of <env>
directive, just without.
I don't understand it anymore! Maybe it's very simple, I don't know...
I send the relevant part of the jsp and inserted with ==> what I can see in the
generated html.
Maybe you have an idea, would be very, very happy!
Thx a lot, Sunny
stausrf.jsp
...
<%
inovit.webadmin.InterimApp ia = new inovit.webadmin.InterimApp();
Context ctx = null;
Object oval = "";
String sval = "";
try { ctx = new InitialContext(); }
catch (NamingException e) {}
try { oval = ctx.lookup("java:/comp/env/inobase"); }
catch (NamingException e) {}
sval = oval.toString();
if (sval.equals("")) {sval="no path"; }
%>
oval = <%= oval%> ==> "/home/inovit/inorms/"
sval = <%= sval%> ==> "/home/inovit/inorms/"
<% String mval= "/home/inovit/inorms/"; %>
mval = <%= mval%> ==> /home/inovit/inorms/
StringCompare <%= mval.compareTo(sval) %> ==> 13
<%= ia.getString("inoarchiv.taillogw 1", mval) %> ==> ok
<%= ia.getString("inoarchiv.taillogw 1", sval) %> ==> not ok
-------------------------------------------
web.xml:
...
<env-entry>
<env-entry-name>inobase</env-entry-name>
<env-entry-value>/home/inovit/inorms/</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
-------------------------------------------
server.xml:
...
<!-- WebAdmin Context -->
<Context path="/webadmin" docBase="webadmin" debug="0"
reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_webadmin_log." suffix=".txt"
timestamp="true"/>
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Environment name="inovit" type="java.lang.String"
value="/home/inovit/inorms/">
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
</Context>
-------------------------------------------
Arnaud H�ritier schrieb:
> Context, InitialContext, NamingException are classes from the package javax.naming.*
>
> let's see :
> http://java.sun.com/products/jndi/1.2/javadoc/index.html
>
> So put <%@ page import="javax.naming.*" %> in your JSP page and all will work
>correctly (normally ;-) )
>
> Arno
>
> > -----Message d'origine-----
> > De: Sunhild Copony [SMTP:[EMAIL PROTECTED]]
> > Date: jeudi 29 novembre 2001 11:45
> > �: Tomcat Users List
> > Objet: Re: Class in org.apache.jsp not found - please help!!
> >
> > Hi Arno,
> > thanks a lot for your quick reply!
> >
> > What do you mean exacly?
> >
> > I tryed in the jsp
> > <%@ page import="org.apache.jsp.*" %>
> > but got the same error...
> > Maybe you mean something else?
> >
> > Here is my complete server.xml, web.xml, and jsp.
> > I hope you find out whats wrong, I cann't see anything!
> >
> > Tx, Sunny
> >
> > WEB-INF/web.xml :
> > ...
> > <env-entry>
> > <env-entry-name>inobase</env-entry-name>
> > <env-entry-value>"/home/inovit/inorms"</env-entry-value>
> > <env-entry-type>java.lang.String</env-entry-type>
> > </env-entry>
> >
> > server.xml, in my context section :
> > ...
> > <Environment name="inobase" type="java.lang.String"
> > value="/home/inovit/inorms"/>
> >
> > >From a jsp I want to read this variable and pass it to a class.
> >
> > jsp:
> > <%
> > inovit.webadmin.InterimApp ia = new inovit.webadmin.InterimApp();
> > org.apache.jsp.Context ctx = null;
> > String value = "" ;
> > try { ctx = new org.apache.jsp.InitialContext(); }
> > catch (org.apache.jsp.NamingException e) {value = "no ctx";}
> > if (!value.equals("no ctx"))
> > try { value = ctx.lookup("java:/comp/env/inobase"); }
> > catch (org.apache.jsp.NamingException e) {value = "no path";}
> > %>
> >
> > another try:
> > <%
> > inovit.webadmin.InterimApp ia = new inovit.webadmin.InterimApp();
> > Context ctx = null;
> > String value = "" ;
> > try { ctx = new InitialContext(); }
> > catch (NamingException e) {value = "no ctx";}
> > if (!value.equals("no ctx"))
> > try { value = ctx.lookup("java:/comp/env/inobase"); }
> > catch (NamingException e) {value = "no path";}
> > %>
> >
> > I allways get the same error:
> >
> > A Servlet Exception Has Occurred
> > org.apache.jasper.JasperException: Unable to compile class for JSP
> >
> > An error occured between lines: 50 and 59 in the jsp file:
> > /inopacs/statusrf.jsp
> > Generated servlet error:
> > /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:60:
> > Class org.apache.jsp.Context not found.
> > Context ctx = null;
> > ^
> > An error occured between lines: 50 and 59 in the jsp file:
> > /inopacs/statusrf.jsp
> > Generated servlet error:
> > /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:62:
> > Class org.apache.jsp.InitialContext not found.
> > try { ctx = new InitialContext(); }
> > ^
> > An error occured between lines: 50 and 59 in the jsp file:
> > /inopacs/statusrf.jsp
> > Generated servlet error:
> > /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:63:
> > Class org.apache.jsp.NamingException not found.
> > catch (NamingException e) {value = "no ctx";}
> > ^
> > An error occured between lines: 50 and 59 in the jsp file:
> > /inopacs/statusrf.jsp
> > Generated servlet error:
> > /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:66:
> > Class org.apache.jsp.NamingException not found.
> > catch (NamingException e) {value = "no path";}
> > ^
> > 4 errors
> >
> >
> > Arnaud H�ritier schrieb:
> >
> > > The package org.apache.jsp is a virtual package.
> > > This package is used to generate servlet sources from JSP pages.
> > > All classes generated under TC/work/.... belong by default to this package.
> > > I think that you need to add the import of the Context class in the JSP page
>which uses it.
> > >
> > > Arno
> > >
> > > > -----Message d'origine-----
> > > > De: Sunhild Copony [SMTP:[EMAIL PROTECTED]]
> > > > Date: jeudi 29 novembre 2001 10:27
> > > > �: [EMAIL PROTECTED]
> > > > Objet: Class in org.apache.jsp not found - please help!!
> > > >
> > > > Hi,
> > > >
> > > > I'm using Tomcat 4.0b rc1 on Solaris and J2SDK 1.3.1.
> > > >
> > > > Where can I find org.apache.jsp? I searched the complete jars, but
> > > > didn't found it...
> > > > I want to use the environment settings in server.xml, and than use the
> > > > variable in my jsp, but get the error:
> > > >
> > > > Class org.apache.jsp.Context not found.
> > > > Context ctx = null;
> > > > ^
> > > >
> > > > Could you please help me!
> > > > Thanks a lot,
> > > > Sunny
> > > >
> > > >
> > > > --
> > > > To unsubscribe: <mailto:[EMAIL PROTECTED]>
> > > > For additional commands: <mailto:[EMAIL PROTECTED]>
> > > > Troubles with the list: <mailto:[EMAIL PROTECTED]>
> > >
> > > --
> > > To unsubscribe: <mailto:[EMAIL PROTECTED]>
> > > For additional commands: <mailto:[EMAIL PROTECTED]>
> > > Troubles with the list: <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe: <mailto:[EMAIL PROTECTED]>
> > For additional commands: <mailto:[EMAIL PROTECTED]>
> > Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe: <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>