Re: Do imports inherit?

2011-09-11 Thread Donald Jolley
Thanks for the clarification. Also note that it's generally frowned upon to import with wildcards; be specific with the classes you use. Your suggestion certainly seems reasonable to me. I do, however, note that the use of wildcards seems to be fairly prolific. In this particular case my use

Do imports inherit?

2011-09-10 Thread Donald Jolley
I am writing a domain registration application.Typically, servlets extend the HttpServlet class and import java.io.*, javax.servlet.*, and javax.servlet.http.*. There are some methods and variables that I want to make available to all of my servlets in this application. So, I decided to create a

Re: Exception Handling

2011-08-29 Thread Donald Jolley
I am happy to report that I finally got exception handling to work using the web.xml approach. To me this approach makes the most sense for handling errors. (Forwarding is a different issue.) It was a patchwork of assistance from many that finally led me to this point. Thanks to all who

Re: Exception Handling

2011-08-29 Thread Donald Jolley
Like... what other information do you want to provide? An explanation of what to do to avoid the error? That is worthy of a Turing Award if you can pull it off :) I am interested in identifying as clearly as possible the specific code that was the root cause of the error. The original URI

Re: Exception Handling

2011-08-28 Thread Donald Jolley
Exception handling can be configured in WEB-INF/web.xml This suggestion seems to hold a lot of promise for error handling. The only problem is that I have not been able to get it to work. I have the following stanza in the web-app container of my web.xml file: error-page

Cannot forward after response has been committed

2011-08-27 Thread Donald Jolley
I have been playing around with forwarding. I have a variety of test samples and they all work. However, after trying to deploy a forwarding mechanism within the contest of a larger page I have encountered the error, Cannot forward after response has been committed. I have done some googling on

Re: Cannot forward after response has been committed

2011-08-27 Thread Donald Jolley
You need to read the Servlet spec. Great suggestion. I didn't even know that there was a Servlet spec! Very revealing. Your further response summarizes very well the essence of what the Spec has to say on the subject. My intention was to try to come up with a general-purpose forwarding

Exception Handling

2011-08-27 Thread Donald Jolley
For days I have been playing around with trying to develop a general-purpose forwarding mechanism that I could use to forward to an errors page upon the occurrence of an exception. It has just been revealed to me that this approach is not going to work because once a response is committed it is

Re: Exception Handling

2011-08-27 Thread Donald Jolley
What I do is build the response in a string instead of writing it to the buffer. Interesting. The string serves as a pseudo buffer which expands in length as required. Very cool. To use this approach one would have to be dealing directly with a servlet, right? IOW, this approach would not be

Re: Exception Handling

2011-08-27 Thread Donald Jolley
. . . . just my two cents. I think that's a great idea. There is no substitute for having a good book. By any chance, is the full title of the book you are referencing, Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam? Then, there is another one with the

Re: Conditional Branch from Servlet to URL - Continued

2011-08-26 Thread Donald Jolley
JSPs should be used for output with all processing (and, hopefully, anything that can fail) having already been completed by the time the JSP runs. That's a REALLY good point. The JSP can be thought of as simply bieing a view with all (or most) of the heavy lifting done elsewhere. Within the

Re: Conditional Branch from Servlet to URL - Continued

2011-08-25 Thread Donald Jolley
Chris et al, thanks ever so much for all the great help. I finally got things working. This has been quite an educational experience for me. I am appending to this message my complete *WORKING* servlet. Having gotten this far, my next question is this: Is there any way that I can get this to

Replying to Posts

2011-08-24 Thread Donald Jolley
Hi -- I'm very new to both Tomcat and the list. Yesterday I initiated a thread entitled Conditional Branch from Servlet to URL. So far I have received 2 thoughtful replies. (Thank you very much.) Suddenly I have discovered that I don't know how to reply to these posts. I think that the

Conditional Branch from Servlet to URL - Continued

2011-08-24 Thread Donald Jolley
Hi -- I had difficulty replying from my digest subscription. To resolve the difficulty, I have unsubscribed and resubscribed without the digest. Leo has asked the question: how can RequestDispatcher perform the forward I'm not sure. My objective is to institute a way of conditionally

Conditional Branch from Servlet to URL

2011-08-23 Thread Donald Jolley
I have a book on Tomcat. In a section entitled, Forwarding HTTP Requests reference is made to the fact that sometimes it's desirable to branch form a servlet to an alternative URL upon the occurrence of some condition such as encountering an exception. The book provides the following sample code