Re: Multi-part response

2005-10-18 Thread Jon Wingfield
If the browser supports it you would send the whole page in one multipart response a bit like a mail message. Here's one way to do it: So, you'd have to buffer the response. Then create a javax.mail.internet.MimeMultipart and add BodyParts (javax.mail.internet.MimeBodyPart) for the html and

Re: Tomcat WAP/WML

2005-11-08 Thread Jon Wingfield
You don't need a WAP gateway. The mobile operator's have them and they proxy the browser request :) You just need to make sure the wml you vend is valid and sent with the correct mime type and the operator's gateway will do the rest (conversion to wmlc, a wbxml tokenized version of the markup).

Re: Tomcat WAP/WML

2005-11-08 Thread Jon Wingfield
time I looked there weren't any mature OSS gateways written in java. That could have changed though... Jon Carl Olivier wrote: Hi. Great. Thanks! Is there Gateway software available though? If you wanted to set your own gateway up? Carl -Original Message- From: Jon Wingfield

Re: advice on auto logout servlet

2005-11-16 Thread Jon Wingfield
I did an AJAX version of this a couple of months ago. The slight gotcha is that the AJAX request prolongs the life of the session (you can't, it seems, override the cookie for AJAX requests) so the interval has to be slightly longer than the expiry time for the session. Reynir Hubner wrote:

Re: Starting the apache tomcat 4.05 servlet engine on windows xp

2005-11-23 Thread Jon Wingfield
Try the binary distribution instead of the source bundle: http://archive.apache.org/dist/tomcat/tomcat-4/archive/v4.0.5/bin/ Either jakarta-tomcat-4.0.5.zip or jakarta-tomcat-4.0.5.exe should be fine. CATALINA_HOME will probably then be: C:\tomcat\jakarta-tomcat-4.0.5 HTH, Jon Aaron Bortman

Re: JDBC/MySQL user login goes stale

2005-11-29 Thread Jon Wingfield
Also be aware that autoReconnect=true only works (according to the mysql docs) for Connections with autocommit set to true. If you are using a connection pool make sure it checks the validity of Connections every so often. This is configurable for DBCP:

Re: Extending webappclassloader

2005-12-05 Thread Jon Wingfield
Our custom loader sits in a jar in $CATALINA_HOME/server/lib Our classloader uses different parent classloaders depending on which version of TC is running. In 4.1 we just use the parent classloader as supplied in the constructor. In 5.0.x we use the classloader of WebAppClassLoader as the

Re: Multilingual usernames and passwords does not works.

2005-12-15 Thread Jon Wingfield
Your html isn't correct: http://www.w3.org/TR/html4/interact/forms.html#h-17.3 I would remove the enctype attribute, correct the accept-charset name and see if you get any further. HTH, Jon Manish Dalakoti wrote: Hi, I'm using form-based authentication. Although i'm able to create

Re: problem calling request.getParameter(myparameter) in jsp

2006-01-11 Thread Jon Wingfield
Your underlying problem is the exclamation mark at the start of your scriptlet. This makes the jsp ompiler put free standing code into the init method or creates methods on the servlet that you can call within your jsp. Without the exclamation mark the compiler inlines the scriptlet into the

Re: Image problem on tomcat

2007-06-28 Thread Jon Wingfield
Is it a mime-type issue? The content is probably being vended as application/octet-stream, which the mobile device is probably not liking. You can add additional mime-mappings into your web.xml. If you are fronting tomcat with apache httpd you can also add mime-mappings into the httpd.conf

Re: Tomcat Version problem

2007-07-05 Thread Jon Wingfield
You are using jdk1.5 features (autoboxing, for example ) in your JSP pages. Early versions of the 5.5 tree bundled a jsp compiler (JDT) which didn't support these new language features. Later versions bundled an updated version of the compiler... For deploying on 5.5.9 just get rid of your

Re: [OT] JDBC problem: PreparedStatement.setTimestamp function ignores milliseconds in TOMCAT + ddbb Oracle

2007-08-08 Thread Jon Wingfield
That looks ok. Timestamp is the correct thing to use. You have two systems: one that works, one that doesn't. So, check for differences in the SQL sub-systems between the two: Are the drivers of the same (uptodate) version? Are the database schemas using the same column type? (ie the one that

Re: [OT] JDBC problem: PreparedStatement.setTimestamp function ignores milliseconds in TOMCAT + ddbb Oracle

2007-08-08 Thread Jon Wingfield
of timestamp variable. Oracle does have a Timestamp field/data type, but you don't have to make it as such to get this to work. Could have been that my JDK API differed slightly from your's. -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 08

Re: [OT] JDBC problem: PreparedStatement.setTimestamp function ignores milliseconds in TOMCAT + ddbb Oracle

2007-08-08 Thread Jon Wingfield
to make it as such to get this to work. Could have been that my JDK API differed slightly from your's. -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 08, 2007 4:49 AM To: Tomcat Users List Subject: Re: [OT] JDBC problem

Re: How to configure my Realm class from context.xml?

2006-02-23 Thread Jon Wingfield
Your Realm implementation needs to sit in the server classloader as the Realm interface is only defined there (in catalina.jar). This is a PITA so when we did this we made the Realm implementation just lookup the real implementation via JNDI. That way all the authentication logic stayed in

Re: How to configure my Realm class from context.xml?

2006-02-23 Thread Jon Wingfield
would happen. Zsolt -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Thursday, February 23, 2006 5:05 PM To: Tomcat Users List Subject: Re: How to configure my Realm class from context.xml? Your Realm implementation needs to sit in the server classloader as the Realm

Re: How to reduce bandwidth (meaning message size) with Axis

2006-03-16 Thread Jon Wingfield
Compression works very well. I added a homegrown GZip filter to the AXIS urls and also saw approx 10x compression. There are also a number of similar OSS Filters out there. There were .NET clients accessing the web-services and they needed a tweak to handle the compression:

Re: Data Truncation Error

2006-03-22 Thread Jon Wingfield
Try replacing the ampersand character with the xml entity amp; HTH, Jon Mark Whitby wrote: Further to my email earlier I've discovered I can either have the truncation on or the reconnect on, but I can't include both in the url otherwise Tomcat doesn't start up. Also, if I take off the

Re: Distinguish between users and robots in access log?

2006-03-27 Thread Jon Wingfield
Looks like you are running the default access log settings. For logging of user-agent and referer (when given) try: CustomLog logs/access_log combined http://httpd.apache.org/docs/1.3/logs.html#accesslog HTH, Jon Scott Purcell wrote: I really would like to find out how my (and if my site)

Re: Adding user-agent and possibly refer to log4j Tomcat 5.5

2006-03-27 Thread Jon Wingfield
][/unique]=INFO, R -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Monday, March 27, 2006 8:15 AM To: Tomcat Users List Subject: Re: Distinguish between users and robots in access log? Looks like you are running the default access log settings. For logging

