RE: Very newbie question, Bootstrap: Class loader creation threw exception

2003-02-13 Thread Daniel Brown
Matt, Using JAVA_HOME: c:\jdk1.2.1 I'd recommend trying a 1.3.x or 1.4.x JDK, rather than this one. (The 1.4.1 I'm using works fine for me.) Alternatively, if you already have a later JDK, but it's not being used, create a file in Tomcat install directory/bin called 'setenv.bat',

RE: Need help w. another jsp!

2003-02-11 Thread Daniel Brown
Steve, Certainly worth a go - computers have the advantage over other experimental sciences in that you can try things, and not risk laying waste to entire city blocks if they go wrong. As we discussed before, the JSP compiler is messing up the structure of your switch statements - take a look

RE: How can I get the web application name?

2003-02-11 Thread Daniel Brown
For Tomcat 4.x (Servlet 2.3), you can use ServletContext.getServletContextName() You could also use HttpServletRequest.getContextPath(), if that's suited to what you want to do. Dan. -Original Message- From: Etienne [mailto:[EMAIL PROTECTED]] Sent: 11 February 2003 12:31 To:

RE: Need help w. another jsp!

2003-02-10 Thread Daniel Brown
Steve, This isn't really the best forum in which to find help in debugging JSPs - one of the more painful processes that everyone goes through when getting to grips with Java and JSP/Servlets is to learn how to debug effectively. And the only way to do that is to read through the manuals, read

RE: response.sendRedirect() - is this allowed?

2003-02-07 Thread Daniel Brown
Arbitrarily changing a POST to a GET can also end up in your customers ordering two sets of football tickets, rather than one. A repeat of a POST requires that the user be prompted, as POSTs are non-idempotent. Browsers can issue as many GET requests as they like in order to get the page

RE: bug in java api? (ot)

2003-02-06 Thread Daniel Brown
But 2000 *was* a leap year...? http://world.std.com/~dpbsmith/leapyearfaq.txt -Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: 06 February 2003 11:50 To: Tomcat Users List Subject: bug in java api? (ot) Take a look at the following code

RE: singleton creation (ot)

2003-02-05 Thread Daniel Brown
The simple answer is 'no'. For the more complex answer, read the 'Double-Checked Locking is Broken' declaration at: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html To complicate matters even further, check out the JavaDoc to the Fast* utilities in the Jakarta commons. For

RE: singleton creation (ot)

2003-02-05 Thread Daniel Brown
it'll probably be called million of times in my app On Wed, 2003-02-05 at 09:42, Daniel Brown wrote: The simple answer is 'no'. For the more complex answer, read the 'Double-Checked Locking is Broken' declaration at: http://www.cs.umd.edu/~pugh/java/memoryModel

RE: Session lost between HTTPS and HTTP

2003-02-04 Thread Daniel Brown
Cookies can be set 'secure' (Cookie.setSecure(true)). Secure cookies are only sent to servers by browsers over a secure connection. When Tomcat starts a new session, it sets the cookie to be secure if the session is opened over a secure connection. This seems to fit with everything so far

RE: Possible too switch off tcp/ip server shutdown?

2003-01-31 Thread Daniel Brown
The code to implement the shutdown process (at least in 4.0.6) is in org.apache.catalina.core.StandardServer You modify the await() method to implement the security mechanism you need. Currently, it accepts connections on localhost to port 8005, and waits until it can read the magic word

RE: Setting UTF-8 Encoding

2003-01-31 Thread Daniel Brown
Affan, The encoding is set just fine. If I copy and paste your JSP, and run it here, I get the following as the content type in the HTTP headers: Content-Type: text/html; charset=UTF-8 You're seeing empty squares where you'd expect characters for a couple of reasons: The Unicode escape for

RE: web.xml servlet and resources

2003-01-30 Thread Daniel Brown
Richard, You could use HttpServletRequest.getPathInfo() to read the extra path information after servlet name, read the corresponding object from disk, set an appropriate MIME type, and then send the object back in the response. But it's a lot of new code for something that doesn't seem like a

RE: Redirect and Tomcat

2003-01-30 Thread Daniel Brown
This was news to me too. But, from the horse's mouth: RFC 2616HTTP/1.1 June 1999 If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be

RE: about singletons (ot)

