Re: Java/TomCat How to Configure a Servlet contextPath



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
.



Relevant Pages

  • Hibernate Config / war
    ... I have Hibernate working in an exploded directory. ... I am having a problem setting up Hibernate's configuration when it is ... wrapped up in a war file. ...
    (comp.lang.java.programmer)
  • Re: Hibernate Config / war
    ... > I am having a problem setting up Hibernate's configuration when it is ... > wrapped up in a war file. ... > stream into a String, ...
    (comp.lang.java.programmer)
  • Re: Version control for 3rd-party components: best practices
    ... Better yet, the "Delphi Configuration Manager" ... helps you define and manage such IDE ... cumbersome/error-prone/unforgiving when exposed to humans). ...
    (borland.public.delphi.non-technical)
  • Re: Future of Delphi 7.x - need official word from Borland
    ... I removed Delphi 2005 because I ... Email me if you want a base configuration for Win32 that includes ... Blog: http://jedqc.blogspot.com/ ...
    (borland.public.delphi.non-technical)
  • ANN: Delphi Configuration Manager - Version 1.6
    ... Delphi Config Manager 1.6 is now available for download from ... Delphi Configuration Manager allows you to make individual ... Delphi Configuration Manager client. ... A real Install ...
    (borland.public.delphi.thirdpartytools.general)