Re: Tomcat Valve, how to Create Pattern

2006-03-27 Thread Jon Wingfield
I may be wrong but I think there are only two predefined names: common and combined. For all others you set the pattern attribute to the required number and ordering of pattern elements as defined in the docs. From the docs: The shorthand pattern name common (which is also the default)

Re: InputBuffer and Posting Data

2006-03-28 Thread Jon Wingfield
What is buf.length? Is it the actual length of the data you want to post or is it 8k? The data you receive on the Tomcat side may be truncated by the Connector if the body data is longer than the value set for the Content-Length header. HTH, Jon Vikram Goyal wrote: Hi all, I am trying

Re: InputBuffer and Posting Data

2006-03-29 Thread Jon Wingfield
After re-reading the original description you should probably be aware of this portion of the javadocs for request.getParameter: quote If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via getInputStream() or

Re: Source for Tomcat 5.5.15

2006-05-24 Thread Jon Wingfield
At a guess: http://svn.apache.org/repos/asf/tomcat/build/tags/tc5.5.x/TOMCAT_5_5_15/ Joe Bohn wrote: Mark, Thanks for the clarification. One more question. Is there a branch or tag in SVN for 5.5.15? I can get the source for 5.5 but I don't know how to get the source for a dot release.

Re: Own implementation WebdavServlet

2006-06-05 Thread Jon Wingfield
From previous posts to this list I believe the WebDAV servlet shipped with tomcat is intentionally a bare bones implementation. Have you seen the Slide project? http://jakarta.apache.org/slide/index.html Jon [EMAIL PROTECTED] wrote: I want to make my own implementation of

Re: java.lang.NoClassDefFoundError

2006-06-05 Thread Jon Wingfield
Or better, read http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html and http://tomcat.apache.org/faq/classnotfound.html and deploy your application code appropriately. For the impatient: Tomcat doesn't use CLASSPATH. It sets up its own based on the servlet specification. Each

Re: Tomcat creating two threads for one request

