Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
odd subclassed-servlet behavior

odd subclassed-servlet behavior

2004-01-08       - By Bill Wadley

 Back
Reply:     1     2     3     4  


Hello!

I have just upgraded from JBoss/Jetty 3.0.4 to JBoss/Tomcat 3.2.3, and
have noticed some rather odd behavior.

I have 3 servlets: SuperClazz <|--- SubClazz <|--- SubSubClazz

SuperClazz subclasses HttpServlet but is not meant to be called directly,
but SubClazz and SubSubClazz are both standalone servlets and I call them
directly depending on what I need. SubClazz does general things, and
SubSubClazz does more specific things. SubClazz delegates to SuperClazz
and SubSubClazz delegates to SubClazz as needed. This was working in JBoss
3.0.4 and Jetty.

However, in Tomcat 4.1.29 just now I observed that calling SubClazz
directly resulted in SubSubClazz getting the call, then execution tracing
straight to SuperClazz, _then_ SubClazz. SubSubClazz was the last thing
executing before it failed. (That failure is the thing; SubSubClazz doesn't
have what it takes to handle my request, and I don't want it called.)

Here is an example of my problem. By calling the URL:
  http://localhost/myApp/servlet/SubClazz?a=1

I get this output from the running server:

10:23:24,020 INFO  [STDOUT] [SubSubClazz.doGet] GOT HERE 1
10:23:24,020 INFO  [STDOUT] [SubSubClazz.doPost] GOT HERE 1
10:23:24,020 INFO  [STDOUT] [SuperClazz.doPost] GOT HERE 1
10:23:24,021 INFO  [STDOUT] [SuperClazz.doPost] GOT HERE 2
10:23:24,021 INFO  [STDOUT] [SuperClazz.doPost] GOT HERE 3
10:23:24,021 INFO  [STDOUT] [SuperClazz.doPost] GOT HERE 4
10:23:24,021 INFO  [STDOUT] [SuperClazz.doPost] GOT HERE 5
10:23:24,021 INFO  [STDOUT] [SuperClazz.doPost] GOT HERE 6
10:23:24,021 INFO  [STDOUT] [SubClazz.doPost] GOT HERE 1
10:23:24,021 INFO  [STDOUT] [SubClazz.doPost] GOT HERE 2
10:23:24,021 INFO  [STDOUT] [SuperClazz.doAThing] GOT HERE 1
10:23:24,023 ERROR [Engine] StandardWrapperValve[SubSubClazz]: Servlet.service(
) for
servlet SubSubClazz threw exception
java.lang.IllegalStateException Source code of java.lang.IllegalStateException: Cannot forward after response has been
committed
       at org.apache.catalina.core.ApplicationDispatcher Source code of org.apache.catalina.core.ApplicationDispatcher
(ApplicationDispatcher.java:368)
       at org.apache.catalina.core.ApplicationDispatcher Source code of org.apache.catalina.core.ApplicationDispatcher
(ApplicationDispatcher.java:356)
       ...bad stuff happening since correct calling order is not happening...

Can anybody explain why:

SubClazz is being skipped and SubSubClazz is getting the request in the
first place?

SubClazz is not getting the super() call, but instead it is going straight
to SuperClazz?

SubClazz is getting the call after SuperClazz, especially after having been
skipped originally?


Thanks very much in advance for any light that can be shed on this
behavior.

Bill Wadley

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




©2008 junlu.com - Jax Systems, LLC, U.S.A.