You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Seidl <sm...@worldnet.att.net> on 2002/06/14 03:34:22 UTC

web.xml how-to

Can someone give me a good resource on how to create the web.xml file
for a web application using servlets?
 
Thanks
Scott

Re: web.xml how-to

Posted by Eric Armstrong <er...@sun.com>.
Scott Seidl wrote:

> Can someone give me a good resource on how to create the web.xml file
> for a web application using servlets?
>
> Thanks
> Scott

See docs/tomcat/appdev/web.xml.txt

It's a prototype file with a lot of commentary.





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: error 404

Posted by Joseph Molnar <jo...@hotmail.com>.
Hi Johnny. I wrote an article that covers a bunch of things, including,
having pieces running under an SSL (where Apache is handling it for you). I
am not exactly sure of your setup, but feel free to have a look. I hope you
find it useful.

http://www.codesta.com/knowledge/technical/tomcat_warp_apache/page_01.jsp

-----------------------------
Joe Molnar
http://www.codesta.com/

----- Original Message -----
From: "Johnny" <ke...@mimos.my>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Sunday, June 16, 2002 6:33 PM
Subject: error 404


>
>  to all the tomcat users,
>
>  currently, my tomcat is integrated with apache, and running with mod_ssl.
> after followed the instruction from
> http://www.galatea.com/flashguides/apache-tomcat-4-unix.xml, i can see the
> examples directory from the browser. however, when i created my own
> directory under /usr/local/tomcat/webapps/, i received the error 404.  so
i
> think i must miss out the configuration process.
>
>  i tried to refer to the tomcat documentation for application developer's
> guide, but i don't see any guidelines which can help me to solve the error
> 404 problem.  do you know where can i find out the site where can help me
to
> solve this problem?
>
>  regards,
>  johnny.
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how to set environment variable in tomcat?

Posted by Jacob Kjome <ho...@visi.com>.
Hello Johnny,

Use <context-param>'s in your web.xml.

For instance:

    <context-param>
        <param-name>databaseUrl</param-name>
        <param-value>jdbc:postgresql:msrd</param-value>
    </context-param>


Context parameters can be added to your web.xml near the top of the
file after <display-name> and <description>

You can reference your parameters by doing this:

String myparameter = (String) context.getInitParameter("databaseUrl");

You can also use parameters for specific servlets:

<servlet>
        <servlet-name>log4j-init</servlet-name>
        <servlet-class>org.enhydra.barracuda.core.util.logging.Log4jInit</servlet-class>
        <init-param>
            <!-- relative path to config file within current webapp -->
            <param-name>log4j-config</param-name>
            <param-value>WEB-INF/log4j.xml</param-value>
        </init-param>
</servlet>

And retrieve that by using the following in the init() method of said
servlet:

String configPath = getInitParameter("log4j-init");


You can also retrieve stuff from JNDI using Context Resources which
are specified in the server.xml.  I'll let you read up on that in the
Tomcat docs.

Does that help?


Jake


Monday, June 24, 2002, 4:26:51 AM, you wrote:


J>  to all the tomcat users,

J>  if i want to set my own environment variable for my application running in
J> tomcat, what should i do? do i have to edit the server.xml?

J>  in jserv, we using "ApJServEnvVar" for defining the environment variable in
J> jserv.conf, so how about tomcat?

J>  regards
J>  johnny.



J> --
J> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
J> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


how to set environment variable in tomcat?

Posted by Johnny <ke...@mimos.my>.
 to all the tomcat users,

 if i want to set my own environment variable for my application running in
tomcat, what should i do? do i have to edit the server.xml?

 in jserv, we using "ApJServEnvVar" for defining the environment variable in
jserv.conf, so how about tomcat?

 regards
 johnny.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


error 404

Posted by Johnny <ke...@mimos.my>.
 to all the tomcat users,

 currently, my tomcat is integrated with apache, and running with mod_ssl.
after followed the instruction from
http://www.galatea.com/flashguides/apache-tomcat-4-unix.xml, i can see the
examples directory from the browser. however, when i created my own
directory under /usr/local/tomcat/webapps/, i received the error 404.  so i
think i must miss out the configuration process.

 i tried to refer to the tomcat documentation for application developer's
guide, but i don't see any guidelines which can help me to solve the error
404 problem.  do you know where can i find out the site where can help me to
solve this problem?

 regards,
 johnny.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: web.xml how-to

Posted by Josh Fenlason <jf...@ptc.com>.
http://developer.java.sun.com/developer/Books/javaserverpages/servlets_javas
erver/servlets_javaserver05.pdf


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: web.xml how-to

Posted by Markus Kirsten <ma...@iped.vxu.se>.
Check the DTD for web.xml or RTFM. http://jakarta.apache.org/tomcat


Markus


On fredag, juni 14, 2002, at 03:34 , Scott Seidl wrote:

> Can someone give me a good resource on how to create the web.xml file
> for a web application using servlets?
>
> Thanks
> Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>