2006-06-07 Thread Jon Wingfield
I would turn on the access logs (if you haven't already) and check that the browser isn't actually sending two requests. This can sometimes happen if the user double-clicks submit buttons. There are plenty of threads in the archives of this list suggesting ways to mitigate this

Re: web.xml error page redirect, Java EE 5

2006-10-24 Thread Jon Wingfield
Have you tried the request attributes specified in section SRV.9.9 Error Handling of the servlet spec? Specifically, the request attribute named javax.servlet.error.request_uri. HTH, Jon Tomas Pop wrote: Hello, I have a problem with change of the method HttpServletRequest.getRequestURL()

Re: profiling a webapp

2006-11-22 Thread Jon Wingfield
Netbeans profiler. Free and does a pretty good job. http://profiler.netbeans.org/ http://profiler.netbeans.org/docs/help/5.5/profile_j2ee.html asaf.lahav wrote: Can anyone recommend a good (and FREE) java profiling tool that can be used to profile a webapp running under Tomcat 5.5?

Re: tomcat pauses then crashes after a period of time

2006-12-12 Thread Jon Wingfield
Another thing to note is that mysql automatically closes idle connections after 8hrs (by default). You can configure DBCP to test on borrow or to periodically squirt some sql down idle connections. HTH, Jon David Wood wrote: Chris, Thanks very much for the suggestion. I'm not using

Re: one filter for all webapps?

2006-06-23 Thread Jon Wingfield
Can't you add the filter to conf/web.xml? I think tomcat (conceptually) folds all of conf.xml into each webapp's web.xml. Again, this behaviour is tomcat specific but at least the filter isn't. Jon Filip Hanik - Dev Lists wrote: in tomcat you can write a Valve

Re: many No Referrers in logs

2006-06-26 Thread Jon Wingfield
Additionally, many client-side Security/Anti-Virus software packages automatically remove the referer header from requests. Markus Schönhaber wrote: Robert Kudyba wrote: We have our server.xml file set w/ the following entry: Valve className=org.apache.catalina.valves.AccessLogValve

Re: MyPrincipal cannot be resolved to a type

2006-06-29 Thread Jon Wingfield
In addition, custom Realms merely need to create instances of Principal. There is no requirement for them to extend GenericPrincipal. Our Realm classes are deployed to server/lib Our extension to Principal is deployed to common/lib See the thread Is custom realm using user/role data in webapp

Re: MyPrincipal cannot be resolved to a type

2006-06-29 Thread Jon Wingfield
the list of roles associated with the principal. Thanks for the pointer. Any issues moving all the jar from server/lib to common/lib for a quick workaround? On 6/29/06, Jon Wingfield [EMAIL PROTECTED] wrote: In addition, custom Realms merely need to create instances of Principal

Re: problem with doPost method - executed twice

2006-06-30 Thread Jon Wingfield
You need to look at your access logs. You'll probably see two requests. Your form submit button calls javascript which also calls form.submit(). I think, if you don't return false from the javascript you will get two form submissions. Try removing the form.submit() from the javascript. HTH,

Re: Getting the date/time from the client

2006-07-11 Thread Jon Wingfield
The HTTP spec (rfc2616) says clients should only send the Date header with http messages with body content (POST, PUT) and even then it's optional. Try adding a date string as a parameter on your GET request which your servlet can then parse from request.getParameter(...). One way to do

Re: Using a property file in java class (not servlet)

2006-07-11 Thread Jon Wingfield
Probably not without using standard java io and a file path (which you can't rely on for packed web-apps). If the file was in /appName/WEB-INF/classes it would be a resource that could be found by the classloader. HTH, Jon sbell wrote: Hello, Is there anyway of referencing a properties

Re: Accessing a servlet

2006-07-12 Thread Jon Wingfield
I would check in tomcat logs directory for reasons why the servlet is not available. One reason could be that classes should be in a package: http://tomcat.apache.org/faq/classnotfound.html HTH, Jon McRaven, Brian wrote: OK I did that and now my system is hanging which I guess could be an

Re: Accessing a servlet

2006-07-12 Thread Jon Wingfield
of package 3 changed entry in web.xml file to reflect package that servlet is in for the url-pattern 4 changed JSP so that the forms action=firstpack.JustALittleTest I've looked at the log files but I'm not sure what to look for. Brian -Original Message- From: Jon Wingfield [mailto:[EMAIL

Re: Accessing a servlet

2006-07-12 Thread Jon Wingfield
that the forms action=firstpack.JustALittleTest I've looked at the log files but I'm not sure what to look for. Brian -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 12, 2006 7:49 AM To: Tomcat Users List Subject: Re: Accessing a servlet I would

Re: Accessing a servlet

2006-07-12 Thread Jon Wingfield
go? Brian -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 12, 2006 11:30 AM To: Tomcat Users List Subject: Re: Accessing a servlet You've deployed this in the ROOT webapp? form action should be /firstpack/JustALittleTest McRaven, Brian wrote

Re: out of memory error

2006-07-19 Thread Jon Wingfield
The process running tomcat can't (read isn't allowed by OS) to create any more threads: java.lang.OutOfMemoryError: unable to create new native thread If you are on unix you can up the number by tinkering with the ulimit command. HTH, Jon MW Janssen wrote: Hi, Can anyone explain and

Re: out of memory error

2006-07-19 Thread Jon Wingfield
This may be of help (emphasis on may): http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4765019 Has a bit about tuning Xss for a high number of threads. MW Janssen wrote: Hi, These are my parameters: I have Xmx1024m and Xms1024m as well for the heap size memory. I dont set Xss so I

Re: Removal of headers in HttpServletResponse object

2006-07-21 Thread Jon Wingfield
You'll probably need to write your own connector! See prepareResponse method: http://svn.apache.org/repos/asf/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11Processor.java

Re: Removal of headers in HttpServletResponse object

2006-07-21 Thread Jon Wingfield
Another approach would be to put Apache in front and use mod_headers: http://httpd.apache.org/docs/1.3/mod/mod_headers.html http://httpd.apache.org/docs/2.0/mod/mod_headers.html Note: I've not tried this approach and don't know if you can remove mandatory headers... Jon Wingfield wrote

Re: Tomcat Memory Status?

2006-07-24 Thread Jon Wingfield
Hi OP, They probably mean what they say ;) See the jdk javadocs for the System/Runtime classes. The Free Memory stat often causes confusion initially. It's the free memory in the block of RAM currently assigned to the JVM. So, it looks like at startup Tomcat is assigned 8Mb under your JVM on

Re: Missing Request Parameters

2006-07-29 Thread jon wingfield
Rache, Tools like ieHTTPHeaders and LiveHTTPHeaders will also help you determine what the browser actually sends to the server, including any redirects caused by 302 response codes. HTH, Jon Rache, But this usually occur after redirects. This is what I was going to ask about: if you fail

Re: Missing Request Parameters

2006-07-31 Thread Jon Wingfield
Erm. ok. Where does the redirectURL variable come from? Unless it has parameters encoded into it that will be your problem. Also, be a bit wary in using the RequestDumperValve with non-ascii charset data as it can corrupt some parameters:

Re: HTTP 408 Login timeout

2006-09-20 Thread Jon Wingfield
If you have a custom error page set up you can trap the 408 response code and redirect to an appropriate resource. Works for me :) Alternatively, you can set up a meta refresh on your login page so you never get the 408. Of course, because the refresh has to go to some protected page and not

Re: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread Jon Wingfield
You've also got other candidates such as database connections, JMS connections etc which could spawn threads (For example, for keep-alive functionality). The easiest thing to do is a thread dump (send the process a SIGQUIT signal) after stopping tomcat to see which thread(s) are keeping the

Re: login page behavior and the 2.4 specification

2006-10-19 Thread Jon Wingfield
Quick and dirty solution is to have your login page make a meta refresh every, say, ten minutes pointing to the index page of your protected content. This simple approach works for us. We also catch unexpected errors coming back from the login form submission and re-present the login page.

Re: login page behavior and the 2.4 specification

2006-10-19 Thread Jon Wingfield
But you need to cater for the people who hit the login page and then go to lunch. Happens more frequently than you might think ;) David Smith wrote: Don't send people who logout to a protected page, forcing a login page to appear. Better to offer up a public, non-login page and have people

