You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by samba <sa...@kantay.com> on 2001/01/06 07:55:33 UTC

where to place xml file

hi,
I am executing an servlet on apache+tomcat and one of the classes in the
servlet needs to access an .xml file.Where do I need to place such resources
file.I tried placing it in conf directory and other directory's but could
not get the servlet executing.
Thanks

bi
samba


Apache SSL and Tomcat SSL

Posted by Farshad Gheshlaghi <fa...@enreach.com>.
Hi all,

I am using Apache(with mod_ssl) with Tomcat in the Linux environment. I have
created a certificate for Apache and also another one for Tomcat. So, I can
have Apache_ssl and also standalone Tomcat_ssl. Now, let's assume that I am
going to get some SECURE information from another machine by using both
apache_ssl and tomcat_ssl. I understand that when I send a https from apache
to tomcat the 8443 port is going to be used. But is this means that
information flow from tomcat to the other machine (and vise versa) is also
secure? If this is the case, which certificate is going to be used?

I really appreciate any help in this regard.

Thanks,
/Farshad



RE: where to place xml file

Posted by samba <sa...@kantay.com>.
Thanks for the reply but as mentioned earlier in my mail the user defined
classes in the servlet access the config.xml file and not the servlet.In
case the servlet reads the config.xml file you have the best approach I
guess.
In my case as I said I have a class as below:

	public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException,IOException{
		............//code....
		EDI850 edi850 = (EDI850)strip.readMessageObject(msgDetails, params);
		..............
	}

The class EDI850 access this file config.xml.
I have found the answer for this.We need to store the file config.xml in bin
directory of tomcat and it works fine.

samba
-----Original Message-----
From: Petr Suchomel [mailto:psuchomel@volny.cz]
Sent: Sunday, January 07, 2001 4:56 AM
To: general@jakarta.apache.org
Subject: Re: where to place xml file


It is simple

In tomcat config folder, file server.xml
 <Context path="/my-context" docBase="c:/app/myapplication" debug="0"
reloadable="false" />

/WEB-INF/web.xml
                /classes/some.class
                /lib/some.jar

full path will be

c:/app/myapplication/WEB-INF/web.xml and so on

in web.xml for servlet you can specify, but take care about xml tags order,
web.xml in tomcat 3.2 is validated !!

  <servlet>
      <servlet-name>some</servlet-name>
      <servlet-class>cz.my.someservlet</servlet-class>
        <init-param>
            <param-name>max</param-name>
            <param-value>32</param-value>
        </init-param>
        <init-param>
            <param-name>min</param-name>
            <param-value>5</param-value>
        </init-param>
        <init-param>
            <param-name>data</param-name>
            <param-value>send_it_here</param-value>
        </init-param>
    </servlet>


<!-- option mapping !! not nessesary -->
 <servlet-mapping>
  <servlet-name>some</servlet-name>
  <url-pattern>/addr/some</url-pattern>
 </servlet-mapping>

IN SERVLET
       ServletConfig config = getServletConfig();
        config.getInitParameter("max")
        config.getInitParameter("min")
        config.getInitParameter("data")

Petr


----- Original Message -----
From: samba <sa...@kantay.com>
To: <ge...@jakarta.apache.org>
Sent: Sunday, January 07, 2001 12:03 AM
Subject: RE: where to place xml file


> I call user defined classes in the servlet which in turn access a
> configuration file config.xml for few parameters.I need to know where I
can
> place this file for the servlet.
>
> When using normal java application I store it in the lib directory since I
> am running the application from the jar file in the llib directory.
> I guess I was not clear earlier.I hope this makes it clear.
>
> Thanks
> samba
>
> -----Original Message-----
> From: Petr Suchomel [mailto:psuchomel@volny.cz]
> Sent: Saturday, January 06, 2001 2:00 AM
> To: general@jakarta.apache.org
> Subject: Re: where to place xml file
>
>
> If it is your own web.xml file, you have to put it WEB-INF directory where
> is your application placed.
> But what it means that servlet needs acces to this file ?
> Petr
>
> ----- Original Message -----
> From: samba <sa...@kantay.com>
> To: <ge...@jakarta.apache.org>
> Sent: Saturday, January 06, 2001 7:55 AM
> Subject: where to place xml file
>
>
> > hi,
> > I am executing an servlet on apache+tomcat and one of the classes in the
> > servlet needs to access an .xml file.Where do I need to place such
> resources
> > file.I tried placing it in conf directory and other directory's but
could
> > not get the servlet executing.
> > Thanks
> >
> > bi
> > samba
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: general-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>




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


Re: where to place xml file

Posted by Petr Suchomel <ps...@volny.cz>.
It is simple

