You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Fabian Sommer <fa...@web.de> on 2002/03/25 11:27:32 UTC
Problem accessing servlets
Hello!
I try to access a self-written http-servlet named Seminar02.class.
I have created a new directory tree in the tomcat/webapps directory,
named Seminar. I have added /Seminar/Web-Inf/class directory and created
a web.xml-file in Web-Inf. I have put my class-file in the class directory.
Else i added following lines in server.xml in the tomcat-rootdirectory:
<!-- Tomcat Seminar Applikation Context -->
<Context path="/seminar" docBase="Seminar"
debug="0" reloadable="true"/>
I thought this should be enough to point my local tomcat installation to
the Seminar-directory, and if i try to access "localhost:8080/seminar" i
get the content of my Seminar-directory without the Web-Inf directory.
This is my web.xml file in the /Seminar/Web-Inf directory:
------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- General description of your web application -->
<display-name>Seminare02</display-name>
<description>
This is version 0.4 of an application to perform
wild jdbc-mysql tasks.
</description>
<context-param>
<param-name>webmaster</param-name>
<param-value>myname@web.de</param-value>
<description>
The EMAIL address of the developer to whom questions
and comments about this application should be addressed.
</description>
</context-param>
<servlet>
<servlet-name>Seminar02</servlet-name>
<description>
This servlet plays the "controller" role
</description>
<servlet-class>Seminar02</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Seminar02</servlet-name>
<url-pattern>/Seminar/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Seminar02</servlet-name>
<url-pattern>/Seminar02</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Seminar02</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout> <!-- 30 minutes -->
</session-config>
</web-app>
------------------------------------------------------------
As you can see i have tried several servlet-mappings - but none of these
seem to take effect: every time i try to access this servlet via
"localhost:8080/seminar/Seminar02" or something close to this ending i
get the tomcat-error-html-output:
The requested resource (/Seminar02) is not available.
I verify that my servlet is working by using the examples-directory,
where i added the same servlet-description and -mapping to the
web.xml-file - and there my servlet is accessible and fine working.
I expect myself to have a lack of understanding the xml-configuration of
tomcat-web-applications. But i'm stuck:
I'm looking for help since weeks. Perhaps i got to an end with my search? ;)
If there is an archive of this list with postings covering these
problems, please let me know.
Ah, some more info you need perhaps about my system-config:
I'm running tomcat-4.0.1 on a win98-machine with a JSDK1.3 (where all
these problems occur in the way i desribed them here - i tried these
things also on a winnt and a win2k machine, and there i meet much more
problems regarding the work of the mm.mysqldriver in my application)
Thanks for any help!
Fabian Sommer
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
keyword of "domain" in Cookie
Posted by oh <wa...@sm.sony.co.jp>.
Hi,
I am developing the server program for login process,
I set the cookie with "domain" and "path", but the keyword
is not the format that the client expected.
Cookie were set by this way :
Cookie cookie = new Cookie("ticket", value);
cookie.setMaxAge(age);
cookie.setDomain("test.hostname.xxx");
cookie.setPath("/");
I hope it will be as the following format in the head of response:
Set-Cookie: ticket=53vt5whj61.ajp12tis21;domain=test.hostname.xxx;expires=Sat, 12-Apr-2070 13:56:49 GMT;path=/
but all of the keywords are in capital,
Set-Cookie: ticket=53vt5whj61.ajp12tis21;Domain=test.hostname.xxx;Expires=Sat, 12-Apr-2070 13:56:49 GMT;Path=/
The client program received this by the response and set "Domain" as another cookie in the next request,
But tomcat doesnt't accept it, an exception occured:
--------------------------------------------
java.lang.IllegalArgumentException: Cookie name Domain is a reserved token
For some reason the client cannot be changed, does any one know how to solve this problem?
I refered the documents about HTTP Cookie, the keyword is "domain" , not "Domain".
Why it was written as "Domain" by Tomcat?
Any help will be appreciate.
Regards,
Huimin Wang
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>