tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Peters" <Ge...@logic.bm>
Subject <context-param>
Date Wed, 15 Jan 2003 14:19:49 GMT
Yoav (or anyone else that can help me) - I made the changes to my web.xml file as recommended.
Two questions:
1) do I need a seperate <context-param> tag for each context parameter, or can I put
them all in the same block?
2) where is the best place to call "getServletContext().getInitParameter("driver")" within
a servlet? In the init() method? Or on the fly, for example at the start of the doGet() method?

Thanks again, I appreciate the help!!

Geoff

-----Original Message-----
From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
Sent: Monday, January 13, 2003 5:22 PM
To: Tomcat Users List
Subject: RE: Can't find servlet


Hi,
I didn't read previous messages in your thread, so my answer may be
incorrect / out of context... Why are you repeating all the init-params
that are the same, such as the driver?  It's better practice to have
just one context-param for this.  Every servlet can then get it by doing
getServletContext().getInitParameter("driver");

You don't need to declare your servlets in $CATALINA_HOME/conf/web.xml,
only in your own webapp's web.xml.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Geoff Peters [mailto:Geoff@logic.bm]
>Sent: Monday, January 13, 2003 4:19 PM
>To: Tomcat Users List
>Subject: RE: Can't find servlet
>
>John - You solved another one of my problems that I wasn't even sure
that I
>had! (did that make sense??) If I uncomment that servlet-mapping block
for
>the invoker my servlet works, if not, my servlet throws the "servlet
not
>available" error. The funny thing is I have declared all of my servlets
in
>my application web.xml, do I need to define these in the /conf/web.xml
as
>well?
>
>Here is my application web.xml, am I missing anything?
>
>THANKS!!!!!!!!!!!
>
>Geoff
>
>
><?xml version="1.0" encoding="ISO-8859-1"?>
>
><!DOCTYPE web-app
>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>
><web-app>
>
><display-name>iFax Development</display-name>
>  <description>
>    iFax Development
>  </description>
>
>	<servlet>
>
>		<servlet-name>send</servlet-name>
>		<display-name>IfaxSend</display-name>
>		<servlet-class>IfaxSend</servlet-class>
>		<init-param>
>			<param-name>driver</param-name>
>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>		</init-param>
>		<init-param>
>		        <param-name>uploadDir</param-name>
>		        <param-value>d:\Work_Files\jakarta-tomcat-
>4.1.18\webapps\IfaxSend\temp</param-value>
>        	</init-param>
>        	<init-param>
>		        <param-name>odbc</param-name>
>		        <param-value>jdbc:odbc:replixdb</param-value>
>        	</init-param>
>        	<init-param>
>		        <param-name>dbUser</param-name>
>		        <param-value>user</param-value>
>        	</init-param>
>        	<init-param>
>		        <param-name>dbPass</param-name>
>		        <param-value>pass</param-value>
>        	</init-param>
>
>	</servlet>
>
>	<servlet>
>
>		<servlet-name>userdetails</servlet-name>
>		<display-name>IfaxUserDetails</display-name>
>		<servlet-class>IfaxUserDetails</servlet-class>
>		<init-param>
>			<param-name>driver</param-name>
>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>		</init-param>
>		<init-param>
>			<param-name>odbc</param-name>
>			<param-value>jdbc:odbc:replixdb</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbUser</param-name>
>			<param-value>user</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbPass</param-name>
>			<param-value>pass</param-value>
>        	</init-param>
>
>
>	</servlet>
>
>	<servlet>
>
>		<servlet-name>onefax</servlet-name>
>		<display-name>IfaxOneFax</display-name>
>		<servlet-class>IfaxOneFax</servlet-class>
>		<init-param>
>			<param-name>driver</param-name>
>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>		</init-param>
>		<init-param>
>			<param-name>odbc</param-name>
>			<param-value>jdbc:odbc:replixdb</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbUser</param-name>
>			<param-value>user</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbPass</param-name>
>			<param-value>pass</param-value>
>        	</init-param>
>		<init-param>
>			<param-name>faxPath</param-name>
>
<param-value>c:\\Softlinx\\ReplixServer\\spool\\</param-
>value>
>		</init-param>
>		<init-param>
>			<param-name>uploadDir</param-name>
>			<param-value>d:\Work_Files\jakarta-tomcat-
>4.1.18\webapps\IfaxSend\temp</param-value>
>        	</init-param>
>
>
>	</servlet>
>
>	<servlet>
>
>		<servlet-name>onerecvfax</servlet-name>
>		<display-name>IfaxOneRecvFax</display-name>
>		<servlet-class>IfaxOneRecvFax</servlet-class>
>		<init-param>
>			<param-name>driver</param-name>
>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>		</init-param>
>		<init-param>
>			<param-name>odbc</param-name>
>			<param-value>jdbc:odbc:replixdb</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbUser</param-name>
>			<param-value>user</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbPass</param-name>
>			<param-value>pass</param-value>
>        	</init-param>
>		<init-param>
>			<param-name>faxPath</param-name>
>
<param-value>c:\\Softlinx\\ReplixServer\\spool\\</param-
>value>
>		</init-param>
>
>
>	</servlet>
>
>	<servlet>
>
>		<servlet-name>preferences</servlet-name>
>		<display-name>IfaxPreferences</display-name>
>		<servlet-class>IfaxPreferences</servlet-class>
>		<init-param>
>			<param-name>driver</param-name>
>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>		</init-param>
>		<init-param>
>			<param-name>odbc</param-name>
>			<param-value>jdbc:odbc:replixdb</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbUser</param-name>
>			<param-value>user</param-value>
>		</init-param>
>		<init-param>
>			<param-name>dbPass</param-name>
>			<param-value>pass</param-value>
>        	</init-param>
>
>	</servlet>
>
>	<servlet>
>
>			<servlet-name>attach</servlet-name>
>			<display-name>IfaxAttach</display-name>
>			<servlet-class>IfaxAttach</servlet-class>
>
>		<init-param>
>			<param-name>driver</param-name>
>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>		</init-param>
>
>
>	</servlet>
>
>	<servlet>
>
>				<servlet-name>query</servlet-name>
>				<display-name>IfaxQuery</display-name>
>				<servlet-class>IfaxQuery</servlet-class>
>
>			<init-param>
>				<param-name>driver</param-name>
>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-
>value>
>			</init-param>
>
>			<init-param>
>		        <param-name>odbc</param-name>
>		        <param-value>jdbc:odbc:replixdb</param-value>
>			</init-param>
>			<init-param>
>				<param-name>dbUser</param-name>
>				<param-value>user</param-value>
>			</init-param>
>			<init-param>
>				<param-name>dbPass</param-name>
>				<param-value>pass</param-value>
>			</init-param>
>	</servlet>
>	<servlet>
>
>
<servlet-name>queryrecv</servlet-name>
>
<display-name>IfaxQueryReceive</display-name>
>
<servlet-class>IfaxQueryReceive</servlet-
>class>
>
>				<init-param>
>					<param-name>driver</param-name>
>					<param-
>value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>				</init-param>
>				<init-param>
>
<param-name>odbc</param-name>
>
<param-value>jdbc:odbc:replixdb</param-
>value>
>					</init-param>
>					<init-param>
>
<param-name>dbUser</param-name>
>
<param-value>user</param-value>
>					</init-param>
>					<init-param>
>
<param-name>dbPass</param-name>
>
<param-value>pass</param-value>
>        			</init-param>
>
>
>	</servlet>
>
>	<servlet>
>
>
<servlet-name>viewfax</servlet-name>
>
<display-name>IfaxViewFax</display-name>
>
<servlet-class>IfaxViewFax</servlet-class>
>
>				<init-param>
>
<param-name>realPath</param-name>
>					<param-
>value>c:/softlinx/replixserver/spool/</param-value>
>				</init-param>
>			<init-param>
>					<param-name>odbc</param-name>
>
<param-value>jdbc:odbc:replixdb</param-value>
>				</init-param>
>				<init-param>
>					<param-name>dbUser</param-name>
>					<param-value>user</param-value>
>				</init-param>
>				<init-param>
>					<param-name>dbPass</param-name>
>					<param-value>pass</param-value>
>        	</init-param>
>
>	</servlet>
>	<servlet>
>
>
<servlet-name>downloads</servlet-name>
>
<display-name>IfaxDownloads</display-
>name>
>
<servlet-class>IfaxDownloads</servlet-
>class>
>
>			<init-param>
>
<param-name>driver</param-name>
>						<param-
>value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
>			</init-param>
>			<init-param>
>				<param-name>odbc</param-name>
>
<param-value>jdbc:odbc:replixdb</param-value>
>			</init-param>
>			<init-param>
>				<param-name>dbUser</param-name>
>				<param-value>user</param-value>
>			</init-param>
>			<init-param>
>				<param-name>dbPass</param-name>
>				<param-value>pass</param-value>
>        	</init-param>
>
>
>	</servlet>
>
>	<servlet-mapping>
>
>	<servlet-name>viewfax</servlet-name>
>	<url-pattern>/view/faxes/*</url-pattern>
>
>	</servlet-mapping>
>
>	<session-config>
>	      <session-timeout>20</session-timeout>    <!-- Session
timeout
>set to 20 minutes can change as needed -->
>    	</session-config>
>
>
><error-page>
>
>
><exception-type>javax.servlet.UnavailableException</exception-type>
><location>/exception.html</location>
>
></error-page>
><security-constraint>
>	    <display-name>Ifax</display-name>
>
>	    <web-resource-collection>
>	      <web-resource-name>The Entire Web
Application</web-resource-
>name>
>	      <url-pattern>/*</url-pattern>
>	    </web-resource-collection>
>	    <auth-constraint>
>	      <role-name>standard</role-name>
>	      <role-name>manager</role-name>
>	    </auth-constraint>
>
></security-constraint>
>
><login-config>
>	    	    <auth-method>BASIC</auth-method>
>	    	    <realm-name>Ifax</realm-name>
></login-config>
><security-role>
>	<description>standard</description>
>	<role-name>standard</role-name>
></security-role>
>
><security-role>
>	<description>manager</description>
>	<role-name>manager</role-name>
></security-role>
>
>
></web-app>
>
>
>
>
>
>-----Original Message-----
>From: Turner, John [mailto:JTurner@AAS.com]
>Sent: Monday, January 13, 2003 4:55 PM
>To: 'Tomcat Users List'
>Subject: RE: Can't find servlet
>
>
>
>In 4.1.12 and up, the default invoker servlet is disabled by default
for
>security reasons.  You have to enable it if you aren't going to
explicitly
>declare your servlet in web.xml.
>
>This should be in your release notes:
>
>------------------------
> Enabling invoker servlet:
>------------------------
>
>Starting with Tomcat 4.1.12, the invoker servlet is no longer available
by
>default in all webapp. Enabling it for all webapps is possible by
editing
>$CATALINA_HOME/conf/web.xml to uncomment the "/servlet/*"
servlet-mapping
>definition.
>
>Using the invoker servlet in a production environment is not
recommended
>and
>is unsupported.
>
>More info:
>http://www.mail-archive.com/announcements@jakarta.apache.org/msg00122.h
tml
>
>John
>
>> -----Original Message-----
>> From: David Durst [mailto:ddurst@larubber.com]
>> Sent: Monday, January 13, 2003 4:24 PM
>> To: tomcat-user@jakarta.apache.org
>> Subject: RE: Can't find servlet
>>
>>
>> >
>> > What's your web.xml entry for that servlet?
>> >
>> > John
>> I suspect that is the issue cause there i non :)
>> I am migrating from 4.0 and 4.0 didn't seem to need one.
>>
>> What should it be for just a basic servlet???
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <mailto:tomcat-user-help@jakarta.apache.org>
>>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-
>help@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-
>help@jakarta.apache.org>


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


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


Mime
View raw message