<servlet-mapping> ... </servlet-mapping> takes the name of a servlet as
defined by the <servlet>...</servlet> element, not the servlet's class.
That's what the <servlet> ... </servlet> element is for. In this case,
the jsp servlet is already defined in the global web.xml file found at
conf/web.xml right next to the server.xml file. Please don't edit this
web.xml file unless you *really* know what you are doing. Just take a
look at it to see how the default servlet and the jsp servlet are
defined. Note the separate <servlet-mapping> element. There can be
more than one of these to map a servlet to different paths.
--David
DIGLLOYD INC wrote:
David,
I'm new to programming Servlets/JSP, I didn't realize a <servlet-
mapping> could just specify a <url-pattern> an not specify a servlet
class, nor do I understand exactly what this example mapping does
(and if it does it without other side-effects).
Do you mean to use this in conjunction with a "blog.jsp" which would
then include blog.html?
Lloyd
On Mar 24, 2008, at 5:13 AM, David Smith wrote:
Here's a possibility:
Write the quick and dirty blog jsp, name it blog.html, and then add
this to your web.xml file:
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>blog.html</url-pattern>
</servlet-mapping>
The idea is to specifically map blog.html to the jsp servlet for jsp
processing. I haven't tried it, but it seems like it should work.
--David
DIGLLOYD INC wrote:
I'm converting from an Apache http system.
Thousands of my users have bookmarked
http://diglloyd.com/diglloyd/blog.html
With Apache, I symlinked blog.html to the current month's blog.
Now with Tomcat, I see warnings that enabling symlinks is a security
risk.
What is the best way to make blog.html => 2008-03-blog.html ? (eg if
March 2008 is the current blog)
I realize that I can write a one-line blog.jsp which includes the
current month's blog. But that won't help users that bookmarked
blog.html.
An http redirect works, but it seems the google search engine is not
enamored of redirects; I don't want to hurt my search ranking.
Lloyd Chambers
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]