Re: Java/TomCat How to Configure a Servlet contextPath
- From: Owen Jacobson <angrybaldguy@xxxxxxxxx>
- Date: Fri, 31 Oct 2008 12:13:12 -0700 (PDT)
On Oct 31, 2:23 pm, Rich Morey <richard.mo...@xxxxxxxxx> wrote:
Hi --
Thank you both for your quick replies.
In your example URL (aside: the words "Java" and "Class" in the URL
are bad practice), "javaApp" is the application context and
I am aware of this. I just did that for my own learning curve.
This is correct. However, if your web.xml file isn't set correctly,
this won't load. Want did you do to configure the web.xml? Can you show us?
I should say that I am just learning Java & Tomcat at this point. My
web development experience prior to this was with Delphi. When
building a Delphi web app a URL would look something like this:
http://host/library.dll/action?
In this case, the "library.dll" file could/would contain multiple
"actions" that could be invoked like this:
http://host/library.dll/action1?http://host/library.dll/action2?
etc. This would allow me to develop related functionality within a
single library. For example, I recently completed a payment processing
DLL for a client. In this case the URLs were something like this:
http://host/payment.dll/Cash?http://host/payment.dll/Check?http://host/payment.dll/CreditCard?
Each action, in this case "Cash", "Check", "CreditCard" was invoked
from within the single library, "payment.dll". I would like to
replicate this kind of configuration within Java, mostly because this
has been the methodology I have used in the past and so I "think"
along these lines.
Thanks
Rich
"TestClass" is the servlet or page identifier.
I'm not sure what you mean by the word "load" in "would load
TestClass?". "Loading a class" has a meaning different from
"displaying a page". What the URL does is identify to the app server
(e.g., Tomcat) what page you want to display, or alternatively, what
servlet you want to invoke. Loading a class is what Tomcat does, or
may do, as part of accessing the specified resource, but is by no
means what the URL signifies.
You can, for the time being, think of a .war file as a replacement for
the DLL you'd use with Delphi. In turn, the "actions" are described in
two places.
- "Active" actions - those that call server-side logic - are usually
configured in the war's web.xml descriptor (WEB-INF/web.xml), and
- "resources" - JSPs that are directly accessible, HTML pages,
images, etc, are configured by being present somewhere under the root
of the WAR file.
The configuration for web.xml should be described in any webapp
tutorial; there's one at http://www.adp-gmbh.ch/java/web_application/web_xml.html
..
-o
.
- Follow-Ups:
- Re: Java/TomCat How to Configure a Servlet contextPath
- From: Rich Morey
- Re: Java/TomCat How to Configure a Servlet contextPath
- References:
- Java/TomCat How to Configure a Servlet contextPath
- From: Rich Morey
- Re: Java/TomCat How to Configure a Servlet contextPath
- From: Mark Space
- Re: Java/TomCat How to Configure a Servlet contextPath
- From: Lew
- Re: Java/TomCat How to Configure a Servlet contextPath
- From: Rich Morey
- Java/TomCat How to Configure a Servlet contextPath
- Prev by Date: Re: making swing application to launch from desktop
- Next by Date: kosher jpgs
- Previous by thread: Re: Java/TomCat How to Configure a Servlet contextPath
- Next by thread: Re: Java/TomCat How to Configure a Servlet contextPath
- Index(es):
Relevant Pages
|