Modified stop-script for Linux
Hello All I have noticed that the /etc/init.d/tomcat4 script still contains what is described as an Ugly hack - a short two second pause when restarting the service instead of something that confirms that all threads have been shut down. A while ago I modified my own script to conatain the following lines - perhaps they could be of some use for others, I don't know. I am by no means an experienced coder so please bear with me if this is not the most elegant solution - it just works for me... ;-) stop() { echo -n Stopping $TOMCAT_PROG: if [ -x /etc/rc.d/init.d/functions ]; then daemon --user $TOMCAT_USER $TOMCAT_SCRIPT stop else su - $TOMCAT_USER -c $TOMCAT_SCRIPT stop fi RETVAL=$? echo echo 'Waiting for java threads to finish...' threads=1 until [ $threads = '0' ] do ps -aux | grep $TOMCAT_USER -c /tmp/threads read threads /tmp/threads done rm -f /tmp/threads echo 'Java threads cleaned up - shutdown complete.' [ $RETVAL = 0 ] rm -f /var/lock/subsys/tomcat4 /var/run/tomcat4.pid } The above works on a x86 RedHat 7.1 - I don't know if things may work differently on other systems. -- Med venlig hilsen / Best regards Anders C. Madsen Golden Planet Tel.: +45 7020 9594 Dalbygade 40 Fax.: +45 7020 9592 DK-6000 Kolding http://www.goldenplanet.dk -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Duplicate Contexts in reloading. Probably a sync bug in Tomcat 3.3.
Hi, If two requests enter ReloadInterceptor.contextMap() simultaneously and both reload context, it causes duplicate context reloading. -- messages -- 2002-08-19 16:15:16 - ContextManager: Removing context DEFAULT:/examples 2002-08-19 16:15:16 - ContextManager: Removing context DEFAULT:/examples 2002-08-19 16:15:16 - ContextManager: Adding context DEFAULT:/examples 2002-08-19 16:15:16 - ContextManager: Adding context DEFAULT:/examples -- messages -- As a result, ContextManager.contextsV has duplicate Context object, while ContextManager.contexts doesn't have since it is Hashtable -- the first is replaced. I found this problem and then simulated it in JBuilder with its debugging functions. I think that it is not enough to sync DependManager only. It is necessary to sync some code in ReloadInterceptor.contextMap(). So far don't know if this problem will cause further errors. Thanks. __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 7082] - Calling an RMI Server from a servlet produces stack trace
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=7082. 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=7082 Calling an RMI Server from a servlet produces stack trace --- Additional Comments From [EMAIL PROTECTED] 2002-08-19 09:47 --- Comments posted to the tomcat-user mailing list by Greg Trasuk [[EMAIL PROTECTED]]: I'm in the same boat trying to use RMI and/or Jini from Tomcat. This isn't a complete answer to your question, as I'm still investigating the issue, but I'm posting what I know so far in the hope that it might help in your own solution, and also generate discussion that will guide my exploration. When all is said and done, if there's interest, I can post a Catalina-RMI HOWTO sort of document. Although I didn't try to run the test case that you attached to your bug report, I did take a look at it, and I think I know what's going on. Here's what I know so far (most of which you probably know already, but I'm summarizing for other folks on the list): When you pass an instance of some Serializable class as an argument to an RMI call (e.g. passing a command object, as in your test case), the RMI subsystem will serialize the object with an additional annotation indicating the locations from which the class's bytecode can be downloaded. When you pass an exported object (e.g. a server object or an object that will receive callbacks from remote objects), the RMI subsystem creates and serializes a proxy object (otherwise known as the RMI stub object) in place of the actual object. In either case, the remote RMI subsystem has to load the class that is called out in the serialized instance. It does this by calling the RMIClassLoader. The RMIClassLoader object first tries to find the class locally (i.e. in the default classloader). If it can't find it locally, it searches in the list of locations contained in the annotation mentioned above. If the required class is available locally, no further headaches are caused, which may be why some people have had no problems using RMI under Tomcat - they probably had the serialized classes and/or proxy classes in the standard classpath/classloader setup. And there we find our problem. (At this point you might want to have a look at the JSP snippet below) The annotation is determined by RMIClassLoader. According to the RMI and Object Serialization FAQ in the JDK1.31 API docs, If the _Stub class was loaded by an RMIClassLoader, then RMI already knows which codebase to use for its annotation. If the _Stub class was loaded from the CLASSPATH, then there is no obvious codebase, and RMI consults the java.rmi.server.codebase system property to find the codebase. If the system property is not set, then the stub is marshalled with a null codebase, which means that it cannot be used unless the client has a matching copy of the _Stub classfile in the client's CLASSPATH. If we're running a standalone application (and I believe also in Tomcat 3.x), we're using the system class loader, which has no obvious codebase, so the java.rmi.server.codebase property gets used. But what's the class loader used in Tomcat 4.x? I looked at the source code for Tomcat 4.0.1 (happens to be what I have on hand), and o.a.c.loader.WebAppClassLoader extends from o.a.c.loader.StandardClassLoader, which extends from java.net.URLClassLoader, which has a method called getURLs(). The WebAppClassLoader.getURLs() method returns a list of all the repositories it will search when trying to load a class on behalf of the web app. This list calls out all the jar's in WEB-INF/lib, common/lib, etc. Having not seen the source for RMIClassLoader, I suspect that the getClassAnnotation(..) method checks to see if the classloader for the supplied class is a URLClassLoader, and if so, uses the results of the getURLs() method call as an obvious codebase. This suspicion is supported by the last part of the JSP, where I create a classloader that extends from URLClassLoader but overrides getURLs() to return a phony url. The phony url shows up as the class's annotation. So the exact error you quoted in the bug report shows something about a protocol missing MalformedURL exception, which is caused by the fact that the urls to the repositories contain spaces, since the RMI annotation is supposed to be a space-separated list of URL's. Thus the annotation doesn't get parsed properly. This may be a bug in Catalina's class loader (i.e. should the returned urls have the spaces encoded to '%20'?) or possibly in the way RMIClassLoader uses the results of getURLs(). But it's not the problem. The problem is how to get our codebase into the annotation. Clearly the
Re: [VOTE] New committer: Jean-Francois Arcand
Quoting Patrick Luby [EMAIL PROTECTED]: I would like to propose that we add Jean-François Arcand as a Tomcat committer. I believe he has submitted enough patches to show that he will be a positive contributor to Tomcat 5. Thanks, Back from vacations (still 1100 mails to review on various list) but you got rigth now my +1. Welcome on board JF (hey another JF ;) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [4.1.9] Fix for major bugs
Hi Remy, I've just attached some comments to the bug log (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7082) that were posted to the user list a week or so ago. They seem to explain exactly why this is happening. Have a read through and see what you think. Cheers. Dave. -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED]] Sent: 15 August 2002 17:07 To: Tomcat Developers List Subject: Re: [4.1.9] Fix for major bugs David Oxley wrote: Has anyone looked at http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7082. Can anyone look at fixing this for 4.1.x? It may not be that easy to fix, but at least I undestand now why so many people reported problems with RMI. The bug has an easy workaround, and I don't want to risk braking things, so it may not be fixed for the first 4.1.x stable release. Remy -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [VOTE] New committer: Jean-Francois Arcand
All, Jean-François Arcand has received several +1's and no -1's. So, Jean-François, congratulations! Can someone create an account for Jean-François Arcand? Thanks, Patrick Patrick Luby wrote: I would like to propose that we add Jean-François Arcand as a Tomcat committer. I believe he has submitted enough patches to show that he will be a positive contributor to Tomcat 5. Thanks, Patrick -- Patrick Luby Email: [EMAIL PROTECTED] Sun Microsystems Phone: 408-276-7471 901 San Antonio Road, USCA14-303 Palo Alto, CA 94303-4900 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 11091] - Tomcat (4.1.7 - 4.1.9)-LE-jdk14 ignores error page specified in web.xml
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=11091. 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=11091 Tomcat (4.1.7 - 4.1.9)-LE-jdk14 ignores error page specified in web.xml [EMAIL PROTECTED] changed: What|Removed |Added Version|4.1.8 |4.1.9 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
jasper package
Jasper has command line option to set package name, but not true for JspServlet, I made some change to give user a chance to set the packageName in the servlet init parameter. What I have done is add getPackageName to Options class, modify JspServlet and ClassLoader to recognize this parameter, remove the hard-coded default package name Constants.JSP_PACKAGE_NAME. diff ./embededservletoptions.java \Jetty-4.1.0RC1\src\org\apache\jasper/embededservletoptions.java 81,83d80 /* the package name of the jsp class generated */ public String packageName = Constants.JSP_PACKAGE_NAME; 350,354d346 String tmpStr = config.getInitParameter(packageName); if (tmpStr != null ! .equals(tmpStr)) { packageName = tmpStr; } 360,366d351 /** * @see org.apache.jasper.Options#getPackageName() */ public String getPackageName() { return packageName; } diff ./jspc.java \Jetty-4.1.0RC1\src\org\apache\jasper/jspc.java 753,759d752 /** * @see org.apache.jasper.Options#getPackageName() */ public String getPackageName() { return targetPackage; } diff ./options.java \Jetty-4.1.0RC1\src\org\apache\jasper/options.java 150,155d149 /** * Package name of generated class. */ public String getPackageName(); diff ./jasperloader.java \Jetty-4.1.0RC1\src\org\apache\jasper\servlet/jasperloader.java 191,206c191,202 //if( !name.startsWith(Constants.JSP_PACKAGE_NAME) ) { try { ClassLoader classLoader = null; if (System.getSecurityManager() != null) { classLoader = (ClassLoader)AccessController.doPrivileged(privLoadClass); } else { classLoader = Thread.currentThread().getContextClassLoader(); } clazz = classLoader.loadClass(name); if( resolve ) resolveClass(clazz); return clazz; } catch (ClassNotFoundException e) { // context class load can not find the class, try jsp class loader } //} --- if( !name.startsWith(Constants.JSP_PACKAGE_NAME) ) { ClassLoader classLoader = null; if (System.getSecurityManager() != null) { classLoader = (ClassLoader)AccessController.doPrivileged(privLoadClass); } else { classLoader = Thread.currentThread().getContextClassLoader(); } clazz = classLoader.loadClass(name); if( resolve ) resolveClass(clazz); return clazz; } 209,210c205,207 //if( name.startsWith(Constants.JSP_PACKAGE_NAME) name.endsWith(className) ) { String classFile = name.substring(name.lastIndexOf(.) + 1) + .class; --- if( name.startsWith(Constants.JSP_PACKAGE_NAME + . + className) ) { String classFile = name.substring(Constants.JSP_PACKAGE_NAME.length()+1) + .class; 226c223 //} --- } diff ./jspservlet.java \Jetty-4.1.0RC1\src\org\apache\jasper\servlet/jspservlet.java 127d126 249,251d247 /* added by houyunf to provide package support */ private String packagePath = ; 270,275c266 /* added by houyunf to support package name */ packagePath = options.getPackageName(); packagePath = packagePath.replace('.', '/'); --- 348,349c339 String basePackage = options.getPackageName()+.; // modified by houyunf //org.apache.jasper.; --- String basePackage = org.apache.jasper.; 533,537d522 String jspPackage = jspUri.substring(0, jspUri.lastIndexOf(/)); if (.equals(jspPackage)) jspPackage = null; if (jspPackage != null ) jspPackage = jspPackage.substring(1).replace('/', '.'); 542c527 outURI = outURI + packagePath; --- outURI = outURI + jspUri.substring(1,jspUri.lastIndexOf(/)+1); 544,545c529 outURI = outURI + / + packagePath; outURI = outURI + jspUri.substring(0,jspUri.lastIndexOf(/)+1); --- outURI = outURI + jspUri.substring(0,jspUri.lastIndexOf(/)+1);; 559,565d542 String packageName = options.getPackageName(); if (packageName == null || .equals(packageName)) packageName = jspPackage; else if (jspPackage != null) packageName = packageName + . + jspPackage; ctxt.setServletPackageName(packageName); 601c578 packageName + . +
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime ExpressionEvaluatorImpl.java ExpressionEvaluatorManager.java JspContextWrapper.java PageContextImpl.java
luehe 2002/08/19 09:54:17 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java JspDocumentParser.java JspUtil.java Node.java Parser.java ScriptingVariabler.java TagConstants.java TagFileProcessor.java TagLibraryInfoImpl.java Validator.java jasper2/src/share/org/apache/jasper/resources messages.properties messages_es.properties messages_ja.properties jasper2/src/share/org/apache/jasper/runtime ExpressionEvaluatorImpl.java ExpressionEvaluatorManager.java JspContextWrapper.java PageContextImpl.java Log: Adpated jasper to modified JSP 2.0 APIs, including the removal of the fragment-input directive and fragment-attribute and fragment-input TLD elements, and addition of the fragment subelement to attribute and variable. Revision ChangesPath 1.67 +25 -71 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.66 retrieving revision 1.67 diff -u -r1.66 -r1.67 --- Generator.java16 Aug 2002 23:18:54 - 1.66 +++ Generator.java19 Aug 2002 16:54:16 - 1.67 @@ -2337,16 +2337,15 @@ // Set parent if (!simpleTag) { if (parent != null) { - out.printin(if (!(); + out.printin(if (); out.print(parent); - out.println( instanceof javax.servlet.jsp.tagext.Tag))); + out.println( instanceof javax.servlet.jsp.tagext.SimpleTag)); out.pushIndent(); out.printin(tagHandlerVar); out.print(.setParent(); out.print(new javax.servlet.jsp.tagext.TagAdapter(); + out.print((javax.servlet.jsp.tagext.SimpleTag) ); out.print(parent); - out.print(, ); - out.print(null); // XXX out.println());); out.popIndent(); out.printil(else); @@ -2857,34 +2856,32 @@ } TagAttributeInfo[] attrInfos = tagInfo.getAttributes(); - TagFragmentAttributeInfo[] fragAttrInfos - = tagInfo.getFragmentAttributes(); - // Declare normal attributes + // Declare attributes if (attrInfos != null) { for (int i=0; iattrInfos.length; i++) { - out.printin(private String ); + out.printin(private ); + if (attrInfos[i].isFragment()) { + out.print(javax.servlet.jsp.tagext.JspFragment ); + } else { + out.print(String ); + } out.print(attrInfos[i].getName()); out.println(;); } out.println(); } - // Declare fragment attributes - if (fragAttrInfos != null) { - for (int i=0; ifragAttrInfos.length; i++) { - out.printin(private javax.servlet.jsp.tagext.JspFragment ); - out.print(fragAttrInfos[i].getName()); - out.println(;); - } - out.println(); - } - - // Define getter and setter methods for normal attributes + // Define attribute getter and setter methods if (attrInfos != null) { for (int i=0; iattrInfos.length; i++) { // getter method - out.printin(public String ); + out.printin(public ); + if (attrInfos[i].isFragment()) { + out.print(javax.servlet.jsp.tagext.JspFragment ); + } else { + out.print(String ); + } out.print(toGetterMethod(attrInfos[i].getName())); out.println( {); out.pushIndent(); @@ -2898,7 +2895,11 @@ // setter method out.printin(public void ); out.print(toSetterMethodName(attrInfos[i].getName())); - out.printin((String ); + if (attrInfos[i].isFragment()) { + out.printin((javax.servlet.jsp.tagext.JspFragment ); + } else { + out.printin((String ); + } out.print(attrInfos[i].getName()); out.println() {); out.pushIndent(); @@ -2912,39 +2913,6 @@ out.println(); } } - - // Define getter and setter methods for fragment attributes - if (fragAttrInfos != null) { - for (int i=0;
DO NOT REPLY [Bug 11826] New: - Error rthrown on Console after configuring Global JNDI resource
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=11826. 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=11826 Error rthrown on Console after configuring Global JNDI resource Summary: Error rthrown on Console after configuring Global JNDI resource Product: Tomcat 5 Version: Nightly Build Platform: Other OS/Version: All Status: NEW Severity: Critical Priority: Other Component: Catalina AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] These are the steps that need to be followed: 1. Using the Admin tool create a Global JNDI resource for a datasource 2. Save the changes 3. Restart Tomcat 4. On the console an error is thrown that says: GlobalResourcesLifecycleListener: Exception processing Global JNDI Resources javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:189) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301) at org.apache.naming.NamingContext.lookup(NamingContext.java:835) at org.apache.naming.NamingContext.lookup(NamingContext.java:194) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:205) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:210) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:176) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:147) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2181) at org.apache.catalina.startup.Catalina.start(Catalina.java:510) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) Starting service Tomcat-Standalone -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 11829] New: - Unable to use Property editors with jsp:attribute
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=11829. 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=11829 Unable to use Property editors with jsp:attribute Summary: Unable to use Property editors with jsp:attribute Product: Tomcat 5 Version: Nightly Build Platform: All OS/Version: Other Status: NEW Severity: Major Priority: Other Component: Jasper2 AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] This happens while using jsp:setProperty. Section 2.13.1 of the JSP Spec says that a property editor can be used for implict concversion od the property values assigned via jsp:setProperty. I have a property editor defined for a Date . I use jsp:attribute to set the value of the Date via jsp:setProperty, and an Illegal Argument exception is thrown. Here is the sample jsp: = !-- This JSP tests to see if a Property Editor works fine with jsp:attribute -- %@page contentType=text/html% html headtitlePosPETestDate/title/head body !-- This JSP is used to test the PropertyEditor.setAstext() method -- jsp:useBean id=peTest class=bean.propeditor.PETest / jsp:setProperty name=peTest property=dateOfBirth jsp:attribute name=value 01.02.2001 /jsp:attribute /jsp:setProperty The Date of Birth is : jsp:getProperty name =peTest property=dateOfBirth / /body /html == This works fine if the value of the date is given as an XML attribute. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 11754] - Synchronous shutdown script - shutdown.sh should wait until Tomcat is fully shut down
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=11754. 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=11754 Synchronous shutdown script - shutdown.sh should wait until Tomcat is fully shut down --- Additional Comments From [EMAIL PROTECTED] 2002-08-19 18:13 --- Anders Madsen posts the following workaround for Linux (tomcat-dev, 19 Aug 2002). Note that this is merely a patch for the init.d script. A solution built in to the stop script itself would be more versatile. --- From: Golden Planet Support [EMAIL PROTECTED] Organization: Golden Planet To: [EMAIL PROTECTED] Date: Mon, 19 Aug 2002 09:57:31 +0200 Subject: Modified stop-script for Linux Priority: normal X-mailer: Pegasus Mail for Windows (v4.01) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello All I have noticed that the /etc/init.d/tomcat4 script still contains what is described as an Ugly hack - a short two second pause when restarting the service instead of something that confirms that all threads have been shut down. A while ago I modified my own script to conatain the following lines - perhaps they could be of some use for others, I don't know. I am by no means an experienced coder so please bear with me if this is not the most elegant solution - it just works for me... ;-) stop() { echo -n Stopping $TOMCAT_PROG: if [ -x /etc/rc.d/init.d/functions ]; then daemon --user $TOMCAT_USER $TOMCAT_SCRIPT stop else su - $TOMCAT_USER -c $TOMCAT_SCRIPT stop fi RETVAL=$? echo echo 'Waiting for java threads to finish...' threads=1 until [ $threads = '0' ] do ps -aux | grep $TOMCAT_USER -c /tmp/threads read threads /tmp/threads done rm -f /tmp/threads echo 'Java threads cleaned up - shutdown complete.' [ $RETVAL = 0 ] rm -f /var/lock/subsys/tomcat4 /var/run/tomcat4.pid } The above works on a x86 RedHat 7.1 - I don't know if things may work differently on other systems. --- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 11254] - mod_webapp sends status code 0 - Netscape 4 complains loudly
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=11254. 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=11254 mod_webapp sends status code 0 - Netscape 4 complains loudly [EMAIL PROTECTED] changed: What|Removed |Added AssignedTo|[EMAIL PROTECTED] |tomcat- ||[EMAIL PROTECTED] Component|All |Connector:Webapp Product|Apache httpd-2.0|Tomcat 4 Version|2.0.39 |Unknown --- Additional Comments From [EMAIL PROTECTED] 2002-08-19 18:15 --- Sending this over to tomcat. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Modified stop-script for Linux
Thanks! I added it to the recently-posted Bug 11754. You may want to add yourself as a CC on this to track its progress. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11754 - A On Mon, Aug 19, 2002 at 09:57:31AM +0200, Golden Planet Support wrote: Hello All I have noticed that the /etc/init.d/tomcat4 script still contains what is described as an Ugly hack - a short two second pause when restarting the service instead of something that confirms that all threads have been shut down. A while ago I modified my own script to conatain the following lines - perhaps they could be of some use for others, I don't know. I am by no means an experienced coder so please bear with me if this is not the most elegant solution - it just works for me... ;-) stop() { echo -n Stopping $TOMCAT_PROG: if [ -x /etc/rc.d/init.d/functions ]; then daemon --user $TOMCAT_USER $TOMCAT_SCRIPT stop else su - $TOMCAT_USER -c $TOMCAT_SCRIPT stop fi RETVAL=$? echo echo 'Waiting for java threads to finish...' threads=1 until [ $threads = '0' ] do ps -aux | grep $TOMCAT_USER -c /tmp/threads read threads /tmp/threads done rm -f /tmp/threads echo 'Java threads cleaned up - shutdown complete.' [ $RETVAL = 0 ] rm -f /var/lock/subsys/tomcat4 /var/run/tomcat4.pid } The above works on a x86 RedHat 7.1 - I don't know if things may work differently on other systems. -- Med venlig hilsen / Best regards Anders C. Madsen Golden Planet Tel.: +45 7020 9594 Dalbygade 40 Fax.: +45 7020 9592 DK-6000 Kolding http://www.goldenplanet.dk -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Alex Chaffee mailto:[EMAIL PROTECTED] jGuru - Java News and FAQs http://www.jguru.com/alex/ Creator of Gamelan http://www.gamelan.com/ Founder of Purple Technology http://www.purpletech.com/ Curator of Stinky Art Collective http://www.stinky.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DBCP multiple pools for multiple contexts under 4.0.4?
Glenn, Asar, In the meantime, I created another DataSourceFactory called a named datasource factory. It's simply a factory that keeps track of DataSource objects in a Hashtable keyed by a name passed in from the server.xml Reference Param block. If another context tries to reference a DataSource with the same name, the factory will look it up in the Hastable and return the existing DataSource. It's not a very glamorous approach, but it seems to work for now. In particular, chaching DataSource object at the Factory level might not be a good idea. I'm attaching the file here in case it is of interest or use to anyone on the list, although the Commons mailing list is probably a more appropriate place to post it. If you have any ideas or comments about this approach, I'd be very interested in reading them. Thnaks, Ike __ Isaac Arias - CTO Tokenzone, Inc. --- [EMAIL PROTECTED] wrote: Only it doesn't work in 4.1.x!! See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11662 On 17/08/2002 03:20:17 Glenn Nielsen wrote: No, I don't. The Host DefaultContext only defines the default context configuration. Any resources defined are instantiated for each individual context. GlobalNamingResource does indeed instantiate a resource which can be shared. So no, you can't do what you want to do with Tomcat 4.0.x. You would have to upgrade to 4.1.x. Regards, Glenn Isaac Arias wrote: Hi All, A couple of weeks ago I wrote about a Poolman DataSource factory for Tomcat, but the latest version of Poolman ended up being too buggy for production work. We've since moved to DBCP from Commons. I'm trying to configure a global DB pool for multiple contexts and I'm having trouble using the BasicDataSourceFactory with Tomcat 4.0.4. Since Tomcat 4.0.x doesn't support the GlobalNamingResources structure (like 4.1.x) which sounds like the right thing to use, I'm placing the DBCP Resource in a DefaultContext. However, it appears that every time a context tries to access the pool, DBCP creates a brand new pool for that context instead of sharing a global one. Any ideas on how to configure this on 4.0.4? I guess one option would be to modify the BasicDataSourceFactory, but maybe there's a way to do it in the config files in 4.0.4. Is anybody using DBCP as a global pooler for multiple contexts? Thanks a lot! Ike _ Isaac Arias Tokenzone, Inc. __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] - --- Visit our Internet site at http://www.reuters.com Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Reuters Ltd. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com NamedDataSourceFactory.java Description: NamedDataSourceFactory.java -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java Validator.java
luehe 2002/08/19 11:44:42 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java Validator.java Log: Added support for 'var' attribute to jsp:invoke and jsp:doBody Revision ChangesPath 1.68 +26 -14 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- Generator.java19 Aug 2002 16:54:16 - 1.67 +++ Generator.java19 Aug 2002 18:44:42 - 1.68 @@ -1741,8 +1741,9 @@ } // Invoke fragment with parameter map - String varReader = n.getAttributeValue(varReader); - if (varReader != null) { + String varReaderAttr = n.getAttributeValue(varReader); + String varAttr = n.getAttributeValue(var); + if (varReaderAttr != null || varAttr != null) { out.printil(sout = new java.io.StringWriter();); out.print(toGetterMethod(n.getAttributeValue(fragment))); out.println(.invoke(sout, params);); @@ -1752,11 +1753,16 @@ } // Store varReader in appropriate scope - if (varReader != null) { + if (varReaderAttr != null || varAttr != null) { String scopeName = n.getAttributeValue(scope); out.printin(pageContext.setAttribute(); - out.print(quote(varReader)); - out.print(, new java.io.StringReader(sout.toString())); + if (varReaderAttr != null) { + out.print(quote(varReaderAttr)); + out.print(, new java.io.StringReader(sout.toString())); + } else { + out.print(quote(varAttr)); + out.print(, sout.toString()); + } if (scopeName != null) { out.print(, ); out.print(getScopeConstant(scopeName)); @@ -1816,8 +1822,9 @@ } // Invoke body with parameter map - String varReader = n.getAttributeValue(varReader); - if (varReader != null) { + String varReaderAttr = n.getAttributeValue(varReader); + String varAttr = n.getAttributeValue(var); + if (varReaderAttr != null || varAttr != null) { out.printil(sout = new java.io.StringWriter();); out.printil(getJspBody().invoke(sout, params);); } else { @@ -1825,11 +1832,16 @@ } // Store varReader in appropriate scope - if (varReader != null) { + if (varReaderAttr != null || varAttr != null) { String scopeName = n.getAttributeValue(scope); out.printin(pageContext.setAttribute(); - out.print(quote(varReader)); - out.print(, new java.io.StringReader(sout.toString())); + if (varReaderAttr != null) { + out.print(quote(varReaderAttr)); + out.print(, new java.io.StringReader(sout.toString())); + } else { + out.print(quote(varAttr)); + out.print(, sout.toString()); + } if (scopeName != null) { out.print(, ); out.print(getScopeConstant(scopeName)); @@ -2822,7 +2834,7 @@ out.printil(java.util.Map params = null;); // Declare writer used for storing result of fragment/body invocation - // if 'varReader' attribute is specified + // if 'varReader' or 'var' attribute is specified out.printil(java.io.Writer sout = null;); out.printil(javax.servlet.jsp.JspWriter out = pageContext.getOut();); 1.22 +32 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java Index: Validator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Validator.java19 Aug 2002 16:54:16 - 1.21 +++ Validator.java19 Aug 2002 18:44:42 - 1.22 @@ -359,6 +359,17 @@ private static final JspUtil.ValidAttribute[] bodyAttrs = { new JspUtil.ValidAttribute(value) }; +private static final JspUtil.ValidAttribute[] invokeAttrs = { +new JspUtil.ValidAttribute(fragment, true), + new JspUtil.ValidAttribute(var), + new JspUtil.ValidAttribute(varReader), + new JspUtil.ValidAttribute(scope) }; + +private
DO NOT REPLY [Bug 11798] - use of response.flushBuffer in .jsp script results in unterminated HTTP response/ browser hangs
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=11798. 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=11798 use of response.flushBuffer in .jsp script results in unterminated HTTP response/ browser hangs [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED OS/Version|All |Linux Resolution|WORKSFORME | --- Additional Comments From [EMAIL PROTECTED] 2002-08-19 19:14 --- Mmmmh, this is really happening very reproducibly. I had other people try this and we noticed the following: the first script run after the context was created succeeded, subsequent ones let the browser hang. The script will return after 1 minute (probably a browser timeout ..?). This appears to work on Solaris (I fixed the OS field above), however, it happens on different flavours of Linux (we tried Suse 7.1, Suse 7.2, RedHat 7.2). This also happens with J2SE1.4_01, and IBMJava2-131. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 11798] - use of response.flushBuffer in .jsp script results in unterminated HTTP response/ browser hangs
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=11798. 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=11798 use of response.flushBuffer in .jsp script results in unterminated HTTP response/ browser hangs [EMAIL PROTECTED] changed: What|Removed |Added OS/Version|Linux |All --- Additional Comments From [EMAIL PROTECTED] 2002-08-19 19:18 --- ... o.k. it sometimes works on Solaris. I set the platform back to all meaning I tried Solaris and Linux ... (sorry for the confusion). This was tried with 4.1.9. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Strange delays while Tomcat works
Hi, all! Introduction: we have Windows 2000 running SUN JDK 1.4.0, Tomcat 4.0.4 and our software, that uses Struts and taglibs. While requesting action from browser we have strange delays during whole request-serving process. In a words, action (servlet) receives a request, does some work, sends control to the JSP page, which prepares resulting HTML page for browser. This JSP page has a lot of custom tags instances (from jakarta-struts project and our own as well). Using debug output (an old method - System.out.println(...) ) we realized, that tomcat suddenly hangs up for some time - every time in different places of source code. Seems like it runs servlet (for less that 1 second), than makes some kind of preparing of JSP file (i think it's enough to compile servlet from it just one time - but not everytime, as we have) - for aproximately 5-6 seconds, and processes JSP page. The very strange behavior aoccurs right there - custom tags may be executed for 2,3,6 or even 10 seconds. In other time, after executing part of JSP page, debug output stops, and continues after 2-3 seconds. On computer we have stopped all background services, it has 1GHz Duron CPU and 512M RAM - so I think problem is not in hardware. May be some tuning of Tmcat conf files will help - some kind of buffer sizes etc. I couldn't find anything helpful not in server.xml, nor in web.xml of application. I'll repeat, such delays always occurs while procxessing the JSP page, almost every time - in different source location. But these delays realy slows whole project - so ANY KIND OF HELP AND/OR SUGGESTIONS would be taken in consideration with gratitude. Dev Zero G team http://devzerog.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler ScriptingVariabler.java
luehe 2002/08/19 13:29:12 Modified:jasper2/src/share/org/apache/jasper/compiler ScriptingVariabler.java Log: Fixed bug which caused VariableInfos to be ignored when determining which scripting vars need to be declared Revision ChangesPath 1.3 +21 -21 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ScriptingVariabler.java Index: ScriptingVariabler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ScriptingVariabler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ScriptingVariabler.java 19 Aug 2002 16:54:16 - 1.2 +++ ScriptingVariabler.java 19 Aug 2002 20:29:12 - 1.3 @@ -130,19 +130,14 @@ else ownRange = parent.getNumCount(); - if (tagVarInfos != null) { - for (int i=0; itagVarInfos.length; i++) { - if (tagVarInfos[i].getScope() != scope - || !tagVarInfos[i].getDeclare() - || tagVarInfos[i].getFragment() != null) { + if (varInfos != null) { + for (int i=0; ivarInfos.length; i++) { + if (varInfos[i].getScope() != scope + || !varInfos[i].getDeclare()) { continue; } - String varName = tagVarInfos[i].getNameGiven(); - if (varName == null) { - varName = n.getTagData().getAttributeString( - tagVarInfos[i].getNameFromAttribute()); - } - + String varName = varInfos[i].getVarName(); + if (scope == VariableInfo.AT_BEGIN || scope == VariableInfo.AT_END || (scope == VariableInfo.NESTED @@ -152,22 +147,27 @@ if (currentRange == null || ownRange.compareTo(currentRange) 0) { scriptVars.put(varName, ownRange); - vec.add(tagVarInfos[i]); + vec.add(varInfos[i]); } } else { // scope equals NESTED AND node implements BodyTag if (n.getCustomNestingLevel() == 0) { - vec.add(tagVarInfos[i]); + vec.add(varInfos[i]); } } } } else { - for (int i=0; ivarInfos.length; i++) { - if (varInfos[i].getScope() != scope - || !varInfos[i].getDeclare()) { + for (int i=0; itagVarInfos.length; i++) { + if (tagVarInfos[i].getScope() != scope + || !tagVarInfos[i].getDeclare() + || tagVarInfos[i].getFragment() != null) { continue; } - String varName = varInfos[i].getVarName(); + String varName = tagVarInfos[i].getNameGiven(); + if (varName == null) { + varName = n.getTagData().getAttributeString( + tagVarInfos[i].getNameFromAttribute()); + } if (scope == VariableInfo.AT_BEGIN || scope == VariableInfo.AT_END @@ -178,7 +178,7 @@ if (currentRange == null || ownRange.compareTo(currentRange) 0) { scriptVars.put(varName, ownRange); - vec.add(varInfos[i]); + vec.add(tagVarInfos[i]); } } else { // scope equals NESTED AND node implements BodyTag -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: VOTE: Restoring Tomcat examples: Which workspace?
Vote: [X] A. jakarta-tomcat-catalina [ ] B. jakarta-tomcat-jasper [ ] C. jakarta-tomcat-5 Incidentally, my vote is A, but I'm flexible. - Mark On Mon, 2002-08-19 at 16:47, Mark Roth wrote: It would be great to restore the examples (both JSP and Servlet) so that they are deployed on startup and so they are easily accessible. In the current build they are broken links. I also would like to commit a number of additional JSP examples that illustrate the new features in JSP 2.0. The default web application that is deployed on startup currently lives in the catalina workspace. I have no problems keeping it there, but before committing such a change I wanted to take a vote on where we think the examples should live. Vote: [ ] A. jakarta-tomcat-catalina [ ] B. jakarta-tomcat-jasper [ ] C. jakarta-tomcat-5 -- Mark Roth, Java Software Co-Specification Lead for JSP 2.0 Sun Microsystems, Inc. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler ScriptingVariabler.java
luehe 2002/08/19 14:16:47 Modified:jasper2/src/share/org/apache/jasper/compiler Tag: tomcat_4_branch ScriptingVariabler.java Log: Fixed bug which caused VariableInfos to be ignored when determining which scripting vars need to be declared Revision ChangesPath No revision No revision 1.1.2.2 +20 -20 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ScriptingVariabler.java Index: ScriptingVariabler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ScriptingVariabler.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- ScriptingVariabler.java 17 Aug 2002 00:14:23 - 1.1.2.1 +++ ScriptingVariabler.java 19 Aug 2002 21:16:46 - 1.1.2.2 @@ -130,18 +130,14 @@ else ownRange = parent.getNumCount(); - if (tagVarInfos != null) { - for (int i=0; itagVarInfos.length; i++) { - if (tagVarInfos[i].getScope() != scope - || !tagVarInfos[i].getDeclare()) { + if (varInfos != null) { + for (int i=0; ivarInfos.length; i++) { + if (varInfos[i].getScope() != scope + || !varInfos[i].getDeclare()) { continue; } - String varName = tagVarInfos[i].getNameGiven(); - if (varName == null) { - varName = n.getTagData().getAttributeString( - tagVarInfos[i].getNameFromAttribute()); - } - + String varName = varInfos[i].getVarName(); + if (scope == VariableInfo.AT_BEGIN || scope == VariableInfo.AT_END || (scope == VariableInfo.NESTED @@ -151,22 +147,26 @@ if (currentRange == null || ownRange.compareTo(currentRange) 0) { scriptVars.put(varName, ownRange); - vec.add(tagVarInfos[i]); + vec.add(varInfos[i]); } } else { // scope equals NESTED AND node implements BodyTag if (n.getCustomNestingLevel() == 0) { - vec.add(tagVarInfos[i]); + vec.add(varInfos[i]); } } } } else { - for (int i=0; ivarInfos.length; i++) { - if (varInfos[i].getScope() != scope - || !varInfos[i].getDeclare()) { + for (int i=0; itagVarInfos.length; i++) { + if (tagVarInfos[i].getScope() != scope + || !tagVarInfos[i].getDeclare()) { continue; } - String varName = varInfos[i].getVarName(); + String varName = tagVarInfos[i].getNameGiven(); + if (varName == null) { + varName = n.getTagData().getAttributeString( + tagVarInfos[i].getNameFromAttribute()); + } if (scope == VariableInfo.AT_BEGIN || scope == VariableInfo.AT_END @@ -177,7 +177,7 @@ if (currentRange == null || ownRange.compareTo(currentRange) 0) { scriptVars.put(varName, ownRange); - vec.add(varInfos[i]); + vec.add(tagVarInfos[i]); } } else { // scope equals NESTED AND node implements BodyTag -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JspFactory.getDefaultFactory() returns null when JSP is statically compiled (v. 401)
Hello Tomcat Developers: Can anyone tell me why the following JSP/servlet call: _jspxFactory = JspFactory.getDefaultFactory(); would return null when my JSP page is statically compiled? The JSP to java transform is done via jspc/ant and everything seems to compile okay, as does the resulting web.xml file. The problem is that when the resulting servlet is hit, I get an empty page back (status = 200). The blank page is caused by 'getDefaultFactory() returning null. I know from installing print statements that a NPE is generated, but there is no trace of it in any of the TC logs. I suspect that my problem is due to some difference between my runtime environment and TCs but I sure can't see what the problem might be. I've been slogging away at this for a couple of days now, any pointers to a solution would be very much appreciated (including where is can download the javax.servlet sources from). Environment = TC 4.01/JDK 1.4 on Windows XP. TIA, Eric Gilbertson [EMAIL PROTECTED] P.S. I apologize to anyone who considers this an inappropriate question for tomcat-dev. I have tried tomcat-user and every tomcat archive I can find but I have not been able to find anything on this. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: jasper package
On Mon, 19 Aug 2002, [gb2312] Yunfeng Hou wrote: Date: Mon, 19 Aug 2002 11:35:17 +0800 (CST) From: [gb2312] Yunfeng Hou [EMAIL PROTECTED] Reply-To: Tomcat Developers List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: jasper package Jasper has command line option to set package name, but not true for JspServlet, I made some change to give user a chance to set the packageName in the servlet init parameter. Personally, I think supporting this at all is a *really* bad idea ... the JSP spec is very clear that the container is free to put the generated classes in whatever package it wants to (even different ones for different pages), so it seems very counter-productive to allow a user to tie themselves to a particular version of the JSP page compiler on a particular container that happens to implement this kind of option. A desire to do this in the first place probably comes from wanting to use unpackaged classes without importing them -- which is both against the JSP spec and is also frowned on in general by the Java compiler in JDK 1.4 and later. You're MUCH better off putting your classes into packages and explicitly importing them. Craig McClanahan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/admin/WEB-INF web.xml
amyroh 2002/08/19 15:40:51 Modified:webapps/admin/WEB-INF web.xml Log: Revert back to old Servlet 2.3 schema. Newly introduced Expression Language feature in JSP 2.0 is not compatible with admin webapp internal tree building code. Revision ChangesPath 1.4 +20 -16jakarta-tomcat-catalina/webapps/admin/WEB-INF/web.xml Index: web.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/web.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- web.xml 14 Aug 2002 19:37:14 - 1.3 +++ web.xml 19 Aug 2002 22:40:51 - 1.4 @@ -1,11 +1,15 @@ ?xml version=1.0 encoding=ISO-8859-1? -web-app xmlns=http://java.sun.com/xml/ns/j2ee; version=2.4 +!DOCTYPE web-app +PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN +http://java.sun.com/dtd/web-app_2_3.dtd; +web-app + + display-nameTomcat Administration Application/display-name description Tomcat HTML based administration web application. /description - display-nameTomcat Administration Application/display-name !-- Example filter to set character encoding on each request. Uncomment this filter definition and the mapping to use @@ -93,20 +97,20 @@ /servlet-mapping !-- Struts Tag Library Descriptors -- - jsp-config -taglib - taglib-uri/WEB-INF/struts-bean.tld/taglib-uri - taglib-location/WEB-INF/struts-bean.tld/taglib-location -/taglib -taglib - taglib-uri/WEB-INF/struts-html.tld/taglib-uri - taglib-location/WEB-INF/struts-html.tld/taglib-location -/taglib -taglib - taglib-uri/WEB-INF/struts-logic.tld/taglib-uri - taglib-location/WEB-INF/struts-logic.tld/taglib-location -/taglib - /jsp-config + taglib +taglib-uri/WEB-INF/struts-bean.tld/taglib-uri +taglib-location/WEB-INF/struts-bean.tld/taglib-location + /taglib + + taglib +taglib-uri/WEB-INF/struts-html.tld/taglib-uri +taglib-location/WEB-INF/struts-html.tld/taglib-location + /taglib + + taglib +taglib-uri/WEB-INF/struts-logic.tld/taglib-uri +taglib-location/WEB-INF/struts-logic.tld/taglib-location + /taglib !-- Security is active on entire directory -- security-constraint -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [VOTE] New committer: Jean-Francois Arcand
Thanks everybody! Now you can say you have a Quebecois as a commiter ;-) -- Jeanfrancois Patrick Luby wrote: All, Jean-François Arcand has received several +1's and no -1's. So, Jean-François, congratulations! Can someone create an account for Jean-François Arcand? Thanks, Patrick Patrick Luby wrote: I would like to propose that we add Jean-François Arcand as a Tomcat committer. I believe he has submitted enough patches to show that he will be a positive contributor to Tomcat 5. Thanks, Patrick -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler ImplicitTagLibraryInfo.java Parser.java ParserController.java TagFileProcessor.java
luehe 2002/08/19 16:06:01 Modified:jasper2/src/share/org/apache/jasper/compiler ImplicitTagLibraryInfo.java Parser.java ParserController.java TagFileProcessor.java Log: - When dealing with tag files underneath /WEB-INF/tags/, *always* generate an implicit Tag Library Descriptor, regardless of whether a TLD file is present in the tag file directory - Removed 'name' attribute from tag directive. Revision ChangesPath 1.6 +4 -31 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java Index: ImplicitTagLibraryInfo.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ImplicitTagLibraryInfo.java 31 Jul 2002 23:45:50 - 1.5 +++ ImplicitTagLibraryInfo.java 19 Aug 2002 23:06:01 - 1.6 @@ -77,14 +77,11 @@ public class ImplicitTagLibraryInfo extends TagLibraryInfo { private static final String WEB_INF_TAGS = /WEB-INF/tags/; -private static final String TLD_SUFFIX = .tld; private static final String TAG_FILE_SUFFIX = .tag; private static final String TAGS_SHORTNAME = tags; private static final String TLIB_VERSION = 1.0; private static final String JSP_VERSION = 2.0; -private String tldFile; - /** * Constructor. */ @@ -117,10 +114,7 @@ Iterator it = dirList.iterator(); while (it.hasNext()) { String path = (String) it.next(); - if (path.endsWith(TLD_SUFFIX)) { - tldFile = path; - break; - } else if (path.endsWith(TAG_FILE_SUFFIX)) { + if (path.endsWith(TAG_FILE_SUFFIX)) { // use the filename of the tag file, without the .tag // extension, as the name subelement of the imaginary // tag-file element @@ -138,26 +132,5 @@ this.tagFiles = new TagFileInfo[vec.size()]; vec.copyInto(this.tagFiles); } -} - -public static TagLibraryInfo getTabLibraryInfo(JspCompilationContext ctxt, -ParserController pc, -String prefix, -String tagdir, -ErrorDispatcher err) - throws JasperException { - - TagLibraryInfo tagLibInfo = new ImplicitTagLibraryInfo(ctxt, pc, -prefix, tagdir, -err); - if (((ImplicitTagLibraryInfo) tagLibInfo).tldFile != null) { - // tagdir contains TLD file - String[] location = new String[2]; - location[0] = ((ImplicitTagLibraryInfo) tagLibInfo).tldFile; - tagLibInfo = new TagLibraryInfoImpl(ctxt, pc, prefix, tagdir, - location, err); - } - - return tagLibInfo; } } 1.21 +8 -9 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java Index: Parser.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Parser.java 19 Aug 2002 16:54:16 - 1.20 +++ Parser.java 19 Aug 2002 23:06:01 - 1.21 @@ -376,12 +376,11 @@ } else { String tagdir = attrs.getValue(tagdir); if (tagdir != null) { - tagLibInfo = ImplicitTagLibraryInfo.getTabLibraryInfo( -ctxt, - parserController, - prefix, - tagdir, - err); + tagLibInfo = new ImplicitTagLibraryInfo(ctxt, + parserController, + prefix, + tagdir, + err); } } if (tagLibInfo != null) { 1.10 +0 -10 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java Index: ParserController.java
cvs commit: jakarta-tomcat-4.0/webapps/admin/context context.jsp
amyroh 2002/08/19 16:10:17 Modified:webapps/admin/context context.jsp Log: Change so that workDir is not editable since when Catalina starts up, it calculates a value for this property. Let it just use the default value. Revision ChangesPath 1.10 +2 -2 jakarta-tomcat-4.0/webapps/admin/context/context.jsp Index: context.jsp === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/context/context.jsp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- context.jsp 24 Jul 2002 00:03:23 - 1.9 +++ context.jsp 19 Aug 2002 23:10:17 - 1.10 @@ -203,7 +203,7 @@ /controls:data /controls:row -%-- input only allowed on create transaction --% +%-- input only allowed on create transaction controls:row labelStyle=table-label-text dataStyle=table-normal-text controls:labelbean:message key=context.workdir/:/controls:label controls:data @@ -215,7 +215,7 @@ html:hidden property=workDir/ /logic:equal /controls:data -/controls:row +/controls:row--% /controls:table /td /tr -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/admin/context context.jsp
amyroh 2002/08/19 16:10:33 Modified:webapps/admin/context context.jsp Log: Change so that workDir is not editable since when Catalina starts up, it calculates a value for this property. Let it just use the default value. Revision ChangesPath 1.3 +2 -2 jakarta-tomcat-catalina/webapps/admin/context/context.jsp Index: context.jsp === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/context/context.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- context.jsp 24 Jul 2002 20:57:26 - 1.2 +++ context.jsp 19 Aug 2002 23:10:33 - 1.3 @@ -203,7 +203,7 @@ /controls:data /controls:row -%-- input only allowed on create transaction --% +%-- input only allowed on create transaction controls:row labelStyle=table-label-text dataStyle=table-normal-text controls:labelbean:message key=context.workdir/:/controls:label controls:data @@ -215,7 +215,7 @@ html:hidden property=workDir/ /logic:equal /controls:data -/controls:row +/controls:row--% /controls:table /td /tr -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java
luehe 2002/08/19 16:25:42 Modified:jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java Log: Implemented new PageContext method include(String relativeUrlPath, boolean flush) Revision ChangesPath 1.17 +14 -12 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java Index: PageContextImpl.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- PageContextImpl.java 19 Aug 2002 16:54:17 - 1.16 +++ PageContextImpl.java 19 Aug 2002 23:25:42 - 1.17 @@ -395,21 +395,23 @@ } public void include(String relativeUrlPath) -throws ServletException, IOException -{ + throws ServletException, IOException { + JspRuntimeLibrary.include((HttpServletRequest) request, (HttpServletResponse) response, - relativeUrlPath, out, true); -/* -String path = getAbsolutePathRelativeToContext(relativeUrlPath); -context.getRequestDispatcher(path).include( - request, new ServletResponseWrapperInclude(response, out)); -*/ + relativeUrlPath, + out, + true); } public void include(String relativeUrlPath, boolean flush) throws ServletException, IOException { - include(relativeUrlPath, false); // XXX + +JspRuntimeLibrary.include((HttpServletRequest) request, + (HttpServletResponse) response, + relativeUrlPath, + out, + flush); } public VariableResolver getVariableResolver() { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 10410] - Adding 1 Resource-link element results in multiple displayed in admin webapp
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=10410. 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=10410 Adding 1 Resource-link element results in multiple displayed in admin webapp [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||WORKSFORME --- Additional Comments From [EMAIL PROTECTED] 2002-08-19 23:36 --- It works fine for me. The admin webapp correctly adds resource-link elements. No duplications of resource-link elements. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: jtc rpms
On Tue, 2002-08-20 at 00:50, Henri Gomez wrote: Welcome back from holidays, hope you had a good time... I propose to create a snapshot subdir in jtc, snapshot, and provide here the necessary binaries, for example Linux rpms .so, windows, netware, iis are welcome also. http://jakarta.apache.org/builds/jakarta-tomcat-connectors/snapshot/rpms/ We could have right now : http://jakarta.apache.org/builds/jakarta-tomcat-connectors/snapshot/v4.1.9-beta/ rpms/ What do you think about that ? I think this is generally a good idea but I just wanted to clear another possible source of confusion. Is there some sort of dependency between modules and Apache 2.0.x versions? I ran into this with mod_jk 1.2.0 from CVS (i.e. had to rebuild the module when the version of Apache was bumped from 2.0.39 to 2.0.40). I almost always do static linking, but I was wandering if that applies to DSO's as well (my experience with building PHP 4.2.2 tells me it does). If so, I think we should also clearly mark what Apache version that particular module is for. Also, do we need to tie JTC to a particular Tomcat version, like in your example to 4.1.9? My understanding is that the web server (Apache) part doesn't care much about what's behind it, as long as it speaks the correct protocol version. Maybe there should be a README file instead, listing all known Tomcat version combos for a particular JTC version... Bojan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[PATCH] [Catalina]
Hi, this patch implements a new SAX's entity resolver that will re-direct any remote schema/dtd locally. The patch implements a workaround for the warning problem when using Xerces 2.0.1 (see Remy's email). It also supports the current Xerces nightly build. I was unable to find a workaround for the StackOverflowException when using Xerces 2.0.2. At least we have one Xerces released version that work (very slow, that's why I gonna start adding validation switch on/off :-) ) Thanks, -- Jeanfrancois Index: ContextConfig.java === RCS file: /home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v retrieving revision 1.8 diff -u -r1.8 ContextConfig.java --- ContextConfig.java 10 Aug 2002 22:42:34 - 1.8 +++ ContextConfig.java 20 Aug 2002 00:46:48 - @@ -124,9 +124,11 @@ import org.apache.catalina.deploy.SecurityConstraint; import org.apache.catalina.loader.Extension; import org.apache.catalina.util.StringManager; +import org.apache.catalina.util.SchemaResolver; import org.apache.catalina.valves.ValveBase; import org.apache.commons.digester.Digester; import org.xml.sax.InputSource; +import org.xml.sax.EntityResolver; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXParseException; @@ -275,12 +277,15 @@ try { URL url = servletContext.getResource(Constants.ApplicationWebXml); + InputSource is = new InputSource(url.toExternalForm()); is.setByteStream(stream); webDigester.setDebug(getDebug()); if (context instanceof StandardContext) { ((StandardContext) context).setReplaceWelcomeFiles(true); } + + webDigester.clear(); webDigester.push(context); webDigester.parse(is); @@ -482,25 +487,51 @@ Digester tldDigester = new Digester(); tldDigester.setNamespaceAware(true); tldDigester.setValidating(true); + +if (tldDigester.getFactory().getClass().getName().indexOf(xerces)!=-1) { +tldDigester = patchXerces(tldDigester); +} + +// Set the schemaLocation +url = ContextConfig.class.getResource(Constants.TldSchemaResourcePath_20); +SchemaResolver tldEntityResolver = new SchemaResolver(url.toString()); +tldDigester.setSchema(url.toString()); + url = ContextConfig.class.getResource(Constants.TldDtdResourcePath_11); -tldDigester.register(Constants.TldDtdPublicId_11, - url.toString()); +tldEntityResolver.register(Constants.TldDtdPublicId_11, + url.toString()); + url = ContextConfig.class.getResource(Constants.TldDtdResourcePath_12); -tldDigester.register(Constants.TldDtdPublicId_12, - url.toString()); - -url = ContextConfig.class.getResource(Constants.TldSchemaResourcePath_20); -// to support servlet.jar that does not contains the schema -if (url != null){ -tldDigester.setSchema(url.toString()); -tldDigester = registerLocalSchema(tldDigester); -} - +tldEntityResolver.register(Constants.TldDtdPublicId_12, + url.toString()); + +tldEntityResolver = registerLocalSchema(tldEntityResolver); + +tldDigester.setEntityResolver(tldEntityResolver); tldDigester.addRuleSet(new TldRuleSet()); return (tldDigester); } + +private static Digester patchXerces(Digester digester){ +// This feature is needed for backward compatibility with old DDs +// which used Java encoding names such as ISO8859_1 etc. +// with Crimson (bug 4701993). By default, Xerces does not +// support ISO8859_1. +try{ +digester.setFeature( +http://apache.org/xml/features/allow-java-encodings;, true); +} catch(ParserConfigurationException e){ +// log(contextConfig.registerLocalSchema, e); +} catch(SAXNotRecognizedException e){ +// log(contextConfig.registerLocalSchema, e); +} catch(SAXNotSupportedException e){ +// log(contextConfig.registerLocalSchema, e); +} +return digester; +} + /** * Create (if necessary) and return a Digester configured to process the @@ -512,26 +543,28 @@ Digester webDigester = new Digester(); webDigester.setNamespaceAware(true); webDigester.setValidating(true); + +if (webDigester.getFactory().getClass().getName().indexOf(xerces)!=-1) { +webDigester =
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java
luehe 2002/08/19 18:07:55 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java Log: Renamed non-standard 'sout' to '_jspx_sout' Revision ChangesPath 1.69 +12 -12 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- Generator.java19 Aug 2002 18:44:42 - 1.68 +++ Generator.java20 Aug 2002 01:07:55 - 1.69 @@ -1744,9 +1744,9 @@ String varReaderAttr = n.getAttributeValue(varReader); String varAttr = n.getAttributeValue(var); if (varReaderAttr != null || varAttr != null) { - out.printil(sout = new java.io.StringWriter();); + out.printil(_jspx_sout = new java.io.StringWriter();); out.print(toGetterMethod(n.getAttributeValue(fragment))); - out.println(.invoke(sout, params);); + out.println(.invoke(_jspx_sout, params);); } else { out.print(toGetterMethod(n.getAttributeValue(fragment))); out.println(.invoke(null, params);); @@ -1758,10 +1758,10 @@ out.printin(pageContext.setAttribute(); if (varReaderAttr != null) { out.print(quote(varReaderAttr)); - out.print(, new java.io.StringReader(sout.toString())); + out.print(, new java.io.StringReader(_jspx_sout.toString())); } else { out.print(quote(varAttr)); - out.print(, sout.toString()); + out.print(, _jspx_sout.toString()); } if (scopeName != null) { out.print(, ); @@ -1825,8 +1825,8 @@ String varReaderAttr = n.getAttributeValue(varReader); String varAttr = n.getAttributeValue(var); if (varReaderAttr != null || varAttr != null) { - out.printil(sout = new java.io.StringWriter();); - out.printil(getJspBody().invoke(sout, params);); + out.printil(_jspx_sout = new java.io.StringWriter();); + out.printil(getJspBody().invoke(_jspx_sout, params);); } else { out.printil(getJspBody().invoke(null, params);); } @@ -1837,10 +1837,10 @@ out.printin(pageContext.setAttribute(); if (varReaderAttr != null) { out.print(quote(varReaderAttr)); - out.print(, new java.io.StringReader(sout.toString())); + out.print(, new java.io.StringReader(_jspx_sout.toString())); } else { out.print(quote(varAttr)); - out.print(, sout.toString()); + out.print(, _jspx_sout.toString()); } if (scopeName != null) { out.print(, ); @@ -2835,7 +2835,7 @@ // Declare writer used for storing result of fragment/body invocation // if 'varReader' or 'var' attribute is specified - out.printil(java.io.Writer sout = null;); + out.printil(java.io.Writer _jspx_sout = null;); out.printil(javax.servlet.jsp.JspWriter out = pageContext.getOut();); generatePageScopedVariables(tagInfo); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java
luehe 2002/08/19 18:37:30 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java Log: Removed javax.servlet.jsp.tagext.AttributeNotSupportedException Revision ChangesPath 1.70 +4 -13 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- Generator.java20 Aug 2002 01:07:55 - 1.69 +++ Generator.java20 Aug 2002 01:37:30 - 1.70 @@ -2433,8 +2433,6 @@ } if (attrs[i].isDynamic()) { - out.printil(try {); - out.pushIndent(); out.printin(tagHandlerVar); out.print(.); out.print(setDynamicAttribute(\); @@ -2444,13 +2442,6 @@ out.print(\, ); out.print(attrValue); out.println();); - out.popIndent(); - out.printin(}); // catch - out.println( catch (javax.servlet.jsp.tagext.AttributeNotSupportedException e) {); - out.pushIndent(); - out.printil(throw new javax.servlet.jsp.JspException(e);); - out.popIndent(); - out.printil(}); // catch } else { out.printin(tagHandlerVar); out.print(.); @@ -2934,7 +2925,7 @@ * variable can later be created for it. */ public void generateSetDynamicAttribute() { -out.printil(public void setDynamicAttribute(String uri, String localName, Object value) throws javax.servlet.jsp.tagext.AttributeNotSupportedException {); +out.printil(public void setDynamicAttribute(String uri, String localName, Object value) throws javax.servlet.jsp.JspException {); out.pushIndent(); out.printil(if (uri != null)); out.pushIndent(); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java
luehe 2002/08/19 18:42:38 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java Log: Renamed non-standard 'params' to '_jspx_params' Revision ChangesPath 1.71 +13 -13 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.70 retrieving revision 1.71 diff -u -r1.70 -r1.71 --- Generator.java20 Aug 2002 01:37:30 - 1.70 +++ Generator.java20 Aug 2002 01:42:38 - 1.71 @@ -1724,7 +1724,7 @@ class ParamVisitor extends Node.Visitor { public void visit(Node.ParamAction n) throws JasperException { - out.printin(params.put(); + out.printin(_jspx_params.put(); out.print(quote(n.getAttributeValue(name))); out.print(, ); out.print(attributeValue(n.getValue(), false, @@ -1734,7 +1734,7 @@ } // Assemble parameter map - out.printil(params = new java.util.HashMap();); + out.printil(_jspx_params = new java.util.HashMap();); if (n.getBody() != null) { prepareParams(n); n.getBody().visit(new ParamVisitor()); @@ -1746,10 +1746,10 @@ if (varReaderAttr != null || varAttr != null) { out.printil(_jspx_sout = new java.io.StringWriter();); out.print(toGetterMethod(n.getAttributeValue(fragment))); - out.println(.invoke(_jspx_sout, params);); + out.println(.invoke(_jspx_sout, _jspx_params);); } else { out.print(toGetterMethod(n.getAttributeValue(fragment))); - out.println(.invoke(null, params);); + out.println(.invoke(null, _jspx_params);); } // Store varReader in appropriate scope @@ -1779,7 +1779,7 @@ class ParamVisitor extends Node.Visitor { public void visit(Node.ParamAction n) throws JasperException { - out.printin(params.put(); + out.printin(_jspx_params.put(); out.print(quote(n.getAttributeValue(name))); out.print(, ); out.print(attributeValue(n.getValue(), false, @@ -1789,7 +1789,7 @@ } // Assemble parameter map - out.printil(params = new java.util.HashMap();); + out.printil(_jspx_params = new java.util.HashMap();); if (n.getBody() != null) { prepareParams(n); n.getBody().visit(new ParamVisitor()); @@ -1804,7 +1804,7 @@ scope != VariableInfo.NESTED) { continue; } - out.printin(params.put(); + out.printin(_jspx_params.put(); String name = tagVars[i].getNameGiven(); if (name != null) { out.print(quote(name)); @@ -1826,9 +1826,9 @@ String varAttr = n.getAttributeValue(var); if (varReaderAttr != null || varAttr != null) { out.printil(_jspx_sout = new java.io.StringWriter();); - out.printil(getJspBody().invoke(_jspx_sout, params);); + out.printil(getJspBody().invoke(_jspx_sout, _jspx_params);); } else { - out.printil(getJspBody().invoke(null, params);); + out.printil(getJspBody().invoke(null, _jspx_params);); } // Store varReader in appropriate scope @@ -2822,7 +2822,7 @@ out.pushIndent(); out.printil(PageContext pageContext = new JspContextWrapper(getJspContext());); // Declare parameter map for fragment/body invocation - out.printil(java.util.Map params = null;); + out.printil(java.util.Map _jspx_params = null;); // Declare writer used for storing result of fragment/body invocation // if 'varReader' or 'var' attribute is specified -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-5 BUILDING.txt build.properties.default
patrickl2002/08/19 18:42:52 Modified:.BUILDING.txt build.properties.default Log: Update instructions to latest Digester build Submitted by: Jean-Francois Arcand ([EMAIL PROTECTED]) Revision ChangesPath 1.21 +2 -2 jakarta-tomcat-5/BUILDING.txt Index: BUILDING.txt === RCS file: /home/cvs/jakarta-tomcat-5/BUILDING.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- BUILDING.txt 16 Aug 2002 17:03:19 - 1.20 +++ BUILDING.txt 20 Aug 2002 01:42:52 - 1.21 @@ -217,7 +217,7 @@ (8) Download and Install the Commons Digester Binary Distribution -* Download a binary distribution (version 20020815 or later) from: +* Download a binary distribution (version 20020819 or later) from: http://jakarta.apache.org/builds/jakarta-commons/release/commons-digester 1.30 +2 -2 jakarta-tomcat-5/build.properties.default Index: build.properties.default === RCS file: /home/cvs/jakarta-tomcat-5/build.properties.default,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- build.properties.default 16 Aug 2002 17:03:19 - 1.29 +++ build.properties.default 20 Aug 2002 01:42:52 - 1.30 @@ -72,7 +72,7 @@ commons-daemon.loc=jakarta-commons-sandbox/daemon -# - Commons Digester, version 20020815 or later - +# - Commons Digester, version 20020819 or later - commons-digester.home=${base.path}/commons-digester commons-digester.lib=${commons-digester.home}/dist commons-digester.jar=${commons-digester.lib}/commons-digester.jar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util SchemaResolver.java
patrickl2002/08/19 20:26:37 Modified:catalina/src/share/org/apache/catalina/startup Constants.java ContextConfig.java Added: catalina/src/share/org/apache/catalina/util SchemaResolver.java Log: This patch implements a new SAX's entity resolver that will re-direct any remote schema/dtd locally. The patch implements a workaround for the warning problem when using Xerces 2.0.1. It also supports the current Xerces nightly build. I was unable to find a workaround for the StackOverflowException when using Xerces 2.0.2. At least we have one Xerces released version that work (very slow, that's why I am going to start adding validation switch on/off :-)). Submitted by: Jean-Francois Arcand ([EMAIL PROTECTED]) Revision ChangesPath 1.5 +9 -13 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Constants.java Index: Constants.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Constants.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Constants.java10 Aug 2002 22:42:34 - 1.4 +++ Constants.java20 Aug 2002 03:26:36 - 1.5 @@ -83,49 +83,45 @@ public static final String TldDtdPublicId_11 = -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN; public static final String TldDtdResourcePath_11 = -//conf/tld_11.dtd; /javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd; public static final String TldDtdPublicId_12 = -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN; public static final String TldDtdResourcePath_12 = -//conf/tld_12.dtd; /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd; public static final String TldSchemaPublicId_20 = -http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd;;; +web-jsptaglibrary_2_0.xsd;; public static final String TldSchemaResourcePath_20 = /javax/servlet/resources/web-jsptaglibrary_2_0.xsd; public static final String WebDtdPublicId_22 = -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN; public static final String WebDtdResourcePath_22 = -// conf/web_22.dtd; /javax/servlet/resources/web-app_2_2.dtd; public static final String WebDtdPublicId_23 = -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN; public static final String WebDtdResourcePath_23 = -// conf/web_23.dtd; /javax/servlet/resources/web-app_2_3.dtd; public static final String WebSchemaPublicId_24 = -http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;;; +web-app_2_4.xsd;; public static final String WebSchemaResourcePath_24 = /javax/servlet/resources/web-app_2_4.xsd; public static final String J2eeSchemaPublicId_14 = -http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd;;; +j2ee_1_4.xsd;; public static final String J2eeSchemaResourcePath_14 = /javax/servlet/resources/j2ee_1_4.xsd; public static final String W3cSchemaPublicId_10 = -http://www.w3.org/2001/xml.xsd;;; +xml.xsd;; public static final String W3cSchemaResourcePath_10 = /javax/servlet/resources/xml.xsd; public static final String JspSchemaPublicId_20 = -http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd;;; +jsp_2_0.xsd;; public static final String JspSchemaResourcePath_20 = /javax/servlet/resources/jsp_2_0.xsd; 1.9 +79 -59 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java Index: ContextConfig.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ContextConfig.java10 Aug 2002 22:42:34 - 1.8 +++ ContextConfig.java20 Aug 2002 03:26:36 - 1.9 @@ -124,9 +124,11 @@ import org.apache.catalina.deploy.SecurityConstraint; import org.apache.catalina.loader.Extension; import org.apache.catalina.util.StringManager; +import org.apache.catalina.util.SchemaResolver; import org.apache.catalina.valves.ValveBase; import org.apache.commons.digester.Digester; import org.xml.sax.InputSource; +import org.xml.sax.EntityResolver; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXParseException; @@ -275,12 +277,15 @@ try { URL url =
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties
kinman 2002/08/19 20:52:18 Modified:jasper2/src/share/org/apache/jasper EmbededServletOptions.java Options.java jasper2/src/share/org/apache/jasper/compiler Compiler.java PageInfo.java Parser.java ParserController.java TldLocationsCache.java Validator.java jasper2/src/share/org/apache/jasper/resources messages.properties Log: - Implemented JSP2.0 JSP configuration informantion in web.xml. Revision ChangesPath 1.10 +16 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java Index: EmbededServletOptions.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- EmbededServletOptions.java16 Jul 2002 19:30:51 - 1.9 +++ EmbededServletOptions.java20 Aug 2002 03:52:18 - 1.10 @@ -69,6 +69,7 @@ import org.apache.jasper.logging.Logger; import org.apache.jasper.compiler.TldLocationsCache; +import org.apache.jasper.compiler.JspConfig; import org.apache.jasper.xmlparser.ParserUtils; import java.util.*; @@ -164,6 +165,11 @@ private TldLocationsCache tldLocationsCache = null; /** + * Jsp config information + */ +JspConfig jspConfig = null; + +/** * Java platform encoding to generate the JSP * page servlet. */ @@ -279,6 +285,10 @@ return javaEncoding; } +public JspConfig getJspConfig() { + return jspConfig; +} + /** * Create an EmbededServletOptions object using data available from * ServletConfig and ServletContext. @@ -428,6 +438,9 @@ // Setup the global Tag Libraries location cache for this // web-application. tldLocationsCache = new TldLocationsCache(context); + + // Setup the jsp config info for this web app. + jspConfig = new JspConfig(context); } 1.8 +9 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java Index: Options.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Options.java 16 Jul 2002 19:30:51 - 1.7 +++ Options.java 20 Aug 2002 03:52:18 - 1.8 @@ -67,6 +67,7 @@ import javax.servlet.ServletContext; import org.apache.jasper.compiler.TldLocationsCache; +import org.apache.jasper.compiler.JspConfig; /** * A class to hold all init parameters specific to the JSP engine. @@ -161,4 +162,9 @@ * page servlet. */ public String getJavaEncoding(); + +/** + * Obtain JSP configuration informantion specified in web.xml. + */ +public JspConfig getJspConfig(); } 1.28 +20 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- Compiler.java 16 Aug 2002 23:18:54 - 1.27 +++ Compiler.java 20 Aug 2002 03:52:18 - 1.28 @@ -194,6 +194,23 @@ { // Setup page info area pageInfo = new PageInfo(new BeanRepository(ctxt.getClassLoader())); + JspConfig jspConfig = options.getJspConfig(); + JspConfig.JspProperty jspProperty = + jspConfig.findJspProperty(ctxt.getJspFile()); + if (jspProperty != null) { + // If the current uri is matched by a pattern specified in + // a jsp-property-group in web.xml, initialize pageInfo with + // those properties. + if (jspProperty.isXml() != null) { + pageInfo.setIsXmlSpecified(true); + } + pageInfo.setIsXml(JspUtil.booleanValue(jspProperty.isXml())); + pageInfo.setPageEncoding(jspProperty.getPageEncoding()); + pageInfo.setELEnabled(JspUtil.booleanValue(jspProperty.isELEnabled())); + pageInfo.setScriptingEnabled(JspUtil.booleanValue(jspProperty.isScriptingEnabled())); + pageInfo.setIncludePrelude(jspProperty.getIncludePrelude()); + pageInfo.setIncludeCoda(jspProperty.getIncludeCoda()); + } String javaFileName = ctxt.getServletJavaFileName(); 1.8 +43 -3
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler JspConfig.java
kinman 2002/08/19 20:54:54 Added: jasper2/src/share/org/apache/jasper/compiler JspConfig.java Log: - Added for JSP configuration support Revision ChangesPath 1.1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspConfig.java Index: JspConfig.java === /* * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspConfig.java,v 1.1 2002/08/20 03:54:54 kinman Exp $ * $Revision: 1.1 $ * $Date: 2002/08/20 03:54:54 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Tomcat, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.jasper.compiler; import java.util.Vector; import java.io.InputStream; import java.util.Iterator; import javax.servlet.ServletContext; import org.apache.jasper.Constants; import org.apache.jasper.logging.Logger; import org.apache.jasper.JasperException; import org.apache.jasper.xmlparser.ParserUtils; import org.apache.jasper.xmlparser.TreeNode; /** * Handles the jsp-config element in WEB_INF/web.xml. This is used * for specifying the JSP configuration informantion on a JSP page * * @authro Kin-man Chung */ public class JspConfig { static private final String WEB_XML = /WEB-INF/web.xml; private Vector jspProperties = null; private ServletContext ctxt; private boolean initialized = false; private String defaultIsXml = false; private String defaultIsELEnabled = true; private String defaultIsScriptingEnabled = true; public JspConfig(ServletContext ctxt) { this.ctxt = ctxt; } private void processWebDotXml(ServletContext ctxt) throws JasperException { InputStream is = ctxt.getResourceAsStream(WEB_XML); if (is == null) { // no web.xml return; } ClassLoader cl = this.getClass().getClassLoader(); ParserUtils pu = ParserUtils.createParserUtils(cl); TreeNode webApp = pu.parseXMLDocument(WEB_XML, is); if (webApp == null || !2.4.equals(webApp.findAttribute(version))) { System.out.println(Servlet 2.3); defaultIsELEnabled = false; return; }
Re: jasper package
A desire to do this in the first place probably comes from wanting to use unpackaged classes without importing them -- which is both against the JSP spec and is also frowned on in general by the Java compiler in JDK 1.4 and later. You're MUCH better off putting your classes No, I want this because I need it to debug my generated class file at runtime. Currently, jasper will always generate class in org.apache.jsp. For example, /abc/test.jsp will have class in $scratchDir/abc, and /abc/def/test.jsp will be generated in $scratchDir/abc/def, with the same package - org.apache.jsp! I can not even compile these classes, do you think it a good design? Or, what I need is compile and debug, I do not need that flexibility to specify package name, at least, I think jasper should support this: these jsps will have package name org.apache.jsp.abc and org.apache.jsp.abc.def respectively. Yunfeng Hou _ Do You Yahoo!? ÐÂÏʵ½µ×,ÓéÀÖµ½¼Ò - ÑÅ»¢ÍƳöÃâ·ÑÓéÀÖµç×ÓÖܱ¨! http://cn.ent.yahoo.com/newsletter/index.html -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: jasper package
On Tue, 20 Aug 2002, [gb2312] Yunfeng Hou wrote: Date: Tue, 20 Aug 2002 13:13:14 +0800 (CST) From: [gb2312] Yunfeng Hou [EMAIL PROTECTED] Reply-To: Tomcat Developers List [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Subject: Re: jasper package A desire to do this in the first place probably comes from wanting to use unpackaged classes without importing them -- which is both against the JSP spec and is also frowned on in general by the Java compiler in JDK 1.4 and later. You're MUCH better off putting your classes No, I want this because I need it to debug my generated class file at runtime. Currently, jasper will always generate class in org.apache.jsp. For example, /abc/test.jsp will have class in $scratchDir/abc, and /abc/def/test.jsp will be generated in $scratchDir/abc/def, with the same package - org.apache.jsp! I can not even compile these classes, do you think it a good design? Or, what I need is compile and debug, I do not need that flexibility to specify package name, at least, I think jasper should support this: these jsps will have package name org.apache.jsp.abc and org.apache.jsp.abc.def respectively. The Java compiler used by Tomcat doesn't have any problems compiling the sources that are currently being generated. What compiler are you trying to use that has problems with it? That's where your problem really appears to lie. Yunfeng Hou Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[PATCH] jakarta-tomcat-jasper: PFD features and bugfixes 1
Attached is a patch to move us towards JSP 2.0 PFD feature-complete. More to come in the next few days... - Implemented the value attribute of jsp:doBody for classic tag handlers. - Stubbed out JspC with getJspConfig() so it compiles. - Added null check for addInclude() to handle the case where there are no preludes or codas. - Now accepts /WEB-INF/tags as well as /WEB-INF/tags/ for tag file default directory. - ParserController now uses path name to determine if the given element is a tag file instead of searching for tag directive. - In a tag file, an attribute directive with a fragment attribute must not allow a rtexprvalue attribute, and must fix its value to true. Fixed implementation to comply with spec. - Fixed preamble and postamble generator for Tag Files. Was not generating declarations, tag handler pools, methods buffer, helper fragment, etc. Generator now shares code between servlet and tag handler pre and post ambles. - Even though spec is not clear that they're required, added implicit objects to doTag() so they are available in tag files. -- Mark Roth, Java Software JSP 2.0 Specification Co-Lead Sun Microsystems, Inc. Index: jasper2/src/share/org/apache/jasper/JspC.java === RCS file: /home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v retrieving revision 1.12 diff -u -r1.12 JspC.java --- jasper2/src/share/org/apache/jasper/JspC.java 26 Jun 2002 16:50:38 - 1.12 +++ jasper2/src/share/org/apache/jasper/JspC.java 20 Aug 2002 05:22:50 - @@ -75,6 +75,7 @@ import org.apache.jasper.logging.Logger; import org.apache.jasper.logging.JasperLogger; +import org.apache.jasper.compiler.JspConfig; /** * Shell for the jspc compiler. Handles all options associated with the @@ -912,6 +913,15 @@ Constants.jasperLog.setVerbosityLevel(verbosityLevel); } + +/** + * Obtain JSP configuration informantion specified in web.xml. + */ +public JspConfig getJspConfig() { +// XXX - Stubbed out so Jasper compiles. +initServletContext(); +return new JspConfig( context ); +} } Index: jasper2/src/share/org/apache/jasper/compiler/Generator.java === RCS file: /home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.71 diff -u -r1.71 Generator.java --- jasper2/src/share/org/apache/jasper/compiler/Generator.java 20 Aug 2002 01:42:38 - 1.71 +++ jasper2/src/share/org/apache/jasper/compiler/Generator.java 20 Aug 2002 05:22:53 - @@ -170,6 +170,7 @@ out.println(); page.visit(new DeclarationVisitor()); + out.println(); } /** @@ -329,23 +330,25 @@ } /** - * Generates the beginning of the static portion of the servelet. + * Generate preamble package name + * (shared by servlet and tag handler preamble generation) */ -private void generatePreamble(Node.Nodes page) throws JasperException { - - String servletPackageName = ctxt.getServletPackageName(); - String servletClassName = ctxt.getServletClassName(); - String serviceMethodName = Constants.SERVICE_METHOD_NAME; - - // First the package name: - - if (! .equals(servletPackageName) servletPackageName != null) { - out.printil(package + servletPackageName + ;); +private void genPreamblePackage( String packageName ) +throws JasperException +{ + if (! .equals(packageName) packageName != null) { + out.printil(package + packageName + ;); out.println(); } - - // Generate imports - +} + +/** + * Generate preamble imports + * (shared by servlet and tag handler preamble generation) + */ +private void genPreambleImports() +throws JasperException +{ Iterator iter = pageInfo.getImports().iterator(); while (iter.hasNext()) { out.printin(import ); @@ -353,31 +356,21 @@ out.println(;); } out.println(); +} - // Generate class declaration - - out.printin(public class ); - out.print (servletClassName); - out.print ( extends ); - out.print (pageInfo.getExtends()); - if (!pageInfo.isThreadSafe()) { - out.print(implements SingleThreadModel); - } - out.println( {); - out.pushIndent(); - - // Class body begins here - - generateDeclarations(page); - out.println(); - - // Static initializations here - +/** + * Generation of static initializers in preamble. + * For example, include list, el function map, prefix map. + * (shared by servlet and tag handler preamble generation) + */ +private void genPreambleStaticInitializers() +throws JasperException +{ // Static data for getIncludes() out.printil(private static java.util.Vector _jspx_includes;);
RE: jasper package
For the command line compiler, I've found it very useful. It specifies the base package for the compiled jsp pages. By matching that with the directory that the pages are output into, I can then point an ant javac task at them and validate that everything compiles correctly, as part of an automated build. That is, /index.jsp would go into ${output}/com/netfolio/compiled_jsp/index.java, and /dir/index.jsp would go into ${output}/com/netfolio/compiled_jsp/dir/index.java. So compiling them is just a matter of a plain compile of the ${output} directory. When JspC is working, that is. Haven't checked recently, but it's been broken as often as not. The runtime jsp compiler produces, or used to produce, java files that aren't suitable for compiling as a batch. The package didn't match up with the directory name. It simplified class reloading, IIRC, though. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 6:11 PM To: Tomcat Developers List Subject: Re: jasper package On Mon, 19 Aug 2002, [gb2312] Yunfeng Hou wrote: Date: Mon, 19 Aug 2002 11:35:17 +0800 (CST) From: [gb2312] Yunfeng Hou [EMAIL PROTECTED] Reply-To: Tomcat Developers List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: jasper package Jasper has command line option to set package name, but not true for JspServlet, I made some change to give user a chance to set the packageName in the servlet init parameter. Personally, I think supporting this at all is a *really* bad idea ... the JSP spec is very clear that the container is free to put the generated classes in whatever package it wants to (even different ones for different pages), so it seems very counter-productive to allow a user to tie themselves to a particular version of the JSP page compiler on a particular container that happens to implement this kind of option. A desire to do this in the first place probably comes from wanting to use unpackaged classes without importing them -- which is both against the JSP spec and is also frowned on in general by the Java compiler in JDK 1.4 and later. You're MUCH better off putting your classes into packages and explicitly importing them. Craig McClanahan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: jasper package
The compiler driver and classloader used by tomcat does a lot of magic to get it to work. All jsp files named, for example, index.jsp, will be compiled to a class named org.apache.jsp.index$jsp.java. It will be in a directory with the same name as the directory of the jsp file, but that's not represented in the package name. The classloader knows where the class file will reside, and then strips out everything but the filename part of the URI, prepends org.apache.jsp to it, and loads that class. The base VM classloader CAN NOT load the generated class files. So debugging with an IDE that doesn't have special hacks is a bit difficult. Even if you can convince it to load servlets and debug that code, convincing it to set a breakpoint in some class named org.apache.jsp.index$jsp, and leaving it to figure out which one, is usually impossible. Unless things have changed recently, then go ahead and ignore all this. I know this applied for 4.0.3. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 1:28 AM To: Tomcat Developers List Subject: Re: jasper package On Tue, 20 Aug 2002, [gb2312] Yunfeng Hou wrote: Date: Tue, 20 Aug 2002 13:13:14 +0800 (CST) From: [gb2312] Yunfeng Hou [EMAIL PROTECTED] Reply-To: Tomcat Developers List [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Subject: Re: jasper package A desire to do this in the first place probably comes from wanting to use unpackaged classes without importing them -- which is both against the JSP spec and is also frowned on in general by the Java compiler in JDK 1.4 and later. You're MUCH better off putting your classes No, I want this because I need it to debug my generated class file at runtime. Currently, jasper will always generate class in org.apache.jsp. For example, /abc/test.jsp will have class in $scratchDir/abc, and /abc/def/test.jsp will be generated in $scratchDir/abc/def, with the same package - org.apache.jsp! I can not even compile these classes, do you think it a good design? Or, what I need is compile and debug, I do not need that flexibility to specify package name, at least, I think jasper should support this: these jsps will have package name org.apache.jsp.abc and org.apache.jsp.abc.def respectively. The Java compiler used by Tomcat doesn't have any problems compiling the sources that are currently being generated. What compiler are you trying to use that has problems with it? That's where your problem really appears to lie. Yunfeng Hou Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] attachment: winmail.dat -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]