Re: [PATCH][4.0] remove spurious casts in ApplicationFilterChain
+1, old code was redundant. Java should find the right method to call based on object--not reference--type. Christopher K. St. John [EMAIL PROTECTED] writes: The fall off the end of the chain code in ApplicationFilterChain.internalDoFilter checks if the passed in request and response are HttpServletRequest/ Response objects. Based on the test, it casts the objects and invokes servlet.service(). However, since the servlet member has a static type of javax.servlet.Servlet, the exact same method is called in both cases. The code operates correctly (since the non-http version of the service() method eventually invokes the correct version of service()), but the test and cast are redundant and confusing. The following patch removes them: Index: ApplicationFilterChain.java === RCS file: /home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v retrieving revision 1.11 diff -u -r1.11 ApplicationFilterChain.java --- ApplicationFilterChain.java 2001/10/11 23:30:58 1.11 +++ ApplicationFilterChain.java 2001/12/28 19:06:24 @@ -242,13 +242,7 @@ try { support.fireInstanceEvent(InstanceEvent.BEFORE_SERVICE_EVENT, servlet, request, response); -if ((request instanceof HttpServletRequest) -(response instanceof HttpServletResponse)) { -servlet.service((HttpServletRequest) request, -(HttpServletResponse) response); -} else { -servlet.service(request, response); -} +servlet.service(request, response); support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT, servlet, request, response); } catch (IOException e) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
StandardPipeline and ThreadLocal
The first thing that pops into my head when I see the Pipeline pattern (and read Craig's [PROPOSAL] Tomcat 4.0-beta API Change: Valve APIs post), is something along the lines of the psuedocode at the end of the message. The semantics are subtly different from the current StandardPipeline, but I think only in bizarre cases like if a Valve spawned a thread and then both threads tried to call invokeNext on the same ValveContext. It's not like the existing code is exactly broken, but the use of ThreadLocal is certainly a little unexpected. It violates the avoid suprising code rule. (Well, it suprised me, anyway) Do the semantics differ in some other way that makes the implementation below incorrect? (Ignore bugs, you get the idea) If not, would whoever's responsible for that code be willing to accept a patch to get rid of the ThreadLocal? class ValveContext { Pipeline p; int i; public void invokeNext(req, rsp) { if (i==p.valves.length) if (p.basic) v = p.basic; else v = p.valves[i++]; if (!v) throw exception; v.invoke(req, rsp, this); } } class StandardPipeline { Vector valves = new Vector(); Valve basic; public void invoke(req, rsp) { ctx = new ValveContext(0, this); ctx.invokeNext(req, rsp); } } -- Christopher St. John [EMAIL PROTECTED] DistribuTopia http://www.distributopia.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 5628] New: - getServletConfig() returns null
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5628. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5628 getServletConfig() returns null Summary: getServletConfig() returns null Product: Tomcat 4 Version: 4.0 Beta 1 Platform: PC OS/Version: Linux Status: NEW Severity: Normal Priority: Other Component: Catalina AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Trying to get an init parameter from the servlet failed with NullPointerException while doing getServletConfig().getInitParameter(whatever), while doing the same on the ServletConfig object passed to the servlet's init(ServletConfig config) method works just fine. After investigating the issue further I found out that getServletConfig() always returns null not only in the init() stage but even later while in doGet(). -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 5629] New: - web.xml is not re-read using manager reload
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5629. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5629 web.xml is not re-read using manager reload Summary: web.xml is not re-read using manager reload Product: Tomcat 4 Version: 4.0.1 Final Platform: Sun OS/Version: Solaris Status: NEW Severity: Major Priority: Other Component: Webapps AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] If web.xml within a webapp is changed and I use the manager to reload (i.e. http://localhost:8080/manager/reload?path=/mywebapp) web.xml is not being re-read. This is true with or without a war file. I feel that this is a pretty big issue as the reload feature is a very useful concept. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tomcat-dav with mod_webapp
Hi all I want to use dav capabilities of tomcat-4.0.1 through apache. I am using mod_webapp for that. I am able to run servlets with the help of mod_webapp but haven't yet been able to get DAV running. Looking into logs I see that apache is not forwarding the Options , PROPFIND etc DAV specific requests to tomcat. Am I missing some configuration directive in apache , or anything else My httpd.conf looks like - LoadModule webapp_module modules/mod_webapp.so AddModule mod_webapp.c WebAppConnection warpConnection warp buildserver:8008 WebAppDeploy webdav warpConnection /webdav I can open the index file residing in the webdav folder when I point the explorer to it but I fail to add the same folder as a webfolder on my win2000 box. Thanks for any help. Hitesh PS: I 've written n number of times on this group but haven't yet gor a single reply. Please acknowledge the reciept of this mail to my personal id. So that I know that people are reading my problem and probably they don't have any idea. Otherwise I am getting an impression that my mails are not getting into any mail-box.
DO NOT REPLY [Bug 5634] New: - Critical error with tomcat 4.0.x and Catalina loading images
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5634. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5634 Critical error with tomcat 4.0.x and Catalina loading images Summary: Critical error with tomcat 4.0.x and Catalina loading images Product: Tomcat 4 Version: Nightly Build Platform: PC URL: http://http:// OS/Version: All Status: NEW Severity: Blocker Priority: Other Component: Catalina AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] On all tomcat 4.0.x versions, even with the default tomcat index page, the following error occurs when trying to load images. I'm using Apache 1.3.22 webserver on a windows me platform. Please let me know if there's a resolution for this. Thanks, Danny. Apache Tomcat/4.1-dev java.lang.ArrayIndexOutOfBoundsException: No data available at org.apache.catalina.connector.warp.WarpPacket.readUnsignedShort(Unknown Source) at org.apache.catalina.connector.warp.WarpPacket.readString(Unknown Source) at org.apache.catalina.connector.warp.WarpRequestHandler.handle(Unknown Source) at org.apache.catalina.connector.warp.WarpConnection.run(Unknown Source) at java.lang.Thread.run(Unknown Source) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tomcat-dav with mod_webapp
I would like to add that I can save document to the DAV folder if send a PUT request Directly Its looks that apache is not forwarding returning proper response to the options request. hitesh - Original Message - From: Hitesh Sharma [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Cc: tomcat developers [EMAIL PROTECTED] Sent: Monday, December 31, 2001 10:12 AM Subject: tomcat-dav with mod_webapp Hi all I want to use dav capabilities of tomcat-4.0.1 through apache. I am using mod_webapp for that. I am able to run servlets with the help of mod_webapp but haven't yet been able to get DAV running. Looking into logs I see that apache is not forwarding the Options , PROPFIND etc DAV specific requests to tomcat. Am I missing some configuration directive in apache , or anything else My httpd.conf looks like - LoadModule webapp_module modules/mod_webapp.so AddModule mod_webapp.c WebAppConnection warpConnection warp buildserver:8008 WebAppDeploy webdav warpConnection /webdav I can open the index file residing in the webdav folder when I point the explorer to it but I fail to add the same folder as a webfolder on my win2000 box. Thanks for any help. Hitesh PS: I 've written n number of times on this group but haven't yet gor a single reply. Please acknowledge the reciept of this mail to my personal id. So that I know that people are reading my problem and probably they don't have any idea. Otherwise I am getting an impression that my mails are not getting into any mail-box. _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]