Re: a discrepancy in webapp behavior in two environments

2006-10-19 Thread Jon Wingfield
Mark, Take a look at the LiveHttpHeaders plug-in for Firefox. It may help you debug this on the client side. Temporarily enabling the RequestDumperValve on the server side will enable you to see if cookies are reaching the server. HTH, Jon Aronszajn, Mark wrote: Thanks for the

Re: Listener vs. load-on-startup

2007-04-24 Thread Jon Wingfield
The order of events is: Startup: All listeners get called. All filters, load-on-startup servlets get inited. Shutdown: All filters, servlets get destroyed. All listeners get called. So, it is possible for the combination of load-on-startup init + contextDestroyed to do the same job as just using

Re: hi,problem when shutdown tomcat!

2007-06-12 Thread Jon Wingfield
Chuck answered a similar query recently: http://marc.info/?l=tomcat-userm=118113828210257w=2 Your servlets are serving long-running requests (or are in infinite loops, dead-locked etc) when you are trying to shutdown tomcat. The first thing I'd do in this situation is SIGQUIT tomcat to get a

Re: hi,problem when shutdown tomcat!

2007-06-12 Thread Jon Wingfield
JBuider2006, what profiler can used in JBuider2006? thanks peter On 6/12/07, Jon Wingfield [EMAIL PROTECTED] wrote: Chuck answered a similar query recently: http://marc.info/?l=tomcat-userm=118113828210257w=2 Your servlets are serving long-running requests (or are in infinite loops, dead

Re: hi,problem when shutdown tomcat!

2007-06-13 Thread Jon Wingfield
PROTECTED] root]# does anyone has idea why? some artical said that if JVM set -Xrs,it will ignore the OS signal like SIGQUIT Does anyone know how can i see the stack trace in this situation? i use Tomcat 5.5.20 in linux , java, 1.5.0_10 thanks On 6/12/07, Jon Wingfield [EMAIL PROTECTED