Re: trouble with static html using 5.5.2

2004-10-18 Thread David Smith
I second the advice on reading the spec.  Here's a link to it (version 2.4):
http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html
--David
QM wrote:
On Sun, Oct 17, 2004 at 12:22:39PM -0700, andy davidson wrote:
: http://localhost:8080/baz works as expected
Probably not.  Read on:
: 
: baz
:  /
: 
That's probably not the pattern you meant; it will fire the "baz"
servlet for *any* request to your webapp that isn't otherwise mapped.
It's known as the "default servlet."
Try it: request
http://{your server}/baz/something
http://{your server}/baz/something/else
... ad infinitum (and ad nauseam)...
: My guess is I need some sort of url-pattern that maps
: /baz/* to /baz/*. What would the syntax be? this is
: not a servlet thing? where can I find a dtd for
: web.xml?
There's no need to guess: all of this and more is explained in the
servlet spec (and any worthwhile servlet text), as I mentioned in my
previous message. ;)  For example, your mapping question is explained in
"SRV.11.2 Specification of Mappings."
Here's a hint: your web.xml should at least include a prologue, which
specifies the servlet spec 2.3 DTD (for Tomcat 4.x and earlier) or the
2.4 schema (for Tomcat 5.x and later).
-QM
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: trouble with static html using 5.5.2

2004-10-17 Thread QM
On Sun, Oct 17, 2004 at 12:22:39PM -0700, andy davidson wrote:
: http://localhost:8080/baz works as expected

Probably not.  Read on:


: 
: baz
:  /
: 

That's probably not the pattern you meant; it will fire the "baz"
servlet for *any* request to your webapp that isn't otherwise mapped.
It's known as the "default servlet."

Try it: request
http://{your server}/baz/something
http://{your server}/baz/something/else

... ad infinitum (and ad nauseam)...


: My guess is I need some sort of url-pattern that maps
: /baz/* to /baz/*. What would the syntax be? this is
: not a servlet thing? where can I find a dtd for
: web.xml?

There's no need to guess: all of this and more is explained in the
servlet spec (and any worthwhile servlet text), as I mentioned in my
previous message. ;)  For example, your mapping question is explained in
"SRV.11.2 Specification of Mappings."

Here's a hint: your web.xml should at least include a prologue, which
specifies the servlet spec 2.3 DTD (for Tomcat 4.x and earlier) or the
2.4 schema (for Tomcat 5.x and later).


-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: trouble with static html using 5.5.2

2004-10-17 Thread andy davidson
please see my comments bellow

thanks

andy

--- QM <[EMAIL PROTECTED]> wrote:

> On Sun, Oct 17, 2004 at 09:23:09AM -0700, andy
> davidson wrote:


> 
> : Here is my test. I created servlet
> foo.bar.bazServlet.
> : I installed it under webapps/baz. I created
> 
> : tags in webapps/baz/WEB-INF/web.xml
> 

http://localhost:8080/baz works as expected

> What about  tags?  Those are
> required to map the
> servlet class to a (context-relative) URI.
> 
> 
> : http://localhost:8080/baz/test.html causes my
> servlet
> : to run? Do I have to create some sort of mapping
> entry
> : in webapps/bas/WEB-INF/web.xml for html to work?
> 



here is my web.xml file. What am I missing?



baz
   
foo.bar.bazServlet



baz
 /




My guess is I need some sort of url-pattern that maps
/baz/* to /baz/*. What would the syntax be? this is
not a servlet thing? where can I find a dtd for
web.xml?

thanks andy









__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: trouble with static html using 5.5.2

2004-10-17 Thread QM
On Sun, Oct 17, 2004 at 09:23:09AM -0700, andy davidson wrote:
: I just installed the binary release of 5.5.2. do I
: have to change something in a config file to so that
: tomcat can server up html?

Not at all, as long as the context (webapp) has properly deployed.


: Here is my test. I created servlet foo.bar.bazServlet.
: I installed it under webapps/baz. I created 
: tags in webapps/baz/WEB-INF/web.xml

What about  tags?  Those are required to map the
servlet class to a (context-relative) URI.


: http://localhost:8080/baz/test.html causes my servlet
: to run? Do I have to create some sort of mapping entry
: in webapps/bas/WEB-INF/web.xml for html to work?

See above.


: my servlet generates a image tag as follows
: 
: i have webapps/bas/images/baz.gif installed how ever
: this image is never loaded into my browser? Do I have
: to create some sort of mapping entry in
: webapps/bas/WEB-INF/web.xml for html to work?

Avoid using relative paths from a servlet.  The spec doesn't mandate how
a servlet's relative path is handled, since a servlet is a virtual
entity.


A thorough review of the servlet spec (available at java.sun.com) will
provide more insight, as should several introductory J2EE/servlet texts.

If you use JSPs instead of servlets for your presentation content, you
can use a special JSTL tag to reference context-relative links, images,
and other static content.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]