In tomcat config folder, file server.xml
 <Context path="/my-context" docBase="c:/app/myapplication" debug="0"
reloadable="false" />

/WEB-INF/web.xml
                /classes/some.class
                /lib/some.jar

full path will be

c:/app/myapplication/WEB-INF/web.xml and so on

in web.xml for servlet you can specify, but take care about xml tags order,
web.xml in tomcat 3.2 is validated !!

  <servlet>
      <servlet-name>some</servlet-name>
      <servlet-class>cz.my.someservlet</servlet-class>
        <init-param>
            <param-name>max</param-name>
            <param-value>32</param-value>
        </init-param>
        <init-param>
            <param-name>min</param-name>
            <param-value>5</param-value>
        </init-param>
        <init-param>
            <param-name>data</param-name>
            <param-value>send_it_here</param-value>
        </init-param>
    </servlet>


<!-- option mapping !! not nessesary -->
 <servlet-mapping>
  <servlet-name>some</servlet-name>
  <url-pattern>/addr/some</url-pattern>
 </servlet-mapping>

IN SERVLET
       ServletConfig config = getServletConfig();
        config.getInitParameter("max")
        config.getInitParameter("min")
        config.getInitParameter("data")

Petr


----- Original Message -----
From: samba <sa...@kantay.com>
To: <ge...@jakarta.apache.org>
Sent: Sunday, January 07, 2001 12:03 AM
Subject: RE: where to place xml file


> I call user defined classes in the servlet which in turn access a
> configuration file config.xml for few parameters.I need to know where I
can
> place this file for the servlet.
>
> When using normal java application I store it in the lib directory since I
> am running the application from the jar file in the llib directory.
> I guess I was not clear earlier.I hope this makes it clear.
>
> Thanks
> samba
>
> -----Original Message-----
> From: Petr Suchomel [mailto:psuchomel@volny.cz]
> Sent: Saturday, January 06, 2001 2:00 AM
> To: general@jakarta.apache.org
> Subject: Re: where to place xml file
>
>
> If it is your own web.xml file, you have to put it WEB-INF directory where
> is your application placed.
> But what it means that servlet needs acces to this file ?
> Petr
>
> ----- Original Message -----
> From: samba <sa...@kantay.com>
> To: <ge...@jakarta.apache.org>
> Sent: Saturday, January 06, 2001 7:55 AM
> Subject: where to place xml file
>
>
> > hi,
> > I am executing an servlet on apache+tomcat and one of the classes in the
> > servlet needs to access an .xml file.Where do I need to place such
> resources
> > file.I tried placing it in conf directory and other directory's but
could
> > not get the servlet executing.
> > Thanks
> >
> > bi
> > samba
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: general-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>




RE: where to place xml file

Posted by samba <sa...@kantay.com>.
I call user defined classes in the servlet which in turn access a
configuration file config.xml for few parameters.I need to know where I can
place this file for the servlet.

When using normal java application I store it in the lib directory since I
am running the application from the jar file in the llib directory.
I guess I was not clear earlier.I hope this makes it clear.

Thanks
samba

-----Original Message-----
From: Petr Suchomel [mailto:psuchomel@volny.cz]
Sent: Saturday, January 06, 2001 2:00 AM
To: general@jakarta.apache.org
Subject: Re: where to place xml file


If it is your own web.xml file, you have to put it WEB-INF directory where
is your application placed.
But what it means that servlet needs acces to this file ?
Petr

----- Original Message -----
From: samba <sa...@kantay.com>
To: <ge...@jakarta.apache.org>
Sent: Saturday, January 06, 2001 7:55 AM
Subject: where to place xml file


> hi,
> I am executing an servlet on apache+tomcat and one of the classes in the
> servlet needs to access an .xml file.Where do I need to place such
resources
> file.I tried placing it in conf directory and other directory's but could
> not get the servlet executing.
> Thanks
>
> bi
> samba
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>
>


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


Re: where to place xml file

Posted by Petr Suchomel <ps...@volny.cz>.
If it is your own web.xml file, you have to put it WEB-INF directory where
is your application placed.
But what it means that servlet needs acces to this file ?
Petr

----- Original Message -----
From: samba <sa...@kantay.com>
To: <ge...@jakarta.apache.org>
Sent: Saturday, January 06, 2001 7:55 AM
Subject: where to place xml file


> hi,
> I am executing an servlet on apache+tomcat and one of the classes in the
> servlet needs to access an .xml file.Where do I need to place such
resources
> file.I tried placing it in conf directory and other directory's but could
> not get the servlet executing.
> Thanks
>
> bi
> samba
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>
>