2003-01-29 Thread Daniel Brown
That would depend on if the constructor actually *does* something. If it needs to set up a connection pool, parse an XML configuration file, or whatever, then you have the choice of, - doing this once, reliably, in the constructor, or - making sure that every single last static method checks to

RE: java.io.IOException - whats up?

2003-01-29 Thread Daniel Brown
Klavs, From the error message, it sounds like: /opt/jakarta/tomcat/webapps/../server/webapps/admin/WEB-INF/lib/struts.jar cannot be created, probably because the directory structure required isn't there. If you canonicalise the path, you end up with the following:

RE: Serving files from the Apache docroot

2003-01-28 Thread Daniel Brown
Alternatively, if you can find an OS that implements process/file capabilities, you should be able to grant the JVM the capability to bind to ports below 1024. The doco. for the 2.4 Linux kernels suggests this might be in there - anyone know if it's sufficiently mainstream, and suitable for this

RE: Help in URLEncoder.encode()

2003-01-27 Thread Daniel Brown
Santosh, This sounds like a character set problem. When the content is decoded, you need to make sure it's decoded using the character set used to encode it. Tomcat assumes ISO-8859-1 when decoding URL parameters. When you encode the data, use URLEncoder.encode(string, UTF-8), and decode it

RE: HttpSessionbindingListener

2003-01-24 Thread Daniel Brown
Henry, HttpSessionBindingListener enables you to be notified when an object is bound into a session, or when the object is removed from the session (either progammatically, or when the session itself is invalidated or expired). If you'd like an object stored in the session to be notified in this

RE: Quick help with Bindings

2003-01-24 Thread Daniel Brown
Dave, There is a known issue with IIS in which it binds to all available IP addresses, rather than the one specified, when socket pooling is in use (the default). It's described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;259349 Generally, IIS will start before Tomcat when

RE: Tomcat Out of memory

2003-01-23 Thread Daniel Brown
Nate, When installing Tomcat as a service, you can specify extra options to the JVM using the 'jvm_option' flag. catalina.bat isn't used for this, as you rightly suspect. Try using tomcat.exe to uninstall the service, and then reinstalling it with your extra JVM options specified - hopefully

RE: Using SingleThreadModel under tomcat

2003-01-23 Thread Daniel Brown
Adrian, Here's a starter: Normally, the servlet container maintains only one instance of each servlet, (one instance per servlet per JVM is required by the servlet spec. in a non-distributed environment) and passes all requests received concurrently through the service method of that instance.

RE: Using SingleThreadModel under tomcat

2003-01-23 Thread Daniel Brown
or 2? On Thu, 2003-01-23 at 09:36, Daniel Brown wrote: If, however, the servlet implements SingleThreadModel, then the container has two choices: 1. serialise all requests through the single instance 2. create a pool of servlet instances, and share out requests amongst the pool

RE: java.lang.NoClassDefFoundError: javax/servlet/Filter

2003-01-23 Thread Daniel Brown
John, One (somewhat superstitious) thing: I have the following as my 2.3 DTD: !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; and this works for me. In the past, I've found all sorts of wierd things happen

RE: java.lang.NoClassDefFoundError: javax/servlet/Filter

2003-01-23 Thread Daniel Brown
It's just a crazy, ever changing world. Thanks for the pointer :) -Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: 23 January 2003 19:52 To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Daniel, If you follow your

RE: request.setCharacterEncoding(charset) problem?

2003-01-22 Thread Daniel Brown
Francis, The HTML (4.01) spec says that browsers 'may' use the page encoding as the encoding to use when submitting form data. If you're assuming UTF-8, then you might want to consider something like the following, FORM accept-charset=UTF-8 ... ... /FORM to force conforming browsers do the

RE: Doing something on the server when user session expires

2003-01-21 Thread Daniel Brown
When the session is created, you could store an object that implements the 'javax.servlet.http.HttpSessionBindingListener' interface. When the session is invalidated, that object will receive an event, according to the doco, just after the session has been invalidated, or expired. The interface

RE: URL mapping problem

2003-01-21 Thread Daniel Brown
Roger, It sounds like you've created a web application to hold these servlets, and Tomcat is inserting the name of the web application when creating the path to the 'exit.htm's that you're trying to replace. If you try this using the ROOT web application, it should do what you're wanting.