Tomcat 4.1 with JRE + tools.jar?
I know that the Tomcat 4.1 installation docs say that you need a JDK to run it, but does anyone know if it would work to run it on the 1.4 JRE with tools.jar included from the JDK? Would I also need javac? I found a similar question in the archives about running Tomcat with the JRE, and the general consensus was that you'd need to precompile JSPs, but that thread didn't consider including tools.jar and/or javac with the JRE. These files are now legal to redistribute along with it, and we'd like to be able to give customers all the software they need out-of-the-box, so that's why I ask. Thanks, -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863
RE: Is 4.1.18 ready?
I don't believe that 4.1.18 does taglib pooling any differently from 4.1.12. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Etienne [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:02 AM To: 'Tomcat Users List' Subject: Is 4.1.18 ready? Hi I just want to know is Tomcat 4.1.18 is a stable (production stable) version. (I am pretty sure it is, but I just want a confirmation from some gurus) My company is still using 4.1.12 because of some problems in 4.1.18. I didn't go further, but I think they didn't write compatible TagLibs to the 4.1.18 TagLib pooling... I guess the next Tomcat version will stay in the specification of 4.1.18. So we should jump into it now? Right? Etienne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Determine Presentation?
How about just stopping Tomcat and seeing if you can still get to your static content? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Dan Egan [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 10:05 AM To: [EMAIL PROTECTED] Subject: Determine Presentation? Hi, I am in the process of working with Tomcat and I wanted to know how I can determine the static content is being rendered by IIS. I made the recommended changes to IIS by creating a VD pointing to the webapp and modified the uriworkermap.properties file setting the URI path to the servlet folder. Everything works fine but the reason for this was to try and get a performance boost. Any help and insight by the group would be appreciated. Thanks, Daniel Egan Windows 2000 SQL Server 2000 Environment 8.0.1 Applications 8.0.2 Phone 401-421-7740 X396 Email [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unanswered questions
Check out http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#User%20 Web%20Applications It should be directoryName, not directory_name. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Felicia Neff [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 11:30 AM To: Tomcat Users List Subject: Re: Unanswered questions On Thu, 13 Feb 2003, Tim Funk wrote: 3. With the listener that uses 'homeBase' to read userdirs, I am only finding that a few directories are loaded. How do I debug this? Turn the debug levels higher. Where debug=0 -- debug=99 Unfortunately, that didn't help. It turns out that tomcat is looking for a public_html directory under the 'homeBase' directory. We don't have one. While I have linked public_html to . for testing, I would prefer a more elegant solution. I have already tried: Listener className=org.apache.catalina.startup.UserConfig directory_name=. homeBase=/htdocs/userdirs userClass=org.apache.catalina.startup.HomesUserDatabase/ and Listener className=org.apache.catalina.startup.UserConfig directory_name= homeBase=/htdocs/userdirs userClass=org.apache.catalina.startup.HomesUserDatabase/ Neither works. Any suggestions? -- Felicia ~~ [EMAIL PROTECTED] Panix Staff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP files between many webapps
Well unfortunately, the servlet spec doesn't really allow for useful interaction between webapps. Each one is considered to be its own independent environment, and you really can't share sessions between them without implementing your own session manager (as far as I know). -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:08 PM To: 'Tomcat-User List' Subject: JSP files between many webapps Hello folks, i´m doubt about which is the best way to share JSP files with many webapps ( in my case, i have 2 ), i don´t want copy the same JSP to another directory and every page is easy configurable with parameters like: http://127.0.0.1/jsp/financ/browseLoansBr.jsp?formAction=/exec/PF_Maintenanc eLoans I tried to call the JSP from another webapp ( /intranet for instance ) but it isn´t the same session or enviromnent, all that i want is not to use the same thing twice, waht i could do? With best wishes, Edson Alves Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP files between many webapps
I have to say that, while the webapp concept is nice in many respects, it's really not adequate for large, complex applications with multiple component modules. It certainly makes the simple, most common case far more manageable than it was before, but there are some projects (probably a growing number) for which the single-unit webapp model doesn't quite cut it, and those of us building systems like that are constantly struggling against the limitations of the servlet spec. :-\ -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 12:42 PM To: Tomcat Users List Subject: Re: JSP files between many webapps From: Edson Alves Pereira [EMAIL PROTECTED] Sent: Friday, February 14, 2003 10:08 AM Subject: JSP files between many webapps Hello folks, i´m doubt about which is the best way to share JSP files with many webapps ( in my case, i have 2 ), i don´t want copy the same JSP to another directory and every page is easy configurable with parameters like: Why not copy the JSPs? Is it difficult? It's a simple Ant task to copy files. There's nothing stopping you from keeping the JSPs in a common directory under your source tree and replicating them to the appropriate spots in the independent Webapps at build time. To be clear, this is a build issue, not a Webapp issue. The Webapp structure is strict, and basic. Your build environment is dynamic, fluid and organized to suit your tastes, preferences, and environment. These are not mutually incompatible premises. When compiling C programs, you have a common area for library routines on your system, and every time you build, the code gets copied from these libraries into your final executable. You end up with N copies of printf bundled across all of your different executables. This issue with the JSPs within the Webapp is absolutely no different. Make N Webapps, get N copies of the JSPs within those Webapps, yet they can all come from a single source. There is always (ALWAYS) this confusion that Webapps == the interlinked, mangled web of resources in a conventional website. The whole point of the Webapp is to avoid this mess. To cleanly and clearly demarcate the boundaries of what is within the Webapp and what is not. This ensures the the Webapp is moveable, easily, from one container to another. The downside is that you pay for it with disk space, but saving disk space has long ago been abandoned considering the drive densities of modern systems. The Webapp is your friend. Embrace it and be happy. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Announce] Another Tomcat FAQ
Thanks, Tim! I have some ideas for contributions that I have to write up. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 12:49 PM To: Tomcat Users List Subject: [Announce] Another Tomcat FAQ Here is another FAQ I just hastily together in light of recent events. There are sections which are incomplete. My goal is to have many some of the more common questions redirected to the FAQ. The site is hosted by comcast (my home ISP) since they can give me multiple web accounts with cable(which is NOT an advertisement for them, just a warning in case the site is unreachable). I have no idea how robust their user hosting is and apologize in advance if you can't reach the site. http://mywebpages.comcast.net/funkman/ -Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with using Tomcat and web.xml
You have to decide whether you want your application to be in the ROOT webapp (replacing the default) or in a separate webapp. You want either one of the following: C:\tomcat 4.1\webapps\ROOT\for the .JSP files C:\tomcat 4.1\webapps\ROOT\WEB-INF for the .TLD and .XML files C:\tomcat 4.1\webapps\ROOT\WEB-INF\classes\com\wrox\ch10 for the .java and .class files. or C:\tomcat 4.1\webapps\beginjsp_ch10 for the .JSP files C:\tomcat 4.1\webapps\beginjsp_ch10\WEB-INF for the .TLD and .XML files C:\tomcat 4.1\webapps\beginjsp_ch10\WEB-INF\classes\com\wrox\ch10 for the .java and .class files. In other words, new webapps go directly into $CATALINA_HOME\webapps, *not* into $CATALINA_HOME\webapps\ROOT. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Stan Williams [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:15 PM To: [EMAIL PROTECTED] Subject: Problem with using Tomcat and web.xml I am using Tomcat 4.1 and have the following problem: One JSP script that uses a WEB.XML file to locate the .TLD file does not seem to work The message is included ai the attachments along with all of my code ( samples from the Beginning JSP Web Development book from Wrox press). I am running the script ScriptingVariables4.JSP. The paths I am using are follows: C:\tomcat 4.1\webapps\ROOT\beginjsp_ch10 for the .JSP files C:\tomcat 4.1\webapps\ROOT\beginjsp_ch10\WEB-INF for the .TLD and .XML files C:\tomcat 4.1\webapps\ROOT\WEB-INF\classes\com\wrox\ch10 for the .java and .class files. The paths are preserved in the attached zip file. It would appear that I just don't have the web.xml file in the correct place, or the file is not formatted correctly.. I did try adding the information to the web.xml file in the C:\tomcat 4.1\webapps\ROOT\WEB-INF location, but that seems to break tomcat. Can you please help me on this. Thanks Stan Williams Phone: 2-2615 801-240-2615 800-453-3860 ex 22615 Address: 50 East North Temple Room, Dept: ICS, Room: 1912 Salt Lake City UT 84150 -- This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP files between many webapps
OK, let me give a brief description of the project I work on, and where the current webapp system falls short: We make a web application that is sold to hundreds of customers to install on their own servers. This is somewhat unusual, but isn't really in conflict with the spec. In fact, WARs can make it easier. Also, we are in fact heterogeneous; part Java and part perl. We're slowly migrating perl stuff to Java, but at the same time, we're starting to add some .Net components in the Windows version, so I think language heterogeneousness will always be a requirement. Even that's not the big problem, though. The big problem is that our product is evolving from an application to more of a tool platform. Our customers need to be able to install packaged extensions, at runtime, without interrupting service in any way. These extensions have both back-end functionality and JSP UIs. Furthermore, each extension has its own security restrictions: they run in a sandbox with only the permissions that the administrator approves when installing it. The way we've come up with to do that is to package the extensions as webapps, and to create a Tomcat-specific class to load and unload them. But we have some shared components: UI taglibs, for example, that we would *like* to centralize in the platform code, rather than duplicating them across each extension (with the associated risk of them falling out of sync). We've been able to do that to an extent, but in (IMO) inelegant, container-specific ways. It works, but it's not perfect. So what I'd like to see (maybe in Servlet 3.0) is some concept of a federation of cooperating but mostly independent webapps. Or perhaps a hierarchical webapp of some sort with pluggable modules and a standard API to load and unload them. I admit that our case is a bit unusual, but I think this sort of thing will become increasingly common. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:24 PM To: Tomcat Users List Subject: Re: JSP files between many webapps From: Tim Moore [EMAIL PROTECTED] Sent: Friday, February 14, 2003 9:52 AM Subject: RE: JSP files between many webapps I have to say that, while the webapp concept is nice in many respects, it's really not adequate for large, complex applications with multiple component modules. It certainly makes the simple, most common case far more manageable than it was before, but there are some projects (probably a growing number) for which the single-unit webapp model doesn't quite cut it, and those of us building systems like that are constantly struggling against the limitations of the servlet spec. :-\ Not to doubt what you're saying at all, but this seems to me that the limitations can be mitigated if they're known about in advance. Now, the Webapp isn't perfect, and leveraging a legacy application into the iron fist of a Webapp can be difficult to say the least. Not to mention integration of a heterogenous application that isn't pure Java. Lots of fun to be had there. However. I look at the Webapp and think of it at a pretty simple level. The Context. Within the context, you have mappings to the assorted segments of the Webapp. Assuming a pure Java Webapp solution. If your multiple component application is managed at the Webapp level, then, yes, you will have problems. But that begs the question of why you're using the Webapp as your component layer, when in reality it's the integration layer of the system. To be fair, I think the component level is the Servlet layer and its associated mappings within the web.xml, not the Webapp layer. In EJB parlance, you don't integrate EARs (The EJB version of a WAR), you integrate disparate EJBs INTO EARs. If you have two Webapps to integrate, why not break them into their component bits, integrate the web.xmls, pushing context level mappings down into the servlet mappings, and then rebundle into a Webapp? For example, if you have context1.war and context2.war, and each one has ServletMapping, then you can create a new web.xml that has context1/ServletMapping and context2/ServletMapping. I know, looks easier than it is. Certainly you begin to run into potential namespace issues as you fuse the two together, but this seems doable and I think this is how the Webapps were essentially meant to be used, particularly today. What kind of issues are you running into that would frustrate this kind of process of integration? Because once you're into the single WAR, then your cross authentication issues go away, resource shariing issues (assuming no naming clashes) are absorbed, etc. I'd just like to know what you're encountering, as I think it's
RE: JSP files between many webapps
That may be true...I'd like to move to EJB or equivalent in particular. But many of our problems are purely at the UI level: the servlet spec really doesn't have any provision for making a container webapp with a UI framework that is shared between multiple independent subapps. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:50 PM To: Tomcat Users List Subject: Re: JSP files between many webapps It's a matter of planning. The J2EE enterprise solution is not just about servlets. That API by itself is not the answer. If you folks are struggling with the limitations of the servlet spec, then is probably because you are pushing it beyond its design intention. Perhaps, it's time to look at extending your system or rethinking it. Have you thought about using other APIs i.e., JNDI, EJBs, JMS etc? These come at a price, but depending on your scale, it may just be the right move. Best, -Francisco Bido On Friday, February 14, 2003, at 12:23 PM, Will Hartung wrote: From: Tim Moore [EMAIL PROTECTED] Sent: Friday, February 14, 2003 9:52 AM Subject: RE: JSP files between many webapps I have to say that, while the webapp concept is nice in many respects, it's really not adequate for large, complex applications with multiple component modules. It certainly makes the simple, most common case far more manageable than it was before, but there are some projects (probably a growing number) for which the single-unit webapp model doesn't quite cut it, and those of us building systems like that are constantly struggling against the limitations of the servlet spec. :-\ Not to doubt what you're saying at all, but this seems to me that the limitations can be mitigated if they're known about in advance. Now, the Webapp isn't perfect, and leveraging a legacy application into the iron fist of a Webapp can be difficult to say the least. Not to mention integration of a heterogenous application that isn't pure Java. Lots of fun to be had there. However. I look at the Webapp and think of it at a pretty simple level. The Context. Within the context, you have mappings to the assorted segments of the Webapp. Assuming a pure Java Webapp solution. If your multiple component application is managed at the Webapp level, then, yes, you will have problems. But that begs the question of why you're using the Webapp as your component layer, when in reality it's the integration layer of the system. To be fair, I think the component level is the Servlet layer and its associated mappings within the web.xml, not the Webapp layer. In EJB parlance, you don't integrate EARs (The EJB version of a WAR), you integrate disparate EJBs INTO EARs. If you have two Webapps to integrate, why not break them into their component bits, integrate the web.xmls, pushing context level mappings down into the servlet mappings, and then rebundle into a Webapp? For example, if you have context1.war and context2.war, and each one has ServletMapping, then you can create a new web.xml that has context1/ServletMapping and context2/ServletMapping. I know, looks easier than it is. Certainly you begin to run into potential namespace issues as you fuse the two together, but this seems doable and I think this is how the Webapps were essentially meant to be used, particularly today. What kind of issues are you running into that would frustrate this kind of process of integration? Because once you're into the single WAR, then your cross authentication issues go away, resource shariing issues (assuming no naming clashes) are absorbed, etc. I'd just like to know what you're encountering, as I think it's important to highlight issues that can be brought up with the JSR groups for future versions of the spec. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet produces HTML .. how do i pass attributes in the session object ?
Because hs is null. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Mufaddal [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:35 AM To: Tomcat List Subject: Servlet produces HTML .. how do i pass attributes in the session object ? Hi ... in my doPost() I do some processing and then I do HashSet hs = getFruits(userName); PrintWriter ot = response.getWriter(); ot.println(html); ot.println(body); ot.println(h1b I AM FROM TIMBAKTU /b/h1); ot.println(/body); ot.println(/html); session.setAttribute(FRUITS, hs); ot.close(); Basically my servlet is writing some HTML output and setting a HashSet in the session object. When I do this i get the following exception : Internal Servlet Error: java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:389) at org.apache.tomcat.session.StandardSession.setAttribute(Standar dSession.j ava:731) at com.wavesinmotion.cw.classes.jsphelpers.LoginServlet.doPost(Lo ginServlet .java:61) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper .java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextM anager.jav a:806) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752) at org.apache.tomcat.service.http.HttpConnectionHandler.processCo nnection(H ttpConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoin t.java:416 ) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPo ol.java:50 1) at java.lang.Thread.run(Thread.java:554) Does anybody know why ? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sharing classes from diferent wbeapps!
OK, first of all, that big classpath init param is probably totally unnecessary. Two, there's no reason you couldn't package your servlets in a jar and put it in $CATALINA_HOME/shared/lib. Three, if you really do want to leave them as individual class files, you could put them in $CATALINA_HOME/shared/classes. Four, you'll need to make sure that any classes/jars that your servlet depends on are also in shared/lib or shared/classes, or else you'll get class loading errors. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 1:01 PM To: '[EMAIL PROTECTED]' Subject: Sharing classes from diferent wbeapps! Hello dudes, i´m having some problems trying to share servlets from diferent webapps, i can´t put the classes which my second webapp need in $CATALINA/shared/lib, because they aren´t .jar they are servlets indeed and second webapp extends them, here is the snapshoot of my second webapp´s web.xml: servlet servlet-nameintranet/servlet-name servlet-classIN_Login/servlet-class init-param param-nameclasspath/param-name param-value ${CATALINA_HOME}/panfinance-app/WEB-INF/classes: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/appi.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/jcServlet.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/crimson.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/jaxp.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/jndi.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/jstyle.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/mail.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/oreilly.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/shell_term.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/acme.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/ojdbc14.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/com.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/conceptsoft.jar: ${CATALINA_HOME}/panfinance-app/WEB-INF/lib/tinySQL.jar/param-value /init-param /servlet What i must do? With best wishes, Edson Alves Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Debug.
The Java VM doesn't really support that. Why not let them each run their own instance of Tomcat? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: João Augusto Charnet [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 10:33 AM To: Tomcat Users List Subject: Re: Tomcat Debug. I'm not sure what the logger is used for. What I want is to have diferent developers debugging the application on the same Tomcat. For this to happen I wanted to tell Tomcat to listen to serveral ports in Debugging mode. So that each developer has it's own debug port from Tomcat. Thanks. John. Ben Ricker wrote: On Thu, 2003-02-13 at 05:28, João Augusto Charnet wrote: Is it possible to set Tomcat to listen to diferent ports when debugging ? What I do with roughly 12 developers is that I add a logger for each user that logs to each developers web app directory. They use the admin interface to restart/redeploy their own context. Not sure if this is exactly what you want... Ben Ricker Here's the problem. We have a group of developers, who acesses tomcat remotely in one machine. Each developer accesses one context of Tomcat. However to Debug, since Tomcat uses one port, when somebody is debugging, the execution of the entire group is going to be in debug mode. This is not interesting. What we want is to each developer have it's own debug port. Did I make myself clear ? If not please let me know. Thanks a lot... Sincerely, John. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Class library question
-Original Message- From: Barley [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 12:45 PM To: Tomcat Users List Subject: Class library question Hi all, I am migrating from a different servlet engine to Tomcat, and so I already have quite a few web apps up and running. I'd like to avoid shuffling things around as much as possible on the move to Tomcat. Right now, I've run into a problem with Tomcat being able to find class libraries. Here's what I've done: Created a Host in server.xml that points to the root directory of one of my webapps. I then added a Context in the Host to map a url to a subdirectory of my Host root. Apache seems to be passing the request over to Tomcat and Tomcat is trying to run my JSP, but it can't find the classes that the JSP depends on. Currently, those classes are located in the /hostroot/WEB-INF/classes/ folder. I set up a link to a lib subdirectory of WEB-INF as well, with no success. So, my question is, does Tomcat look in the WEB-INF/lib subdirectory of the Context or the Host? Context. The context is a Servlet spec web application. Is there any way to map where it looks for classes for an entire host? Classes shared between webapps can be put in $CATALINA_HOME/shared/classes (or shared/lib for JARs). Unfortunately this is not currently configurable. Is there a much better way to do what I am trying? It sounds like you might just want to configure hostroot as the root context directory. Make your context have docBase=/hostroot and path=. I believe each host can have its own root context directory. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question about Context vs web-app
-Original Message- From: Barley [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 3:26 PM To: [EMAIL PROTECTED] Subject: Question about Context vs web-app Can someone clarify something for me? Is a Context placed within a Host basically just a web-app within a virtual host? Yes, exactly. Context == deployed webapp. Can any tags that can be placed in a web-app also be placed in a Context? Thanks very much. No. The stuff that's in web.xml is standard Servlet spec stuff, and Tomcat treats it just like other containers do. The stuff in a Context declaration is Tomcat-specific. You can't include stuff from web.xml in it. You can see everything that you *can* include in it here: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] question about killfile
Same thing. The name is derived from old Usenet readers, which had a text file list of email addresses that it would ignore posts from. Since usenet can have a particularly low signal-to-noise ratio, these readers had a quick kill command that would automatically add the poster of the currently selected message to the file. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 4:46 PM To: 'Tomcat Users List' Subject: [OT] question about killfile Hey all :) Sorry for the dumb question... But I keep seeing people talk about a killfile. Seeing as how this is the first list I've ever subscribed to, I had to ask - what exactly is a killfile? Without pointing fingers, there are some poster(s) I'd like to block. I know I can block the address, or set up a rule in Outlook to automatically move messages from a specific address to the deleted items folder... But I was just curious if this killfile was something different, and more effective. Thanks :) Denise Mangano Help Desk Analyst Complus Data Innovations, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: compiling servlets !
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html# 101084 -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Swapneel Dange [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 6:03 PM To: [EMAIL PROTECTED] Subject: RE: compiling servlets ! hi Wendy ! i tried the stuff u said about compiling the SERVETS, but only thing it does is to give me errors like these -- ^ HelloWorld.java:21: illegal escape character out.println(\cf2 /body\cf0 );\par ^ HelloWorld.java:21: illegal escape character out.println(\cf2 /body\cf0 );\par ^ HelloWorld.java:21: illegal character: \92 out.println(\cf2 /body\cf0 );\par ^ HelloWorld.java:22: illegal escape character out.println(\cf2 /html\cf0 );\par ^ HelloWorld.java:22: illegal escape character out.println(\cf2 /html\cf0 );\par ^ HelloWorld.java:22: illegal character: \92 out.println(\cf2 /html\cf0 );\par ^ HelloWorld.java:23: illegal character: \92 \}\par ^ HelloWorld.java:23: illegal character: \92 \}\par ^ HelloWorld.java:24: illegal character: \92 \}\f1\par ^ HelloWorld.java:24: illegal character: \92 \}\f1\par ^ HelloWorld.java:24: illegal character: \92 \}\f1\par ^ HelloWorld.java:24: '{' expected \}\f1\par ^ HelloWorld.java:26: illegal character: \0 ^ 100 errors C:\tomcat\jakarta-tomcat-3.3.1a\jakarta-tomcat-3.3.1a\webapps\ swapneel\WEB-INF\c lasses\swapneel\servlets I am not sure as to what i am doing wrong here. when i was using the JIGSAW webserver, i think it was working fine but here in TOMCAT i am not able to find the SOLUTION for this EZ problem. Swapneel Dange 505-642-4126 http://www.cs.nmsu.edu/~sdange From: Wendy Smoak [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: compiling servlets ! Date: Wed, 12 Feb 2003 15:50:34 -0700 But i guess i am having problems with the compilation of the SERVLETS on the tomcat. I have also deifned the classpath as following : C:\tomcat\jakarta-tomcat-3.3.1a\jakarta-tomcat-3.3.1a\lib\com mon\servle t.jar Is that really the location of servlet.jar? With jakarta-tomcat-3.3.1a in it twice? and while compiling i am using the following command : javac -classpath HellowWorld.java , but what this command does is nothing. i mean there is no class file generated for this one. No, because you haven't specified one. When you use -classpath, the very next thing is taken as the classpath. So you've told the compiler that classpath=HellowWorld.java, and you have not specified a file to compile. That's why it's not doing anything. If you're setting the classpath as an environment variable, then _don't_ use the command line switch.I prefer to use ant, or to specify the classpath on the command line. Try this: javac -classpath C:\tomcat\jakarta-tomcat-3.3.1a\jakarta-tomcat-3.3.1a\lib\com mon\servle t.jar HellowWorld.java (Was that a typo? Is it really HelloWorld.java?) -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I get the web application name?
Or ServletContext.getServletContextName() if you mean the value of the display-name element from web.xml. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 7:44 AM To: Tomcat Users List Subject: Re: How can I get the web application name? Do you mean HttpServletRequest.getContextPath()? -Tim Etienne wrote: Hi, I found a way to retrieve the web application name for WebSphere I guess. Can I do the same for Tomcat? Thanks. Etienne. George, I've got a small servlet that'll show the docroot. Check out http://home.nc.rr.com/hygh/was/WebAppName.java Ken George wrote: Hi, In a servlet, I want to get the Web Application Name in which the servlet belongs. Actually, I want to retrieve the webapp docRoot using I found in ServletEngineConfigDumper example the following code, but I need the webappname ServletEngineInfo engineInfo = ServletEngine.getEngine().getInfo(); ServletHostInfo vhinfo = engineInfo.getServletHostInfo(default_host); WebGroupInfo wgInfo = vhinfo.getWebGroupInfo(webappname); String docroot=wgInfo.getDocumentRoot(); Any other way to get the WebApplication Doc Root? Thank you George - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FAQ (was Re: MY ATTIT...)
Well AFAIK nobody's written one. Do I hear a volunteer? ;-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 10:38 AM To: Tomcat Users List Subject: FAQ (was Re: MY ATTIT...) I am surprised that there isn't a FAQ that is circulated periodically--such as those automatically reposted to USENET newsgroups. Or perhaps a more formal document that comes out of [EMAIL PROTECTED] Comments? Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com - Original Message - From: David Durst [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, February 11, 2003 02:49 Subject: Re: MY ATTITUDE This is why, if you want to get answers to your questions, you have to make it clear in your post that you have done your homework, that you have tried the usual resources, that you are not asking for the answer to be spoonfed to you. Just as a side comment, not everyone is aware of the usual resources in that documentation is sometimes obfuscated in that when you are looking for a specific answer the details are buried somewhere on another document you don't even know you should be reading. So some people (Including myself) here should propabably (If time allowing) just point people w/ these questions to the correct documentation instead of just ignoring. On another side note we as HELPERS should also be aware of the mentality of the beginer wanting to ask a REAL person the question (I know its the lazy mans way) but some people actually learn this way. And since I have not read any of the initial postings regarding this thread I will digress from saying anything further and making myself look like a complete moron :). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java/jsp dynamic data
It sounds like you'll need to use an applet. By default, an applet can connect back to the host that you downloaded it from, so if that's all you need, you're set. Otherwise, it's still possible, but you'll need to sign the applet and the users will have to grant it permission to access the other hosts. Check out http://java.sun.com/products/plugin/1.2/docs/nsobjsigning.html -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Jeff Ousley [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 3:08 PM To: 'Tomcat Users List' Subject: java/jsp dynamic data All, I'm sorry to bring this up again, but I'm just not seeing clearly and maybe someone here could help. I need to write an application that displays in a web browser some data that will change from second to second. I have to use java in some form. I'm tied to the jtapi packages. I thought that jsp would be a good way to go, but I find that I'm limited in that jsp provides no way to refresh what is on the screen in a near real-time fashion. Past answers on this newsgroup have suggested the meta refresh tag, or using hidden frames and javascript to do periodic refreshes. I though maybe an applet would suit my needs, but it needs to access data on remote hosts. Doesn't the applet security prevent this? There has to be a good way to accomplish this using java and I was hoping I could do I with jsp somehow. Does anyone have any other ideas or suggestions? Thanks! __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Status 404 - resource not available
Check your web.xml. Servlets and serlet mappings must be declared in web.xml. Check the servlet spec for details. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Kenny G. Dubuisson, Jr. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 1:26 PM To: Tomcat Users List Subject: Re: Status 404 - resource not available Sorry for the re-post but I didn't get any responses and I'm really stuck on this. Thanks, Kenny - Original Message - From: Kenny G. Dubuisson, Jr. [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 07, 2003 9:29 AM Subject: Status 404 - resource not available I just reloaded my development box and I can't get my servlet to be recognized; I get a Status 404 error - resource not available. I'm not sure where to start diagnosing the problem. My context (named kcmria) works...ie if I put in http://192.168.1.61/kcmria I get the directory listing of $CATALINA_HOME/webapps/kcmria which is what I would expect. But I can't get anything in $CATALINA_HOME/webapps/kcmria/WEB-INF/classes to be recognized. I tried copying HelloWorldExample over to my servlet directory but can't see it either. I think it must be something with my context. Here is what I've defined in server.xml: Context path=/kcmria docBase=kcmria debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_kcmria_log. suffix=.txt timestamp=true / /Context My mod_jk.conf looks like this: JkMount /kcmria ajp13 JkMount /kcmria/* ajp13 Any ideas where I should start looking? Thanks, Kenny - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Status 404 - resource not available
Yeah. It surprises me that you say that, since I believe web.xml files are required for a context to start up. I'd definitely read the Servlet spec if you haven't already. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Kenny G. Dubuisson, Jr. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 1:42 PM To: Tomcat Users List Subject: Re: Status 404 - resource not available I don't have a web.xml defined. In my old Tomcat 4.0.5 I didn't need one; do I need one now? Thanks, Kenny - Original Message - From: Tim Moore [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 12:37 PM Subject: RE: Status 404 - resource not available Check your web.xml. Servlets and serlet mappings must be declared in web.xml. Check the servlet spec for details. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Kenny G. Dubuisson, Jr. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 1:26 PM To: Tomcat Users List Subject: Re: Status 404 - resource not available Sorry for the re-post but I didn't get any responses and I'm really stuck on this. Thanks, Kenny - Original Message - From: Kenny G. Dubuisson, Jr. [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, February 07, 2003 9:29 AM Subject: Status 404 - resource not available I just reloaded my development box and I can't get my servlet to be recognized; I get a Status 404 error - resource not available. I'm not sure where to start diagnosing the problem. My context (named kcmria) works...ie if I put in http://192.168.1.61/kcmria I get the directory listing of $CATALINA_HOME/webapps/kcmria which is what I would expect. But I can't get anything in $CATALINA_HOME/webapps/kcmria/WEB-INF/classes to be recognized. I tried copying HelloWorldExample over to my servlet directory but can't see it either. I think it must be something with my context. Here is what I've defined in server.xml: Context path=/kcmria docBase=kcmria debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_kcmria_log. suffix=.txt timestamp=true / /Context My mod_jk.conf looks like this: JkMount /kcmria ajp13 JkMount /kcmria/* ajp13 Any ideas where I should start looking? Thanks, Kenny - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat does not access sub-directories.
Is the Tomcat process running with the appropriate permissions to read and execute the directory? ;-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Hans Deragon [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 4:20 PM To: [EMAIL PROTECTED] Subject: Tomcat does not access sub-directories. Greetings. I am baffled. I have setup the following context: Context path= docBase=deragon debug=0/ Now, I have the following directory: ..jakarta-tomcat/webapps/deragon/generic Tomcat renders any file under the deragon directory. For instance, http://localhost:8080/index.html - ..jakarta-tomcat/webapps/deragon/index.html ...renders fine. However, I cannot get http://localhost:8080/deragon/generic. It exist, but Tomcat reports the resource as being unavailable (404 error). Why is that? What do I need to configure? Another context? Then why is this not the case with tomcat docs pages? They go deap in sub-directories and Tomcat renders them well. I do not understand why tomcat docs work fine with sub-directories, but not my deragon directory. BTW, I am a newbie, so assume the most stupid mistake as a possibility. Sincerely, Hans Deragon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to get the web application or Tomcat path inside a class
Why don't you have access to the ServletContext? That's really the only portable way to access resources in your webapp. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Etienne [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 5:01 PM To: 'Tomcat Users List' Subject: How to get the web application or Tomcat path inside a class Hi, Is there a way to get the web application path or the tomcat path inside a java bean not using any Request object? I am running tomcat on Windows. I need sometime to access xml file placed on the web_app_path/xml/ folder. On windows, it is easy to retrace them because the starting (default) path for retrieving a file is based on the web application path. So new File(xml/myfile.xml) works. But on the unix box, the starting (default) path is at tomcat_path/bin/. I don't want to put my xml files there. So, is there a way (without the servletContext.getRealPath(//); method, because I don't have access to the servletContext object ) to retrieve the path of the tomcat path or better, the Web Application path? tks E.L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to get the web application or Tomcat path inside a class
What about creating one more singleton object that is constructed with the ServletContext, and then all of the other objects use that one to access the file? It's probably a good idea to encapsulate access to the file anyway. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Etienne [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 5:28 PM To: 'Tomcat Users List' Subject: RE: How to get the web application or Tomcat path inside a class It is because the applications work with a lot of interne singleton objects (one instance for all the application). Like a ConnectionPool or a ApplicationScopeUtil that do not need to know the actual request, of servlet context: this would add a unused parameter to all the methods and mix up everything, and maybe creating new thread problems... So, for now, I don't want to put inside each singleton object a constructor asking for the ServletContext parameter... or HttpServletRequest parameter... everything is working well without any request indication. But when I need to get a file on the drive, I need to know where is the tomcat path... That is the only problem here. There is no way to get the CATALINA_HOME of the JVM? E.L -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: February 7, 2003 5:14 PM To: Tomcat Users List Subject: RE: How to get the web application or Tomcat path inside a class Why don't you have access to the ServletContext? That's really the only portable way to access resources in your webapp. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Etienne [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 5:01 PM To: 'Tomcat Users List' Subject: How to get the web application or Tomcat path inside a class Hi, Is there a way to get the web application path or the tomcat path inside a java bean not using any Request object? I am running tomcat on Windows. I need sometime to access xml file placed on the web_app_path/xml/ folder. On windows, it is easy to retrace them because the starting (default) path for retrieving a file is based on the web application path. So new File(xml/myfile.xml) works. But on the unix box, the starting (default) path is at tomcat_path/bin/. I don't want to put my xml files there. So, is there a way (without the servletContext.getRealPath(//); method, because I don't have access to the servletContext object ) to retrieve the path of the tomcat path or better, the Web Application path? tks E.L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NEWBIE Simple question, (but not for me ?!?)
Could there be a problem with your web.xml? Try checking the logs for errors loading the context. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Wileynet [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 6:08 PM To: [EMAIL PROTECTED] Subject: NEWBIE Simple question, (but not for me ?!?) I added a directory to the webapps dir. I cannot get to it. Error 404. Although directories I added a week ago work ??? Now this new one cannot be seen. I've asked this question a lot over the last few days here; either it's a completely STUPID question (most likely) or nobody can answer it. It's driving me up a wall. I swear I've tried everything I know, this has never happened before to me. Please help -wiley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why won't anyone help me out??
One nit...Apache is most definitely not licensed under the GPL, but the Apache Software License, which can be read here: http://httpd.apache.org/docs/LICENSE Notably, it allows you to redistribute modified versions without source code, unlike the GPL. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Goehring, Chuck Mr., RCI - San Diego [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:20 PM To: Tomcat Users List Subject: RE: Why won't anyone help me out?? Steve, Apache, Tomcat and a huge array of other products are so-called open-source. Usually this means they are licensed under the GPL (as Apache is). These products come in runtime and source downloads and have instructions on installation, compiling source etc. A web site called sourceforge (http://sourceforge.net/) houses a repository of these projects. It is worth perusing these projects and looking at what (and how)they have done their code, jars etc. Many are just like commercial products but are usually free for most usages. They aren't tutorials on programming or web development, they are products. The jars are packaged products. If you emulate what they did and can get their stuff to run under Tomcat, you will see how your stuff should be done, in order to run in the same environment. For example, if you loot for a class file in a jar and go find the corresponding source file, you will see how they specified their package declaration and where the class file ended up in the jar that they deploy. You can open the jar in winzip. Chuck -Original Message- From: Steve Burrus [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 1:07 PM To: Tomcat Users List Subject: RE: Why won't anyone help me out?? Hi Chuck, I just now read your little post to me, and I apologize for my sheer stupidity, but would u please humor me and tell me what exactly you mean by an open source product??! Am I to assume that the jar files in the product will demonstrate to me the fine art of packaging up class files? Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp:include semantics?
-Original Message- From: David Keyes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 1:00 PM To: [EMAIL PROTECTED] Subject: FW: jsp:include semantics? Hello. What are the semantics of jsp:include in Tomcat 4.0.x? It seems to me that if I jsp:include another jsp, things work fine. But if I try to include a servlet (one that was registered in my web.xml, e.g. url == /mywebapp/myservlet) the servlet is treated as if it were a traditional resource (that is, Tomcat tries to find a file named /mywebapp/myservlet), which of course can't be found since it doesn't exist. Is this behaviour correct? Should I be bugging the Jasper people about this one? Are there any non-standards-breaking ways of getting around this? Thanks... Dave Keyes I'm pretty sure that you can include a servlet. I think you'd want the url to just be /myservlet without the webapp path prepended. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Does TC 4.1.18 actually reuse tag handler instances?
-Original Message- From: David M. Karr [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 1:20 AM To: [EMAIL PROTECTED] Subject: Does TC 4.1.18 actually reuse tag handler instances? I've been following some of the discussions about reusing tag handlers, but after trying some test cases, I'm having trouble with a test case that is behaving differently than I expected. I have a tag inside a Struts logic-el:iterate loop, and all the attributes of the tag are plain strings, not scriptlet expressions (although one is a JSTL EL expression). On the first iteration, the setter method is called on the attribute. On the second iteration, I would have expected it to reuse the original tag handler, and NOT call the setter method. I know it did reuse the tag handler, because I set a breakpoint in an empty default constructor in the tag, and it got there on the first iteration, but not on the second iteration. On the second iteration, however, it DID call the setter method, which I believe, according to the specification, should not happen. Yeah, to add to what Craig said, according to the specification it does not *have* to call the setter again, but it *may*, and in Tomcat's case, does. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: REPOST Applet - | FIREWALL - Servlet (on Tomcat)
What version of Tomcat are you using? Can you post your web.xml? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: jackie [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 12:36 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: REPOST Applet - | FIREWALL - Servlet (on Tomcat) Sorry : something happened when I sent my last email, removing all line breaks. Here is the real file, please ignore last : So sorry. Hi All, I have a LOCAL applet (with a LOCAL html page) that is trying to send an object to a servlet that is sitting on a REMOTE server. I need to pass an object between the two. * I have placed a hole in my firewall * my local applet is signed The servlet will not accept the object. I have not edited the web.xml file (since I do not know if it would help) I did edit my server.xml file in order to specify the http port (). The message on tomcat reads : Status code:404 request:R( + /signed/WEB-INF/classes/SERVLET_receiveSIMOBJ2.class + null) msg:null I know that local applets are not supposed to talk to servlets on different hosts, but I have also been told that with TCP, a firewall hole, and a signed applet, it should work. Can it ? Is there some way on Tomcat to get around this problem ? This code works either locally or remotely as long as the code is on the same machine. Thanks so very much in advance, it is genuinely appreciated. Here is some critical code : // LOCAL APPLET String urlstr = http://machine.cluster.net:/signed/servlet/SERVLET_receiv eSIMOBJ2; // where machine.cluster.net is the server // is the port with the hole try { URL servletURL = new URL (urlstr); URLConnection uc = servletURL.openConnection(); uc.setDoOutput(true); uc.setDoInput(true); uc.setUseCaches(false); uc.setRequestProperty(Content-type, application/octet-stream); ObjectOutputStream objOut = new ObjectOutputStream (new GZIPOutputStream(uc.getOutputStream())); // sent it to the servlet System.out.println(APPLET: SENT TO SERVLET asldkfad ); objOut.writeObject((Object)simobj); objOut.flush(); objOut.close(); System.out.println(APPLET : READING OBJECT BACK ); ObjectInputStream objIn = new ObjectInputStream (new GZIPInputStream(uc.getInputStream())); // read an object from the servlet simobjout = (SIMDataOBj) objIn.readObject(); // ooo.junk = JUNK; System.out.println(Received info from Servlet + simobjout.A + simobjout.B + simobjout.C + simobjout.D); objIn.close(); return simobjout; } // END LOCAL APPLET // REMOTE SERVLET public void doPost (HttpServletRequest request, HttpServletResponse response) { System.out.println(In Servlet's do post - reached ); // NEVER REACHED try { ObjectInputStream objIn = new ObjectInputStream (new GZIPInputStream(request.getInputStream())); // set up output stream response.setContentType(application/octet-stream); ObjectOutputStream objOut = new ObjectOutputStream (new GZIPOutputStream(response.getOutputStream())); SIMDataOBj simobj = new SIMDataOBj(); simobj = (SIMDataOBj) objIn.readObject(); WriteXML (simobj); System.out.println(In Servlet ::: Printing the Object's contents + simobj.A + simobj.B + simobj.C + simobj.D); simobj.A = 1 1; simobj.B = 2 !! 2; simobj.C = 3 3; simobj.D = 4 !! 4; objOut.writeObject((Object)simobj); objOut.close(); System.out.println(End Servlet Communication ); } // END REMOTE Servlet // both local and remote SIMDataObj class SIMDataOBj extends Object implements Serializable { String A, B, C, D; SIMDataOBj(){ A= new String (THIS ); B= new String ( IS ); C= new String ( A ); D= new String ( D ); } } // END both local and remote SIMDataObj LOCAL HTML with signed applet == HTML BODY APPLET CODE=AppletToServletSIMOBJ.class ARCHIVE =Stry.jar WIDTH=430 HEIGHT=270 name=AppletToServletSIMOBJ /APPLET /BODY /HTML END LOCAL HTML with signed applet == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail
RE: how to block
Check out the synchronizer token pattern from Core J2EE Patterns. In a nutshell, you provide the form with a unique one-time-use token that it submits with the form. The form submission handler checks to see if that token has been submitted before, and if so, rejects the request. Struts includes an implementation of this pattern; check out the generateToken and isTokenValid methods on Action. Additionally, it's not too hard to write JavaScript that will disable a submit button after it is clicked. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Bing Zhang [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 1:10 PM To: 'Tomcat Users List' Cc: Dan Yin; Jimmy Wu; Daniel Ruiz Subject: how to block Hi all: I have one problem right now, which many people here on the list should have already experienced. For example, some post from browser take some time on the server side(servlet code) to process. Often times impatient user will click multiple times on the submit button, Or malicious user will hold Enter key to request it million times. What's going to happen on the server side is: multiple threads onto the same servlet would be launched and resources would be used up, like connections, and CPU processing time. So what's a general approach to prevent this ?? No matter the solution is on the client side (HTML/JavaScript), the server side(servlet/JSP), or combined. Can you guys pass some experience, ideas, thoughts on this ?? Thank you so much. Bing - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: REPOST Applet - | FIREWALL - Servlet (on Tomcat)
-Original Message- From: Jacqueline Spiegel - Cohen [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 12:53 PM To: Tomcat Users List Subject: RE: REPOST Applet - | FIREWALL - Servlet (on Tomcat) Thanks Tom, Tim ;-) jakarta-tomcat-3.3a I do not have a web.xml. Where should this file reside and what should it contain ? You need to have a web.xml inside your WEB-INF directory, which should in turn be in your webapp root directory. This is where you need to declare your servlet, and map it to one or more URL patterns. You should see the Servlet spec for more details. Also check out the example webapps that come with Tomcat. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Thanks so very much for your assistance, it is genuinely appreciated. Jackie At 12:39 PM 2/6/2003, you wrote: What version of Tomcat are you using? Can you post your web.xml? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: jackie [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 12:36 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: REPOST Applet - | FIREWALL - Servlet (on Tomcat) Sorry : something happened when I sent my last email, removing all line breaks. Here is the real file, please ignore last : So sorry. Hi All, I have a LOCAL applet (with a LOCAL html page) that is trying to send an object to a servlet that is sitting on a REMOTE server. I need to pass an object between the two. * I have placed a hole in my firewall * my local applet is signed The servlet will not accept the object. I have not edited the web.xml file (since I do not know if it would help) I did edit my server.xml file in order to specify the http port (). The message on tomcat reads : Status code:404 request:R( + /signed/WEB-INF/classes/SERVLET_receiveSIMOBJ2.class + null) msg:null I know that local applets are not supposed to talk to servlets on different hosts, but I have also been told that with TCP, a firewall hole, and a signed applet, it should work. Can it ? Is there some way on Tomcat to get around this problem ? This code works either locally or remotely as long as the code is on the same machine. Thanks so very much in advance, it is genuinely appreciated. Here is some critical code : // LOCAL APPLET String urlstr = http://machine.cluster.net:/signed/servlet/SERVLET_receiv eSIMOBJ2; // where machine.cluster.net is the server // is the port with the hole try { URL servletURL = new URL (urlstr); URLConnection uc = servletURL.openConnection(); uc.setDoOutput(true); uc.setDoInput(true); uc.setUseCaches(false); uc.setRequestProperty(Content-type, application/octet-stream); ObjectOutputStream objOut = new ObjectOutputStream (new GZIPOutputStream(uc.getOutputStream())); // sent it to the servlet System.out.println(APPLET: SENT TO SERVLET asldkfad ); objOut.writeObject((Object)simobj); objOut.flush(); objOut.close(); System.out.println(APPLET : READING OBJECT BACK ); ObjectInputStream objIn = new ObjectInputStream (new GZIPInputStream(uc.getInputStream())); // read an object from the servlet simobjout = (SIMDataOBj) objIn.readObject(); // ooo.junk = JUNK; System.out.println(Received info from Servlet + simobjout.A + simobjout.B + simobjout.C + simobjout.D); objIn.close(); return simobjout; } // END LOCAL APPLET // REMOTE SERVLET public void doPost (HttpServletRequest request, HttpServletResponse response) { System.out.println(In Servlet's do post - reached ); // NEVER REACHED try { ObjectInputStream objIn = new ObjectInputStream (new GZIPInputStream(request.getInputStream())); // set up output stream response.setContentType(application/octet-stream); ObjectOutputStream objOut = new ObjectOutputStream (new GZIPOutputStream(response.getOutputStream())); SIMDataOBj simobj = new SIMDataOBj(); simobj = (SIMDataOBj) objIn.readObject(); WriteXML (simobj); System.out.println(In Servlet ::: Printing the Object's contents + simobj.A + simobj.B + simobj.C + simobj.D); simobj.A = 1 1; simobj.B = 2 !! 2; simobj.C = 3 3; simobj.D = 4 !! 4; objOut.writeObject((Object)simobj); objOut.close
RE: Path index.jsp does not start with a /
What does your login page do when it's submitted? It sounds like it's calling ServletContext.getRequestDispatcher(index.jsp) which isn't quite legal. From the Javadocs for getRequestDispatcher: The pathname must begin with a / and is interpreted as relative to the current context root. I guess WebSphere may not be strictly conformant. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Inocencio Richiez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 9:36 AM To: [EMAIL PROTECTED] Subject: Path index.jsp does not start with a / Hi can someone here please help??? I have a WAR file that was succesfully deployed in WebSphere Application Server. The file now needs to be deployed in Tomcat apache 4.0. I copied the WAR file into the webapps folder. When I run the application, my first page (login page) comes up great. But once I try to login, I get the following exception: java.lang.IllegalArgumentException: Path index.jsp does not start with a / character at org.apache.catalina.core.ApplicationContext.getRequestDispatch er(ApplicationContext.java:572) Here is what I've included in the server.xml file: . !-- Tomcat Root Context -- !-- Context path= docBase=ROOT debug=0/ -- Context path=/ICSMonitor docBase=CWDashboard debug=0 reloadable=true crossContext=true !-- Tomcat Manager Context -- Context path=/manager docBase=manager debug=0 privileged=true/ !-- Tomcat Examples Context Context path=/examples docBase=examples debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_examples_log. suffix=.txt timestamp=true/ Ejb name=ejb/EmplRecord type=Entity home=com.wombat.empl.EmployeeRecordHome remote=com.wombat.empl.EmployeeRecord/ -- . __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 6:20 AM To: Tomcat Users List Subject: Re: more about custam tag life cycle The way to look at it is simply that the generated code is going to use a tag pool for each distinct class of tags. Unfortunately, there is no specific action that tells the tag it is being pulled from or being put back from the pool. The page will call release() before it is put back in the pool. Totally and completely false. Please go back and read the JSP Spec. The page will call release() before the tag is released to GC, and for no other reason. Now I'm really convinced that I should use doFinally() I'm personally of the opinion that you should *never* have to clear your tag attributes for any reason, because you're guaranteed by the spec that a given tag instance will only be reused for invocations with the same attribute set. Each attribute will either be overwritten or assumed to stay the same, so why do you need to ever clear them? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Throwing jar file through servlet..CODEBASE problem
-Original Message- From: paridhi bansal [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 10:56 PM To: [EMAIL PROTECTED] Subject: Throwing jar file through servlet..CODEBASE problem Hi!! I have a servlet throwing a jar file with a main applet..I have my directory test within webapps directory..I have kept my servlet in /test/WEB-INF/ classes/ directory.. Where should i keep my applet and jar file so that they can be accessed ..I am using APPLET tag for throwing jar and applet through servlet..I have to set CODEBASE field in my servlet ccordingly..if i set it to /test, i ned to keep applet class file and jar file in /webapps/test directory . But this has public access and iy shows the directory listing if accessed..and i want to keep my applet and jar files in side WEB-INF(private access)..So what should be the codebase and in which directory shld i keep my jar file and the applet? Regards, Paridhi It sounds like you want two contradictory things! ;-) If you want anyone to be able to use your applet, it needs to be publicly accessible. You need to keep the client-side classes outside of WEB-INF so that they can be downloaded by users' web browsers. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 10:59 AM To: Tomcat Users List Subject: RE: more about custam tag life cycle because sometimes we have a tag attribute that isn't actually an getter/setter attribute for declaring in TLD file... is just a instance variable that you need, like a counter, or something like it. Oh...well in that case it's not really a tag attribute per se (i.e., not container-managed), but what the Jakarta taglib developer guidelines call invocation-specific state. In those cases, by all means you can release them in doFinally. :-) Although, frequently you can just reset them in doStartTag and not have to incur the expense of a try/catch/finally block. It's only when you're holding onto an expensive resource (db connection, file handle, etc.) through the invocation of the tag that it makes sense to release it in doFinally. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 On Tue, 2003-02-04 at 13:44, Tim Moore wrote: -Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 6:20 AM To: Tomcat Users List Subject: Re: more about custam tag life cycle The way to look at it is simply that the generated code is going to use a tag pool for each distinct class of tags. Unfortunately, there is no specific action that tells the tag it is being pulled from or being put back from the pool. The page will call release() before it is put back in the pool. Totally and completely false. Please go back and read the JSP Spec. The page will call release() before the tag is released to GC, and for no other reason. Now I'm really convinced that I should use doFinally() I'm personally of the opinion that you should *never* have to clear your tag attributes for any reason, because you're guaranteed by the spec that a given tag instance will only be reused for invocations with the same attribute set. Each attribute will either be overwritten or assumed to stay the same, so why do you need to ever clear them? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WAR format question
Hi Erik, EP What about if we have a tag descriptor somewhere below WEB-INF, is EP it EP safe to refer to the path directly from the uri attribute of the %@ taglib % directive? Yeah, you can do that. :-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 12:27 PM To: Tomcat Users List Subject: Re: WAR format question Jake, Well, thanks anyway. Maybe somebody else knows the score on this one and will pipe up. :) Erik Jacob Kjome wrote: Hello Erik, Sorry, I don't do JSP and haven't a clue about taglibs Jake Tuesday, February 04, 2003, 9:31:27 AM, you wrote: EP Jacob Kjome wrote: In order to obtain access to a file under WEB-INF in a completely portable way, use something like... getServletContext().getResourceAsStream(/WEB-INF/mypropert ies.xml); EP What about if we have a tag descriptor somewhere below WEB-INF, is EP it EP safe to refer to the path directly from the uri attribute of the %@ taglib % directive? EP Erik EP -- EP --- EP To unsubscribe, e-mail: [EMAIL PROTECTED] EP For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WAR format question
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:14 PM To: Tomcat Users List Subject: Re: WAR format question Tim Moore wrote: Hi Erik, EP What about if we have a tag descriptor somewhere below WEB-INF, is EP it EP safe to refer to the path directly from the uri attribute of the %@ taglib % directive? Yeah, you can do that. :-) Thanks. Actually, I've already done it and it works -- but is it to spec? In other words, it's guaranteed to work on every container? Yup :-) The spec even contains some examples like that. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WAR format question
-Original Message- From: Jim Carlson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:07 PM To: Tomcat Users List Subject: Re: WAR format question Thanks. This answers my question, but I'm still left with the impression that I'll need to go beyond the WAR format if I want to write to a log or flat file DB (i.e., non-temp application file). Also, since containers don't guarantee support for an unpacked WAR (are there any containers that truly don't support this?), putting conf files that change after deployment in the WEB-INF seems a little sketchy. At the minimum, it adds the hassle of extracting and re-archiving the conf file to every edit. My impression is that WAR was designed around the best-practices scenario of having web app instances that don't save local state to the filesystem, but use a DB or some J2EE storage mechanism, for ease of clustering. Such apps would probably get their conf from a JNDI resource. However, I still think that the correct location for log files is resolved in this scenario. Those of you using WAR along with file logs -- where do you put them? I think the intent of the spec writers was that you use the built-in logging facilities and leave it up to the appserver to decide where to put them. Tomcat has pretty flexible logging support, allowing you to log everything to one file, have per-context logs, etc. If you really need your own log, I'd recommend making the location a context-param. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Thanks, Jim Jacob Kjome wrote: Put stuff that isn't supposed to be accessed via the web under WEB-INF. You can create whatever directory structures you want within that. In order to obtain access to a file under WEB-INF in a completely portable way, use something like... getServletContext().getResourceAsStream(/WEB-INF/myproperties.xml); As far as writing stuff to your webapp, there is no guarantee that you have access to the file system other than a temporary directory designated for your webapp by the servlet container. You only have access under Tomcat because, by default, it exploded .war files to directory structures and then serves the directory structure. However, webapps can be deployed entirely from a .war file, in which case you can't use File IO within the application structure. I am acutally looking for a way to be able to write directly into an archive such as a .war file. If you happen on any info on that I would love to know about it. Check out the servlet api. You may be surprised to find a lot of methods like this that make dealing with webapps quite easy. Jake At 01:42 PM 2/3/2003 -0800, you wrote: Hello, I have a question about the WAR directory structure. Namely, where is the appropriate place to put configuration files, log files, and other files that need to be read/written-to by my application? Clearly putting them in the webroot isn't right. Can my application access arbitrary files under WEB-INF? How? I know that conf files can be put in the classpath (e.g. WEB-INF/classes), but this seems like the wrong solution for files that will change after deployment. In the past, I've used the technique of creating my own application root, which contained a webroot/ directory in the WAR format, and pointed the servlet container at that. I used servlet parameters in the web.xml file to specify the location of the application root to my servlets, so that they could access my conf/log files. This works fine, but forces me to 'embrace and extend' the orginal WAR concept. Any suggestions? Thanks, Jim Carlson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why won't anyone help me out??
You need to use the fully qualified class name in the useBean tag. I don't mean to be rude, but probably the reason you're not getting much help is because the concept of packages is really basic Java, and this isn't really a list for teaching really basic Java. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Steve Burrus [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 4:36 PM To: [EMAIL PROTECTED] Subject: Why won't anyone help me out?? Well, seeing how no one, so far, has seen fit to respond back to my plea for help/assistance, I will re-post this from late last nite!! I am getting quite desperate the longer that I have to go on without getting this right! Hello again, Filip, I tried to package up the 2 required files, login.jsp and LDAPAuth.java into a newly created org.burrus.test folder, and then compiled them into that same folder/directory to create 2 .class files, but then when I tried to run the whole program in my JBuilder 8, I STILL got, for my efforts, the old 505 server error page: Apache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Errortype Exception reportmessage Internal Server Errordescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 4 in the jsp file: /login.jsp Generated servlet error: C:\Documents and Settings\Steven R. Burrus\jbproject\thirdjavaproj\Tomcat\work\login$jsp.java:64: Class org.apache.jsp.LDAPAuthBean not found. LDAPAuthBean auth = null; ^ An error occurred at line: 4 in the jsp file: /login.jsp Generated servlet error: C:\Documents and Settings\Steven R. Burrus\jbproject\thirdjavaproj\Tomcat\work\login$jsp.java:67: Class org.apache.jsp.LDAPAuthBean not found. auth= (LDAPAuthBean) ^ An error occurred at line: 4 in the jsp file: /login.jsp Generated servlet error: C:\Documents and Settings\Steven R. Burrus\jbproject\thirdjavaproj\Tomcat\work\login$jsp.java:72: Class org.apache.jsp.LDAPAuthBean not found. auth = (LDAPAuthBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), LDAPAuthBean); ^ Note: C:\Documents and Settings\Steven R. Burrus\jbproject\thirdjavaproj\Tomcat\work\login$jsp.java uses or overrides a deprecated API. Recompile with -deprecation for details. 3 errors, 2 warnings at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfN ecessary(JspServlet.java:176) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service (JspServlet.java:188) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilt er(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli cationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardW rapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipel ine.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardC ontextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:566) at org.apache.catalina.valves.CertificatesValve.invoke(Certificat esValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipel ine.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContex t.java:2347) at org.apache.catalina.core.StandardHostValve.invoke(StandardHost Valve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi spatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport Valve.java:170
RE: Custom tag life cycle
-Original Message- From: Gary McGath [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 9:14 AM To: [EMAIL PROTECTED] Subject: Custom tag life cycle The webapp which I am developing (see http://www.timeczar.com for details) uses a moderately complex custom tag library, and I've found the lifecycle of a TagSupport object to be very confusing. As I understand it, a TagSupport object may (but is not guaranteed to) be reused for subsequent occurrences of the same tag in a JSP. This means that attribute variables can't safely be initialized in the constructor, because they may not get reinitialized for subsequent occurrences of the tag. (Here I'm assuming that setter functions for attributes simply set an instance variable.) After some digging, I found that the recommended way to reset attribute instance varaibles is to use the doEndTag method. This probably doesn't work if a tag is nested within a tag of the same name, but I can live with that. Actually I believe that containers would be required to use two different instances when tags are nested. The instance can only be reused for subsequent uses of the tag *after* the first one is closed. But I would do the initialization in doStartTag rather than doEndTag. The latter may not be called if an exception is thrown from within the tag body. Doing this works fine in Tomcat. However, I recently ported my webapp to Resin and found that it doesn't work there. Here's a cut-back excerpt from my JSP: caltags:eventset caltags:evtstartdate mode=date length=m/ - caltags:evtenddate mode=date length=m/ /caltags:eventset The class which implements eventset includes the tag body once for each event in the set. The evtstartdate and evtenddate tags are implemented by a class called DateTag, which extends TagSupport. Under Tomcat, DateTag.setMode and DateTag.SetLength get called once for each tag in each inclusion of the tag body. Under Resin, only two calls (one for each of the date tags) are made to each of setMode and setLength. If I clear the mode and length fields when I call doEndTag, then all occurrences of the date tags except the first take on their default attributes, which is not the behavior I want. Are both Tomcat and Resin within spec in implementing different behaviors here? If so, what is the correct point in the lifecycle to reset attribute values in a TagSupport object? The spec allows the container to assume that the attributes of a tag handler will be retained across invocations, so if there are multiple identical invocations, the setter methods do not need to be called again. Here's what I'd recommend: Initialize the mode and length instance variables to null at construction time. Do something like this in doStartTag: String mode = this.mode; if (mode == null) { mode = DEFAULT_MODE; } ...and repeat for length. Never modify the instance variables or call their setters yourself -- let the container manage them. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
This is NOT true, AFAIK. The same tag instance can be used multiple times *sequentially* but not *concurrently*. Check out the lifecycle state diagram in the JSP spec. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 1:01 PM To: Tomcat Users List Subject: more about custam tag life cycle I was thinking... Gary McGath, if I understood well what you said it's possible that a container will call the same tag instance concurrently??? This would be a real problem, as if this happens, you couldn't believe even in your pageContext, etc variables! -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
-Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 2:01 PM To: Tomcat Users List Subject: Re: more about custam tag life cycle [snipped] This entire problem, at least as I've encountered it, revolves around not only optional, but also contradictory tags (i.e. it's okay to specify paramter a, b, or c, but no combination in the same tag). I think the intention of the spec writers was to make that a problem for the container implementors, not for the tag handler developer. From s.10.1.1: Note that since there are no guarantees on the state of the properties, a tag handler that had some optional properties set can only be reused if those properties are set to a new (known) value. This means that tag handlers can only be reused within the same 'AttSet' (set of attributes that have been set). -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 2:12 PM To: Tomcat Users List Subject: Re: more about custam tag life cycle I'm curious, how you get a PageContext when the container doesn't call setPageContext? Which container have this behavior? What he meant is that it may not call setPageContext *on each invocation*. It will always be called at least once before doStartTag. I don't see a reason why we should have pool-specific method for tag property cleaning. doFinally method is intended for tag cleaning... Probably when created it was intended for cleaning resources like database connections, etc but I don't see any reason to create yet another method just for tag reuse I think there might be some benefit in clarity to the tag developer. The current lifecycle behavior seems to confuse a lot of people (and I was certainly one of those people when I first started writing tag extensions). But when I made a suggestion like that on the tomcat-dev list, it was pointed out that JSP 2.0 offers a new SimpleTag interface that will never be pooled, and is much more straightforward than the classic tag interface. Hopefully in the future most tags can use that interface instead, and the classic Tag interface can be reserved for the rare tags that benefit from reuse. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom tag life cycle
-Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 1:38 PM To: Tomcat Users List Subject: Re: Custom tag life cycle From: Tim Moore [EMAIL PROTECTED] Sent: Monday, February 03, 2003 9:30 AM Subject: RE: Custom tag life cycle But I would do the initialization in doStartTag rather than doEndTag. The latter may not be called if an exception is thrown from within the tag body. The problem here is that the doStartTag is done after all of the properties are set. So, you don't know if a property value has been set from the current tag invocation or an earlier tag invocation. I think Felipes idea of using the doFinally as a reset to default contructed state is the smartest thing. I'd like to hope that the new JSP spec clarifies the lifecycle a bit better, taking in to account the aggressive caching that the containers are doing now. But did you see the rest of my message? It's important to not actually reset the instance variables between invocations. So really, you don't want to intialize those at all, but invocation-specific local variables. More from the JSP 1.2 spec: s.10.1: It is the responsability of user code, be it scriptlets, JavaBeans code, or code inside custom tags, to not invoke these setter methods, as doing otherwise would interfere with the container knowledge. Once properly set, all properties are expected to be persistent, so that if the JSP container ascertains that a property has already been set on a given tag handler instance, it needs not set it again. s.10.1.1 : After the doEndTag invocation, the tag handler is available for further invocations (and it is expected to have retained its properties). So I misstated; you don't want to initialize properties themselves in doStartTag, you want to do something like this: String attr1 = this.attr1; if (attr1 == null) { attr1 = DEFAULT_ATTR1; } etc. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
Tag reuse is only allowed when the set of attributes that are used, and their values, are identical. For example, the following two tags will *always* use different instances: foo:bar baz=a/ foo:bar baz=b/ because the attribute value is different. My understanding was that the same instance *could* be reused, as long as setBaz(b) is called between the first doEndTag and the second doStartTag. Am I mistaken? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 2:37 PM To: Tomcat Users List Subject: Re: more about custam tag life cycle On Mon, 3 Feb 2003, Will Hartung wrote: Date: Mon, 3 Feb 2003 11:00:46 -0800 From: Will Hartung [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: more about custam tag life cycle From: Felipe Schnack [EMAIL PROTECTED] Sent: Monday, February 03, 2003 10:12 AM Subject: RE: more about custam tag life cycle This makes me feel much better :-) On Mon, 2003-02-03 at 16:09, Tim Moore wrote: This is NOT true, AFAIK. The same tag instance can be used multiple times *sequentially* but not *concurrently*. Check out the lifecycle state diagram in the JSP spec. The way to look at it is simply that the generated code is going to use a tag pool for each distinct class of tags. Unfortunately, there is no specific action that tells the tag it is being pulled from or being put back from the pool. The page will call release() before it is put back in the pool. All tags follow the basic lifecycle of simpy constuctor setPageContext doStartTag doEndTag In the pooled environment, it's: constructor setPageContext doStartTag doEndTag doStartTag doEndTag etc. (I've seen some containers, I thinik Tomcat is one, that call setPageContext on each tag, but I've seen others that do not, so setPageContext is not a reliable method to reset the tag properties). If the tag implments the TryCatchFinally interface, then a doFinally is called after the doEndTag. This only helps in a JSP 1.2 container, and comes with at least some performance price due to the extra try/catch/finally block that the page compiler has to create. What's is non-obvious is that the doEndTag and doFinally are supposed to assume the role of cleaning the tag up for reuse. That is not what they are for. The purpose of doEndTag() is to finish up whatever processing your tag does, at the end of the closing tag on the page. You should not be modifying the attribute values that were set by the page anyway, so there should be no need to clean up here. The purpose of doFinally() is to deal with exceptions that were thrown within the body of your tag. You really do not want to spend the extra processor cycles when such exceptions do not occur, or don't matter to you. I particularly like this quote from the spec: The particular code shown below assumes there is some pool of tag handlers that are managed (details not described, although pool managing is simpler when there are no optional attributes), This entire problem, at least as I've encountered it, revolves around not only optional, but also contradictory tags (i.e. it's okay to specify paramter a, b, or c, but no combination in the same tag). There are really two issues here -- tag *pooling* (the container recycles a previous tag instance instead of creating a new one every time) and tag *reuse* (the container uses the same instance for more than one tag with identical attributes). It's entirely legal to have tag reuse even in a container that does not implement tag pooling, so you have to account for both possibilities. Tag reuse is only allowed when the set of attributes that are used, and their values, are identical. For example, the following two tags will *always* use different instances: foo:bar baz=a/ foo:bar baz=b/ because the attribute value is different. Likewise, the following two tags will *always* use different instances: foo:bar baz=a/ foo:bar bif=a/ because different attribues are used. However, the following tag instances *can* be reused (and smart developers will always program their tags as if they *will* be reused): foo:bar baz=a/ foo:bar baz=a/ If your container does implement tag pooling (in addition to or instead of tag reuse), it will call release() before returning the instance to the pool. That makes release() the right place to reset everything to defaults. And like I said earlier, it would be nice if there were a pool interface added to the lifecycle to clean up the tag processing
RE: more about custam tag life cycle
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 2:46 PM To: Tomcat Users List Subject: RE: more about custam tag life cycle I'm curious, how you get a PageContext when the container doesn't call setPageContext? Which container have this behavior? What he meant is that it may not call setPageContext *on each invocation*. It will always be called at least once before doStartTag. But each invocation shouldn't get a different pagecontext? PageContext isn't something related to request's URL? I guess pagecontext's functionality isn't very clear to me... We're talking about reuse within a single page. I don't see a reason why we should have pool-specific method for tag property cleaning. doFinally method is intended for tag cleaning... Probably when created it was intended for cleaning resources like database connections, etc but I don't see any reason to create yet another method just for tag reuse I think there might be some benefit in clarity to the tag developer. The current lifecycle behavior seems to confuse a lot of people (and I was certainly one of those people when I first started writing tag extensions). Yes, but add even more method would make it easier? Maybe just the way the current methods are defined in the docs should be changed. If you make it clear that doFinally() is ok for tag reuse cleaning, everybody will use it for this. Except that it's not, really. But when I made a suggestion like that on the tomcat-dev list, it was pointed out that JSP 2.0 offers a new SimpleTag interface that will never be pooled, and is much more straightforward than the classic tag interface. Hopefully in the future most tags can use that interface instead, and the classic Tag interface can be reserved for the rare tags that benefit from reuse. Tag reusing is so rare to be useful at all? Why? Well I guess that's the conclusion they came to by JSP 2.0, and the rationale behind the SimpleTag interface. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 3:15 PM To: Tomcat Users List Subject: RE: more about custam tag life cycle I think there might be some benefit in clarity to the tag developer. The current lifecycle behavior seems to confuse a lot of people (and I was certainly one of those people when I first started writing tag extensions). Yes, but add even more method would make it easier? Maybe just the way the current methods are defined in the docs should be changed. If you make it clear that doFinally() is ok for tag reuse cleaning, everybody will use it for this. Except that it's not, really. Yes, but it can be done... to me seems simpler to change the spec a little than add even more methods (this tends to create even more confusion IMHO) But, to reiterate, there isn't really any kind of useful cleaning you can do in doFinally that doesn't break the spec in other ways. Tag reusing is so rare to be useful at all? Why? Well I guess that's the conclusion they came to by JSP 2.0, and the rationale behind the SimpleTag interface. Yes, but I guess it must be hard to know when is good to pool a tag, isn't it? :-) Only when there is some kind of expensive operation necessary that could be done once rather than per-invocation. For example if you had a tag that read a large configuration file that isn't expected to change while the appserver is running, you obviously don't want to do that every time the tag is called. But for most simple tags, nothing like that is necessary. My conclusion about my experience and all this debate is that I should always initialize tag attributes with null, and reset them in doFinally()... Nope. :-) You should reset them to null in release, and not change them at all anywhere else (except for the setters, of course). -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: more about custam tag life cycle
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 3:56 PM To: Tomcat Users List Subject: RE: more about custam tag life cycle Yes, but it can be done... to me seems simpler to change the spec a little than add even more methods (this tends to create even more confusion IMHO) But, to reiterate, there isn't really any kind of useful cleaning you can do in doFinally that doesn't break the spec in other ways. Why? Because doFinally() is meant to be called to handle exceptions? Well, for this exact reason that we can be sure that it's called every time after doEndTag()... I guess it depends on what kind of cleaning you're doing. If you're doing something like releasing a database connection, then that's OK. If you're resetting attribute values, the tag can't be reused correctly. Tag reusing is so rare to be useful at all? Why? Well I guess that's the conclusion they came to by JSP 2.0, and the rationale behind the SimpleTag interface. Yes, but I guess it must be hard to know when is good to pool a tag, isn't it? :-) Only when there is some kind of expensive operation necessary that could be done once rather than per-invocation. For example if you had a tag that read a large configuration file that isn't expected to change while the appserver is running, you obviously don't want to do that every time the tag is called. But for most simple tags, nothing like that is necessary. So it's an accepted statement that tag reuse, implemented in Tomcat 4.1.x, isn't very useful in most cases? Well, I don't know about accepted. Some people back on tomcat-dev were saying that tag pooling drastically improved performance in pages with lots of tags in Tomcat 4.1. But at the very least, JSP 2.0 will allow you to make the choice between simplicity and reusability on a per-taghandler basis. My conclusion about my experience and all this debate is that I should always initialize tag attributes with null, and reset them in doFinally()... You should reset them to null in release, and not change them at all anywhere else (except for the setters, of course). Hm... so this is standard behavior? release() is called after doEndTag() in all containers that use pooling? I'd think it would have to. In any case, the spec guarantees that the attributes will be stable *until* release is called, and that the instance will not be reused for an invocation with a different set of attributes defined. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: web.xml question
-Original Message- From: Haytham Samad [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 5:47 PM To: Tomcat Users List Subject: RE: web.xml question Hi, I think you need to change your url to the following: http://localhost:8080/test/servlets/SessioinTest or change servlets to servlet, not sure which at this point. This is basically how you call a servlet that is not mapped to a specific url pattern in your web.xml config file. I am assuming test is your context name!? Note that in Tomcat 4.1.12 and later, this won't work either on an out-of-the-box install. You should define an explicit servlet-mapping in your web.xml. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 ... -Original Message- From: Pooleery, Manoj [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 4:31 PM To: 'Tomcat Users List' Subject: RE: web.xml question Maybe I am doing this incorrectly - but I have a servlet class in my WEB-INF/classes directory(SessionTestServlet.class) and in my web.xml, I have an entry like this servlet servlet-nameSessionTest/servlet-name servlet-classSessionTestServlet/servlet-class /servlet When I type http://localhost:8080/test/SessioinTest, it gives me an error saying requested resource not found. What could I be doing wrong? Thanks -Manoj. -Original Message- From: Paul Hsu [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 5:24 PM To: Tomcat Users List Subject: Re: web.xml question Not really, if you have a servlet is used for startup a background process, then you do not need a mapping section. - Original Message - From: Pooleery, Manoj [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, February 03, 2003 2:22 PM Subject: web.xml question Is it necessary that for each of the servlet elements in the web.xml, a corresponding servlet-mapping element should be there? (For a context other than root). Thanks -Manoj. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: web.xml question
-Original Message- From: Pooleery, Manoj [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 5:54 PM To: 'Tomcat Users List' Subject: RE: web.xml question Is there some documentation regarding this? The Tomcat 4.1.12 release notes. I remember this used to work earlier. Right. The invoker servlet was disabled due to inherent security risks. is this the case only with tomcat or with all app servers? Well, it never worked across all app servers in the first place. The invoker servlet is common in many app servers, but it was never part of the spec. I tried out different options like putting /servlets or /servlet before the servlet class, but the only time it worked was when I specified the servlet class in the web.xml AND a servlet-mapping entry as well. My question is, is this a standard being followed universally? The /servlet thing was never any kind of magic special case, it was just mapped to a servlet called InvokerServlet that invokes other servlets by name. Frequently, however, this poses security risks that might not be known to server administrators or application developers, so in Tomcat 4.1.12 and later, the mapping to the InvokerServlet is commented out by default. It is generally true that for a URL to be served by a servlet container, it needs to refer either to a resource in the webapp, or a mapping defined for a servlet or filter. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Thanks -Manoj. -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 5:50 PM To: Tomcat Users List Subject: RE: web.xml question -Original Message- From: Haytham Samad [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 5:47 PM To: Tomcat Users List Subject: RE: web.xml question Hi, I think you need to change your url to the following: http://localhost:8080/test/servlets/SessioinTest or change servlets to servlet, not sure which at this point. This is basically how you call a servlet that is not mapped to a specific url pattern in your web.xml config file. I am assuming test is your context name!? Note that in Tomcat 4.1.12 and later, this won't work either on an out-of-the-box install. You should define an explicit servlet-mapping in your web.xml. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 ... -Original Message- From: Pooleery, Manoj [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 4:31 PM To: 'Tomcat Users List' Subject: RE: web.xml question Maybe I am doing this incorrectly - but I have a servlet class in my WEB-INF/classes directory(SessionTestServlet.class) and in my web.xml, I have an entry like this servlet servlet-nameSessionTest/servlet-name servlet-classSessionTestServlet/servlet-class /servlet When I type http://localhost:8080/test/SessioinTest, it gives me an error saying requested resource not found. What could I be doing wrong? Thanks -Manoj. -Original Message- From: Paul Hsu [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 5:24 PM To: Tomcat Users List Subject: Re: web.xml question Not really, if you have a servlet is used for startup a background process, then you do not need a mapping section. - Original Message - From: Pooleery, Manoj [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, February 03, 2003 2:22 PM Subject: web.xml question Is it necessary that for each of the servlet elements in the web.xml, a corresponding servlet-mapping element should be there? (For a context other than root). Thanks -Manoj. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placement of 3rd party class files
-Original Message- From: Jeff Ousley [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 1:40 PM To: Tomcat Users List Subject: RE: placement of 3rd party class files Is it wise to add directories under the /lib directory? I'd like to keep the 3rd party classes seperated from eachother. If I do this, how do I tell tomcat/catalina where to find the class files? Isn't the CLASSPATH variable ignored for .jsp pages? You can't really do that. All of the JARs have to be directly in WEB-INF/lib. Don't JAR files already keep the 3rd party classes separated from each other? ;-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 --- Filip Hanik [EMAIL PROTECTED] wrote: just put them in the /WEB-INF/lib directory. your webapp has to have a WEB-INF directory, and under WEB-INF you have two directories /classes -- used for .class files /lib -- used for .jar files -Original Message- From: Jeff Ousley [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 10:29 AM To: [EMAIL PROTECTED] Subject: placement of 3rd party class files Hello! Forgive my ignorance as I try to grasp the concepts involved in using tomcat. I'm still learning. My web application uses several beans which use 3rd party classes bundled in .jar files. Where should I place these? After reading the class loader doc, I'm still not clear? They will only be used by this webapp. First of all, when I compile my beans, javac needs to know where these .jar files reside. Secondly, when my .jsp page runs that uses the beans that use these 3rd part classes, the .jar files need to be found. So, what is the proper place to store these .jar files how do I set the classpath so they can be found? I aplogize for the many questions. thanks! -jeff __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: background servlets
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 3:14 PM To: [EMAIL PROTECTED] Subject: background servlets Hi, Thanks for the info. Now, I just need to know how to create a java application/servlet running in the background of Tomcat that JSPs or servlets can talk to. http://java.sun.com/docs/books/tutorial/essential/threads/ -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: pass complex object to custom tag
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 3:22 PM To: Tomcat Users List Subject: pass complex object to custom tag Is there a way to pass something other than a string to a custom tag through the attributes? I have a class I've written and I'd love to find a way to pass it to a custom tag for processing. This would separate the display logic from the business logic. jsp:useBean id=user class=UserBean / ptcbe:mainpagetable src=%= user.getBudgetList() % / This didn't work? Just make your tag handler have a method like setSrc(UserBean src) and that should work fine. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: pass complex object to custom tag
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 3:34 PM To: Tomcat Users List Subject: RE: pass complex object to custom tag The tag shouldn't have rtexexpr set to true in its TLD too? (specifically for src attribute, of course) Oh yeah, that too :-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 On Thu, 2003-01-30 at 18:31, Tim Moore wrote: -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 3:22 PM To: Tomcat Users List Subject: pass complex object to custom tag Is there a way to pass something other than a string to a custom tag through the attributes? I have a class I've written and I'd love to find a way to pass it to a custom tag for processing. This would separate the display logic from the business logic. jsp:useBean id=user class=UserBean / ptcbe:mainpagetable src=%= user.getBudgetList() % / This didn't work? Just make your tag handler have a method like setSrc(UserBean src) and that should work fine. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Remote Restart Tomcat 4.1.8
-Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 4:34 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: Remote Restart Tomcat 4.1.8 shutdown is, look at the shutdown script. remotely starting it up, I am not sure Filip I don't think you can do the shutdown remotely. I'm pretty sure it only accepts same-host connections. Otherwise, anyone on the Internet could shut down your app server! To start up a program remotely, you'd obviously need to have some other program running to listen for the startup signal and then exec the program you're trying to start. That's certainly something you could do, but nothing like that comes with Tomcat. On Unix there's SSH. Windows has the Management Console. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Haytham Samad [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 8:41 AM To: Tomcat Users List Subject: Remote Restart Tomcat 4.1.8 Is it possible to restart or shutdown/start Tomcat remotely? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: pass complex object to custom tag
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 5:19 PM To: Tomcat Users List Subject: Re: pass complex object to custom tag Tim Moore wrote: I have a class I've written and I'd love to find a way to pass it to a custom tag for processing. This would separate the display logic from the business logic. jsp:useBean id=user class=UserBean / ptcbe:mainpagetable src=%= user.getBudgetList() % / This didn't work? Just make your tag handler have a method like setSrc(UserBean src) and that should work fine. I have written everything according to the spec and now I am running into some kind of a JavaBeans problem. If anyone can help me that'd be great. 1. The servlet has stored a UserBean into the session with the key user. 2. The JSP pulls the UserBean from the session like this: jsp:useBean id=user class=com.ptc.budgetease.beans.UserBean/ 3. My new custom tag tries to refer to the bean in one of its attributes: ptcbe:brltable size=small list= jsp:getProperty name=user property=mainPageBudgetRequestList / / (it is all on one line in the app, I broke it up for email) Yeah, you can't nest a tag in the attribute of another tag like that. It's not recognized as a rtexprvalue. You'll have to do this: ptcbe:brltable size=small list=%= user.getMainPageBudgetRequestList %/ -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getting java.lang.NoClassDefFoundError
-Original Message- From: Davidson, Greg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 8:57 AM To: 'Tomcat Users List' Subject: RE: getting java.lang.NoClassDefFoundError Yeah, I read that, here is the problem: I want to run Tomcat from my local PC. I want to load the *.classes from a network drive (for night backup purposes) not my local drive. (I've changed the class path in the catalina.bat, but I don't like this) I want to run the *.jsp from a network drive (for night backup purposes) not my local drive. (I've added a context in the server.xml for this) OK so if your context directory is already on a network drive, can't you just put your classes in WEB-INF/classes and be done? I must be misunderstanding you. Windows shortcuts are not the same as Unix symbolic links (can't use a shortcut in the WEB-INF/classes to point to the network drive) Tomcat changes the system classpath, I tried setting the system(windows) classpath to include the network drive, but Tomcat changes it. (I've changed the class path in the catalina.bat, but I don't like this) My experience is that trying to muck with Tomcat's classloading scheme only brings pain. :-\ -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: getting java.lang.NoClassDefFoundError
Where is your bean's code being loaded from? It should be in $CATALINA_HOME/common/classes or your webapp's WEB-INF/classes (or it can be in a JAR in $CATALINA_HOME/lib or your webapp's WEB-INF/lib). -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Davidson, Greg [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 5:44 PM To: '[EMAIL PROTECTED]' Subject: getting java.lang.NoClassDefFoundError I'm getting the following error: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest when I try to execute the following: bean code: request(request, response) { request.getParamater(inputBox); //This line cause the error. } Why isn't this (javax/servlet/http/HttpServletRequest) in my/tomcat's classpath?? Is that the problem?? -- To unsubscribe, e-mail: mailto:tomcat-user- [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: java.lang.NoClassDefFoundError: javax/servlet/Filter
Hi, John, Referring back to the class loader how-to, the classes on your system classpath are loaded in the bootstrap loader. Classes higher in the hierarchy cannot access classes lower in the hierarchy. I am in a very similar situation to you: we have classes that are shared between webapps and command line tools, that reside in a common, shared location. The compromise we've used is to include several of the Tomcat JARs on the system classpath used to launch the Tomcat JVM. Personally, I'm not particularly happy with this solution, as it makes classpath maintainance troublesome, but it basically works. It would be nice if Tomcat had a more flexible classloading scheme that could be customized for situations like ours. I think that eventually I'll end up writing a custom bootstrap classloader for Tomcat that will allow for configurable library directories. Hopefully I'll be allowed to submit it back to the project. Good luck, -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 8:53 AM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Tim, Maybe what I've done is taboo :-( I've placed the top level directory that has all of our custom Java classes (shared by all applications on the machine) on the Tomcat classpath. Tomcat is finding my TestFilter class there (since I chose to leave the class there instead of placing it under the context's WEB-INF/classes directory) which in turn references javax.servlet.Filter. Since other applications besides those within Tomcat are using the common code, I'd like to keep it in one place outside of Tomcat's structure. However, from what you've mentioned, it seems that I may need to keep any Tomcat/Servlet specific classes where Tomcat is expecting them to reside and not depend upon the classpath. If this is the case, do you think that a Tomcat-friendly solution would be to separate my classes into two disjoint sets - one having anything related to servlets, and the other containing my common (non-Servlet specific) classes? The first set would live under the context's WEB-INF hierarchy, and the other set living on the classpath. If this can work, then maybe I can have my cake and eat it too. Is there a better/more preferred way to accomplish class sharing beyond Tomcat's purview? Thank you. -John -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 4:02 PM To: Tomcat Users List Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter -Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 3:53 PM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Hello all, After *explicitly* placing the TOMCAT_HOME/common/lib/servlet.jar on the Tomcat classpath the Filter class is found. However it is my understanding that Tomcat shouldn't require me to do this since all jars in that directory are loaded by Tomcat (aren't they?). This is an ugly workaround, but I thought it an interesting anomaly to pass on. -John Oh here's a thought I just had...is there a class trying to reference javax.servlet.Filter that was already explicitly on the classpath? The stuff in common/lib is higher up in the classloader hierarchy than the stuff on the base classpath is, so that might explain it. Hopefully that made sense... -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 2:26 PM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Hi again, This is the first install of Tomcat on this server (done about a month ago), and it is not presently running any jsp applications save the examples. I've set up a few contexts, but they're empty right now (except for this TestFilter in the /ws context), so I suspect the install is pretty clean. I too was curious about whether or not the servlet.jar was the correct version, so I listed the jar's table of contents and saw that the javax.servlet.Filter was present (so I'm guessing this is the 2.3 jar - dated 09/23/2002). Thanks again for you input. -John -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 12:40 PM To: Tomcat Users List Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Howdy, Do you have any other thoughts? I have many
RE: java.lang.NoClassDefFoundError: javax/servlet/Filter
-Original Message- From: Cox, Charlie [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 10:35 AM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter you would need to keep in mind the security ramifications of such a change. you don't want someone to place any directory of jars in the list to be loaded where they could be accessed by any jsp dropped into a webapp. I'm afraid I don't really understand the threat here. How would that be different than just putting the jars into the common/lib directory? There's also directory/file permissions to think about for each external directory or jar to be maintained. Well, in my case, all I really want to do is effectively move the common/lib directory to a different location outside of the Tomcat directory structure. True that we would need to manage the permissions of that directory, but they wouldn't be any different from the permissions of tomcat/common/lib, or from the way they are set now, for that matter. Basically, all I'm saying is that it would be nice if you could configure the location of the directories that the Tomcat class loaders currently have hardcoded. Other than that, I'm not looking for any drastic changes. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Charlie -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 10:28 AM To: Tomcat Users List Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Hi, John, Referring back to the class loader how-to, the classes on your system classpath are loaded in the bootstrap loader. Classes higher in the hierarchy cannot access classes lower in the hierarchy. I am in a very similar situation to you: we have classes that are shared between webapps and command line tools, that reside in a common, shared location. The compromise we've used is to include several of the Tomcat JARs on the system classpath used to launch the Tomcat JVM. Personally, I'm not particularly happy with this solution, as it makes classpath maintainance troublesome, but it basically works. It would be nice if Tomcat had a more flexible classloading scheme that could be customized for situations like ours. I think that eventually I'll end up writing a custom bootstrap classloader for Tomcat that will allow for configurable library directories. Hopefully I'll be allowed to submit it back to the project. Good luck, -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 8:53 AM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Tim, Maybe what I've done is taboo :-( I've placed the top level directory that has all of our custom Java classes (shared by all applications on the machine) on the Tomcat classpath. Tomcat is finding my TestFilter class there (since I chose to leave the class there instead of placing it under the context's WEB-INF/classes directory) which in turn references javax.servlet.Filter. Since other applications besides those within Tomcat are using the common code, I'd like to keep it in one place outside of Tomcat's structure. However, from what you've mentioned, it seems that I may need to keep any Tomcat/Servlet specific classes where Tomcat is expecting them to reside and not depend upon the classpath. If this is the case, do you think that a Tomcat-friendly solution would be to separate my classes into two disjoint sets - one having anything related to servlets, and the other containing my common (non-Servlet specific) classes? The first set would live under the context's WEB-INF hierarchy, and the other set living on the classpath. If this can work, then maybe I can have my cake and eat it too. Is there a better/more preferred way to accomplish class sharing beyond Tomcat's purview? Thank you. -John -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 4:02 PM To: Tomcat Users List Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter -Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 3:53 PM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Hello all, After *explicitly* placing the TOMCAT_HOME/common/lib/servlet.jar on the Tomcat classpath the Filter class is found
RE: java.lang.NoClassDefFoundError: javax/servlet/Filter
-Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 11:05 AM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Well, in my case, all I really want to do is effectively move the common/lib directory to a different location outside of the Tomcat directory structure. True that we would need to manage the permissions of that directory, but they wouldn't be any different from the permissions of tomcat/common/lib, or from the way they are set now, for that matter. I have done the same thing, but I used a symbolic link to point to the new location of common/lib Well we have to deploy on Windows as well as Unix. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Single Servlet vs Multiple Servlet
-Original Message- From: Robert Simmons [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 11:09 AM To: Tomcat Subject: Single Servlet vs Multiple Servlet Greetings, I am developing a pretty rich web application that will be served by Java servlets. The question to me right now is If I want to go with single or multiple servlets. In all there will be about 50 commands that can be done to this servlet. If I put them all in one file it would violate my sense of object oriented engineering. So I thought of either making the various commands actually be in different classes and the servlet routing the requests to the proper command. You should take a look at Struts, which is a framework to do exactly that. http://jakarta.apache.org/struts/ The alternative is to make individual command servlets that have a common base class and sit on separate URLs. The problem with option two is that the servlet connects to EJB on the back end and could potentially hold onto allot of resources. The problem with option two, possibly, is federation. If there are hundreds of requests coming, will tomcat federate the servlet or pipe everything through one hole? Tomcat (and any servlet container, for that matter) will use a single servlet instance, but multiple threads. So it can service many requests at once, but to make your servlet thread-safe, you can't store any request-specific state in instance variables. This is true regardless of which approach you take. I personally prefer the single-servlet, multiple command class approach. I use Struts, which takes care of the basics for you. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Single Servlet vs Multiple Servlet
-Original Message- From: Robert Simmons [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 12:04 PM To: Tomcat Users List Subject: Re: Single Servlet vs Multiple Servlet Actually I don't intend to use JSP at all. The resulting document from the call to the servlet is XML, not HTML or XHTML or JSP. Just XML. I'm not sure learning a JSP framework would be worth my time. Struts isn't exactly a JSP framework. It's a servlet command pattern framework, that happens to include some JSP tag libraries to make it easier to use with JSP. But it was explicitly designed to be agnostic of the presentation method used, and people have used it successfully with Velocity, XML/XSLT, etc. The framework is actually pretty simple, so it's worth at least taking a look at it so that you don't end up just reinventing the wheel. You may decide to implement your own anyway for one reason or another, but it can't hurt to check it out and possibly steal some ideas. :-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- Robert - Original Message - From: Felipe Schnack [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, January 24, 2003 5:46 PM Subject: RE: Single Servlet vs Multiple Servlet Yes, I think there's no reason why you should implement your application hand-coding a servlet for each command you need. There are several frameworks around the web that you can use... Apache Struts, JCorporate Expresso (that now is integrated to Struts) and others. Personally, I'm developing some applications using my own framework, that consists of taglibs (I don't use scriptlets at all), special classes to handle your commands (or actions in Struts), database abstraction layer, etc... I personally like to make one by myself, even if just for fun (and to learn how to do it), but mainly because of time constraints probably you'll need some of these frameworks found in the web. On Fri, 2003-01-24 at 14:39, Shapira, Yoav wrote: Howdy, In all there will be about 50 commands that can be done to this servlet. If I put them all in one file it would violate my sense of object oriented engineering. So I thought of either making the various commands actually be in different classes and the servlet routing the requests to the proper command. The alternative is to make individual command servlets that have a common base class and sit on separate URLs. The problem with option two is that the servlet connects to EJB on the back end and could potentially hold onto allot of resources. The problem with option two, possibly, is federation. If there are hundreds of requests coming, will tomcat federate the servlet or pipe everything through one hole? 1. Take a look at struts. It will handle the direction of the request to the proper resource based on the 50 actions (which you call commands above) you define. 2. Simply put: don't worry about federation. Let tomcat worry about how many instances of the servlet it needs, how many request processing threads it needs, etc. Tomcat does a good job at this, and some of the relevant parameters (maxProcessors etc.) are user-tunable as well. We, as well as many other people on this list, run tomcat instances that handle thousands of requests. Also, you can always switch containers if you find tomcat doesn't handle your traffic volume as well as you'd like... Yoav Shapira Millennium ChemInformatics -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [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: INSECURE to rely on sendRedirect (??)
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 12:52 PM To: Tomcat Users List Subject: INSECURE to rely on sendRedirect (??) A few weeks ago I posted a question on this list asking if using response.sendRedirect() is a secure means of preventing a user agent from accessing content. (For instance, in a scenario where, to access the content, the session is consulted for a key of some sort. If the key is found, continue, otherwise a sendRedirect() is used to send the user to an error page.) Since a redirect is performed using an HTTP header (rather than at the server, like RequestDispatcher.forward()), the user agent is not *obligated* to respect the redirect. This means that relying on a redirect to protect secure data might be a mistake. In other server side languages (Perl, PHP), you can call exit immediately after setting the header to ensure that the sensitive data is not sent from the server to the user agent in the event that the user agent does not respect the redirect. However, as Paul Yunusov on this list pointed out to me, you cannot simply exit a servlet, it is not the same as a PHP or Perl script. (The original message is appended to this one.) No, but you can return from a servlet's request method :-) [snip] Summary: 1) Calling sendRedirect() from a Filter does not happen before the Filter calls its doFilterChain() method 2) This means relying on sendRedirect() to protect sensitive data is probably not safe. There could be a flaw in my logic, or I could simply be stating the obvious and everyone knew this. If either of those is the case, please point out my fallacy and I apologize for wasting everyone's time. :) What if you return right after calling sendRedirect? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Single Servlet vs Multiple Servlet
You might also try Maverick (http://mav.sourceforge.net/) which combines ideas from Struts (model-2, command pattern) with ideas from Cocoon (transformation pipeline, sitemap) and is totally agnostic of your view layer technology. I haven't worked with it myself, but it looks pretty cool. :-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Chris Ward [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 1:03 PM To: Tomcat Users List Subject: RE: Single Servlet vs Multiple Servlet If you are XML based, how about the Apache Cocoon project. I have only read about it, not tried it. Chris -Original Message- From: Robert Simmons [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 11:04 AM To: Tomcat Users List Subject: Re: Single Servlet vs Multiple Servlet Actually I don't intend to use JSP at all. The resulting document from the call to the servlet is XML, not HTML or XHTML or JSP. Just XML. I'm not sure learning a JSP framework would be worth my time. -- Robert - Original Message - From: Felipe Schnack [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, January 24, 2003 5:46 PM Subject: RE: Single Servlet vs Multiple Servlet Yes, I think there's no reason why you should implement your application hand-coding a servlet for each command you need. There are several frameworks around the web that you can use... Apache Struts, JCorporate Expresso (that now is integrated to Struts) and others. Personally, I'm developing some applications using my own framework, that consists of taglibs (I don't use scriptlets at all), special classes to handle your commands (or actions in Struts), database abstraction layer, etc... I personally like to make one by myself, even if just for fun (and to learn how to do it), but mainly because of time constraints probably you'll need some of these frameworks found in the web. On Fri, 2003-01-24 at 14:39, Shapira, Yoav wrote: Howdy, In all there will be about 50 commands that can be done to this servlet. If I put them all in one file it would violate my sense of object oriented engineering. So I thought of either making the various commands actually be in different classes and the servlet routing the requests to the proper command. The alternative is to make individual command servlets that have a common base class and sit on separate URLs. The problem with option two is that the servlet connects to EJB on the back end and could potentially hold onto allot of resources. The problem with option two, possibly, is federation. If there are hundreds of requests coming, will tomcat federate the servlet or pipe everything through one hole? 1. Take a look at struts. It will handle the direction of the request to the proper resource based on the 50 actions (which you call commands above) you define. 2. Simply put: don't worry about federation. Let tomcat worry about how many instances of the servlet it needs, how many request processing threads it needs, etc. Tomcat does a good job at this, and some of the relevant parameters (maxProcessors etc.) are user-tunable as well. We, as well as many other people on this list, run tomcat instances that handle thousands of requests. Also, you can always switch containers if you find tomcat doesn't handle your traffic volume as well as you'd like... Yoav Shapira Millennium ChemInformatics -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [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: java.lang.NoClassDefFoundError: javax/servlet/Filter
-Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 3:53 PM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Hello all, After *explicitly* placing the TOMCAT_HOME/common/lib/servlet.jar on the Tomcat classpath the Filter class is found. However it is my understanding that Tomcat shouldn't require me to do this since all jars in that directory are loaded by Tomcat (aren't they?). This is an ugly workaround, but I thought it an interesting anomaly to pass on. -John Oh here's a thought I just had...is there a class trying to reference javax.servlet.Filter that was already explicitly on the classpath? The stuff in common/lib is higher up in the classloader hierarchy than the stuff on the base classpath is, so that might explain it. Hopefully that made sense... -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Lorenti, John [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 2:26 PM To: 'Tomcat Users List' Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Hi again, This is the first install of Tomcat on this server (done about a month ago), and it is not presently running any jsp applications save the examples. I've set up a few contexts, but they're empty right now (except for this TestFilter in the /ws context), so I suspect the install is pretty clean. I too was curious about whether or not the servlet.jar was the correct version, so I listed the jar's table of contents and saw that the javax.servlet.Filter was present (so I'm guessing this is the 2.3 jar - dated 09/23/2002). Thanks again for you input. -John -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 12:40 PM To: Tomcat Users List Subject: RE: java.lang.NoClassDefFoundError: javax/servlet/Filter Howdy, Do you have any other thoughts? I have many thoughts ;) Most of which don't relate to your question unfortunately. Is there any possibility unpacked classes from the servlet.jar are scattered throughout your installation? Or that the servlet.jar file in your installation is NOT the version 2.3 jar? Doing a clean installation of tomcat in a different directory may help solve this. Yoav Shapira Millennium ChemInformatics -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Anyone VIRTUAL WEBAPP?
Maybe just use a filter mapped to /* ? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: David Keyes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 11:35 AM To: [EMAIL PROTECTED] Subject: Anyone VIRTUAL WEBAPP? I am working on a project that involves creating a web application. Within our build environment, the webapp does not exist in the standard webapp structure. For example, we have servlets/jsp/html/images/etc in various directories that need to be merged into the standard webapp structure (we use an ant script for this) before they can be deployed and run on an app server (i.e. tomcat). The problem with this is that it really stinks to run a hefty ant script every time that I want to see a minor change in a JSP. So here's what I would like to do in my development environment (wich happens to be Eclipse). It involves two parts: 1. Create a development context class loader. Sysdeo has already written one of these that allows multiple arbitrary paths to be added to the standard set (WEB-INF/classes and WEB-INF/lib) supported by the servlet spec. This works reasonably well, and allows me to load servlets/resources/etc from the various places that they exist within my development environment. No copying/moving/etc. required! 2. The next thing required would be to have a tomcat Context that would look in various non-standard places for requested resources such as JSPs, html files, images, etc. Essentially, I would like to have tomcat look in a series of directories for a requested resource (within a single Context), rather than just in the docBase. For example, if the url http://localhost:8080/myapp/index.html were requested, I would like tomcat to look in c:\dev\module1\web, c:\dev\module2\web, c:\dev\moduleN\web, etc. The process would stop as soon as the resource was found. Has anyone seen something like this already implemented? If not, are there any suggestions on where I would start to do this myself? I was thinking that I might be able to simply extend the StandardContext in Catalina, but it looks like things are pretty hard coded around the idea of a single docBase directory. Other people have to have similar development structures, so how are others doing this? Dave Keyes -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Classes not being found in app's WEB-INF directory.
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 1:07 PM To: Tomcat Users List Subject: Re: Classes not being found in app's WEB-INF directory. Raible, Matt wrote: Use Ant to build everything - and tell it where you want your compiled classes to end up. That's a good idea. I am using Ant currently, but hadn't thought of doing this. The only problem is that I use NetBeans, which requires that the source code be stored in the proper package directory structures. But, now that I think of it, I can use Ant to rearrange the source files to the appropriate directory structure upon checkout, so that I can work with them. In other words, a target that builds the package directory structure and copies the files to their appropriate places. Can Ant read the package declarations of the source files to determine where they should be placed, or will I have to hard code the paths into the Copy tasks? It wouldn't be hard to write a custom task to do that. Seems like it would be better to fix the source tree structure in CVS, though. It's kind of a PITA, but once it's done, it's done. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: System.out logs
-Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 1:30 PM To: Tomcat Users List Subject: RE: System.out logs Howdy, I know we could pipe the output to a file but there should be something better. Like calling System.setout() or perhapsa Logger tag...?? Those things are available in tomcat 4.x. Upgrade to get them ;) For 3.x, you're stuck with OS-dependent, non-portable solutions to this requirement. ;( System.setOut is obviously part of the JDK and not Tomcat 4. Using a logger tag won't affect standard output. Tomcat 4 uses plain old shell redirection to log standard out to a file. If you think using Sysstem.setOut is a better solution, then go right ahead, but personally I feel that using shell redirection is both simpler, and more maintainable. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Re: Classes not being found in app's WEB-INF directory.
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 1:29 PM To: Tomcat Users List Subject: OT: Re: Classes not being found in app's WEB-INF directory. Tim Moore wrote: Can Ant read the package declarations of the source files to determine where they should be placed, or will I have to hard code the paths into the Copy tasks? It wouldn't be hard to write a custom task to do that. Seems like it would be better to fix the source tree structure in CVS, though. It's kind of a PITA, but once it's done, it's done. I agree -- it just doesn't seem right to have a flattened hierarchy in CVS. But I thought that in CVS you can't change the directory structure. You can add new files and dirs, but you can't remove old dirs and move files from old dirs. It's possible, it just sucks. Check out the docs: http://www.cvshome.org/docs/manual/cvs_7.html -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: System.out logs
-Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 3:46 PM To: Tomcat Users List Subject: RE: System.out logs On Fri, 17 Jan 2003, Tim Moore wrote: Date: Fri, 17 Jan 2003 13:34:50 -0500 From: Tim Moore [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: RE: System.out logs -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 1:30 PM To: Tomcat Users List Subject: RE: System.out logs Howdy, I know we could pipe the output to a file but there should be something better. Like calling System.setout() or perhapsa Logger tag...?? Those things are available in tomcat 4.x. Upgrade to get them ;) For 3.x, you're stuck with OS-dependent, non-portable solutions to this requirement. ;( System.setOut is obviously part of the JDK and not Tomcat 4. Using a logger tag won't affect standard output. Tomcat 4 uses plain old shell redirection to log standard out to a file. If you think using Sysstem.setOut is a better solution, then go right ahead, but personally I feel that using shell redirection is both simpler, and more maintainable. Actually, in recent 4.1 releases, this has changed :-). Tomcat can intercept System.out and System.err, and redirects them to whatever Logger you have set for your context, if you say swallowOutput=true in your Context element. Ah, well that's handy! Learn something new every day! :-) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Can you set a webapp as Tomcat's default page?
-Original Message- From: Bill [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 11:15 AM To: Tomcat Users List Subject: RE: Can you set a webapp as Tomcat's default page? Ok...new development...adding the * to the JkMount directive now allows the login page to render without any of its images. At least its progress right! :) Funny thing is my first attempt at this, I did have '/*' as the mount point but that didnt work. I'm pretty sure this is because I defined my servlet as the default servlet so there is no longer a servlet responsible for serving the images? Does this sound about right? I guess what I need is this then: 1) 'JkMount /* ajp13' in webserver config Doesn't this mean that Tomcat will be serving all requests? In that case, having Apache on the front doesn't help you much. 2) leave the default servlet definition alone 3) set the root context to my app's docBase 4) set a welcome-file for the webapp that points to my servlet? I'm assuming setting a welcome-file to point to a servlet is as easy as specifying the full servlet name? I think you'd specify a path that maps to the servlet. But I don't think this is really what you want, either. Specifying it as welcome page means that it will only be served as the default page for the directory. You said all requests. But you can't really mean *all* requests. What it sounds like you want is a servlet to intercept all requests; ensure that the user is logged in; if so, continue to the requested URL; if not, redirect to the login page. Is this correct? In that case, you should probably use a filter rather than a servlet. But if you have images on your login page, then you'll have problems. If all of your images are in a separate directory, then you could make your authentication filter pass through requests to the image directory without checking for a login. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: is there a list for jsp / tag development?
To answer your original question, look at the BeanUtils package in Jakarta Commons. http://jakarta.apache.org/commons/beanutils.html In particular, BeanUtils.populate(Object, Map) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Jason Pyeron [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 1:07 PM To: Tomcat Users List Subject: is there a list for jsp / tag development? I am trying to get this answered, I guess I dont know where to ask. -jason On Wed, 15 Jan 2003, Jason Pyeron wrote: To those who like to deal with tags, I have some JSP code that gets stamped allover every day, it requires tweaking in each situation, hence it is error prone. We decided to make it a tag, but got stuck on two issues: how do we scope the 'formBean' var in the JSP page like jsp:useBean/ how do we simulate jsp:setProperty name='formBean' property='*' / now I am sure we can brute force this, by using reflection and iteration, but is there a method already written? here is my JSP code. jsp:useBean id='formBean' class='com.pyerotechnics.customer.ushr.ca15.intranet.tier2.bea ns.Form_IssueEdit' %formBean.setPageContext(pageContext);% jsp:setProperty name='formBean' property='dataSource' value='jdbc/intranetDB' / jsp:setProperty name='formBean' property='*' / %formBean.go();% /jsp:useBean here is the intended tag syntax. p:useFormBean id='formBean' class='com.pyerotechnics.customer.ushr.ca15.intranet.tier2.bea ns.Form_IssueEdit' dataSource='jdbc/intranetDB' / -Jason Pyeron -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Java Bean Scope questions (a lengthy one) [getting desperate]
-Original Message- From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 3:24 AM To: Tomcat Users List Subject: RE: Java Bean Scope questions (a lengthy one) [getting desperate] As already was pointed out you have to reinitialise sindex before you run the while loop. There at least to options to do that: - define a method like initStateList() and call it before you enter the loop. - reset the value in hasMoreStates() when false is returned Personally, I'd prefer a third option: Move the state list iteration into another class (say, StateListIterator) and put a getStateListIterator method on the form bean that returns a new instance of that class each time it's called. Then get a new iterator each time the page is called. That's more in line with how collection iterators work in the JDK, and I think it's just easier to understand in general. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 10:00 PM To: 'Tomcat Users List' Subject: RE: Java Bean Scope questions (a lengthy one) [getting desperate] % while(formBean.hasMoreStates()) { % option value=%= formBean.getStateList()%%= formBean.getStateList()%/option % } public boolean hasMoreStates() { if (sindex stateArray.length) return true; else return false; } //int sindex=-1; declared at beginning of class public String getStateList() { sindex++; String stemp = stateArray[sindex]; return stemp; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Java Bean Scope questions (a lengthy one)
-Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 5:02 PM To: 'Tomcat Users List' Subject: RE: Java Bean Scope questions (a lengthy one) [snip] Basically what I am looking to do is once the HTML form is submitted, and the call to CCProcess.jsp is executed (where I have my jsp:setProperty tag), I want ALL bean variables over written. I thought that this is what is happening when I use: jsp:useBean id=formBean class=com.Greenwich.beans.FormBean scope=session/ jsp:setProperty name=formBean property=*/ But apparantley, when the field is left blank it isn't writing an empty string back to the bean so the previous value is recalled. I would like all variables, blank and completed fields to be written back.. The only way I could think to accomplish this is with a lot of code and addressing each property separately, for example something to the effect of jsp:setProperty name=formBean property=*/ % if (request.getParameter(name) == null) //or is it == formBean.setName(); if (request.getParameter(address) == null) formBean.setAddress(); . % I would imagine this would be work, but I would also imagine there is an easier way and I'm hoping that someone here will know :) Here's a thought. You could define a reset method on your form bean that blanks out all of the properties. Then: jsp:useBean id=formBean class=com.Greenwich.beans.FormBean scope=session/ % formBean.reset(); % jsp:setProperty name=formBean property=*/ -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Java Bean Scope questions (a lengthy one) [getting desperate]
The problem is that sindex is never reset. The first time you load the form page, it iterates through the list of states, but on each subsequent time, it remains at the end of the list, so hasMoreStates always returns false. The reason you didn't see this before is because a new FormBean instance was created each time you visited the page. Now it's accessing the same instance from the session each time. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 4:00 PM To: 'Tomcat Users List' Subject: RE: Java Bean Scope questions (a lengthy one) [getting desperate] Ok, I'm sorry for beating a dead horse, but I am completely at a loss and I am starting to get concerned that I won't get this to work. As suggested I changed the scope of my bean to session. This caused some problems that if not resolved my webapp will not work. The code that I use for setting a select field to the display the selected option if it is valid, or repopulating the list no longer works since changing the scope to session. This has caused me to end up in a never ending loop for the form Retry because these select fields are never valid. For example one of my select fields is for the user to select their state. My HTML form (served through Tomcat although all other HTML pages are served through Apache) uses the long hand select tag where I list each state individually. My bean contains an array of state abbreviations and state names ( all one array in the format NY,New York,MA, Massachussetts,AL,Alabama...). In Retry.jsp I have the following code: jsp:useBean name=formBean class=com.complusdata.beans.FormBean scope=session/ ... select name=state size=1 %if (!formBean.hasStateError()) { % option value=%=formBean.getState()% selected%=formBean.getStateName()%/option %} else { % option value= selectedb--Please select your state--/b/option % while(formBean.hasMoreStates()) { % option value=%= formBean.getStateList()%%= formBean.getStateList()%/option % } } % /select .. Relevant methods in FormBean: public boolean hasStateError() { if (state.equals()) return true; else return false; } public boolean hasMoreStates() { if (sindex stateArray.length) return true; else return false; } public String getState() { return state; } public String getStateName() { int z; for (z=0; zstateArray.length-1; z=z+2) { if (stateArray[z].equals(state)) return stateArray[z+1]; } return state; } //int sindex=-1; declared at beginning of class public String getStateList() { sindex++; String stemp = stateArray[sindex]; return stemp; } My form calls CCProcess which instantiates an instance of FormBean which attempts to validate the form. Now since I changed the scope if I test leaving the select list without a state selected, this causes a problem. After the first retry, my select lists are populated. Any time after that, it defaults to the Please select your State but it does not populate the list - it is taking this as the State which is obviously not valid, and reason for the loop. I also ran a test where I left the state blank of the first try, and the select list was populated. I selected a state then hit submit again (with other errors on the form) and the bean did not save the state of my selection and the list did not populate. If anyone can offer any help I would appreciate it. Perhaps give me a clue if there is something wrong with my code, or maybe some code someone is currently using to serve the same purpose. The thing is, I really don't think its my code because it does work when the scope of the bean is request. Thanks in advance. Denise Mangano Help Desk Analyst Complus Data Innovations, Inc. -Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 2:29 PM To: 'Tomcat Users List' Subject: RE: Java Bean Scope questions (a lengthy one) Bill, I'm not sure what you mean. The transaction Bean gets instantiated when I call CCSubmit.jsp. That is the first time it is mentioned and CCSubmit is only called once from Verify.jsp. Is what you are saying effectively the same as: jsp:useBean id=transaction class = com.complusdata.beans.Transaction scope=session jsp:setProperty name=transaction property=email value
RE: JSP Question
-Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 1:54 PM To: Tomcat User List (E-mail) Subject: JSP Question I am trying to use %@ include file=filename % I am sending to the page that has this with the line: response.sendRedirect(main.jsp?p=+applicationJar.getPageName()); So in main.jsp I would like to include an external file to insert into a default page, something like: SOME DEFAULT PAGE STUFF HERE %@ include file=filename % SOME DEFAULT PAGE STUFF HERE but I would like to replace filename with request.getParameter(p) Any one have any idea how to do this? The %@ include % syntax is a static inclusion that happens at translation time, so it can't depend on runtime parameters. You want to use: jsp:include page='%= request.getParameter(p) %'/ (see the JSP spec for details) Be forewarned that you won't be able to access the enclosing page's local variables from within the included page (as you can with static includes), but if you add those variables to the request context you'll be able to access them that way. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat Standalone Redirects auto redirects to index.html
Somebody recently posted a patch to tomcat-dev that is supposed to fix this. See http://www.mail-archive.com/tomcat-dev%40jakarta.apache.org/msg38868.htm l -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: enLogica [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:01 PM To: Tomcat Subject: Tomcat Standalone Redirects auto redirects to index.html Issue: Unlike Apache (and every other http server), tomcat standalone automatically redirects to the welcome page, rather than forwarding to it. In other words, to present the welcome page tomcat will literally redirect (http 302) the user to www.xyz.com/index.html, rather than staying at www.xyz.com, and displaying the index page. Anyone know a solution when using Tomcat Standalone I do not want this effect as I am affraid it will have negative effects on my search engine placement. SEs often penalize URLs that redirect ... and since this is my primary domain this is a MAJOR issue. I was given the advice previously to use a RewriteRule to fix this problem, but have since been told this is functionality limited to Apache, and not available to Tomcat. Thanks. Neal -- 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: Java Bean Scope questions (a lengthy one)
-Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 9:19 PM To: 'Tomcat Users List' Subject: Java Bean Scope questions (a lengthy one) Question #1: Why does CCSubmit.jsp not have access to formBean properties. I am thinking this is because technically by submitting a form with an action of CCSubmit.jsp control isn't being forwarded to CCSubmit.jsp so the instance of formBean isn't forwarded. The scope of formBean is request. Is that the correct scope to use? **I need to have access to formBean properties from the moment it is instantiated to the moment the application has completed, but it has to be unique to each user of the webapp.** How could I accomplish this? That's exactly what session scope is for. :-) Request scope means that the bean is gone at the end of the request (that is, when Verify.jsp finishes rendering). If you put it in session scope you'll be set. Question #2: Is it possible to use two beans within a single jsp page? I would imagine that it is, and if so I believe once I gain access to formBean properties, my transaction properties will no longer be null. (I included some code below... is this legal?) Absolutely! As long as they have different id attributes, you can use as many beans as you like. Question #3: I include a button to give the option to go back and make changes. If the user should desire to go back and make changes, control should be forwarded to Retry.jsp on button click. I need to program this button in a way so that when Retry.jsp is recalled it will still have access to formBean properties.How do I program this? My last attempt using jsp:forward cause Retry.jsp to load automatically when Verify.jsp was loaded (sorry again Noel ;) ). As long as the bean is in session scope, you'll be able to access it from any page the user accesses. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Java Bean Scope questions (a lengthy one)
-Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 10:13 PM To: 'Tomcat Users List' Subject: RE: Java Bean Scope questions (a lengthy one) Correction - I changed the scope to session and the error messages DO appear, so that is ok. But this caused a never ending loop in Retry.jsp and control never gets forwarded to Verify.jsp. And my code for populating the select boxes does not do what it should (should repopulate if there was an error or default to selected option if one was selected - now this is successful in the first retry, but after that it defaults to the first entry and does not list the rest. Now I am also getting some errors in catalina.out: Jan 7, 2003 9:42:59 PM org.apache.jk.server.JkCoyoteHandler action SEVERE: Error in action code java.lang.NullPointerException at org.apache.jk.server.JkCoyoteHandler.action(JkCoyoteHandler.java:386) at org.apache.coyote.Response.action(Response.java:222) at org.apache.coyote.tomcat4.CoyoteAdapter.postParseRequest(Coyot eAdapter.java: 310) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter. java:221) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:632) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSo cket.java:590) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:707) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( ThreadPool.jav a:530) at java.lang.Thread.run(Thread.java:536) I don't know what that's about, actually. :-( The log code that I had placed before just shows a loop: 2003-01-07 21:42:41 jsp: Entering CCProcess 2003-01-07 21:42:41 jsp: Error on form - forwarding to Retry.jsp 2003-01-07 21:42:41 jsp: Entering Retry.jsp - error on form 2003-01-07 21:42:51 jsp: Entering CCProcess 2003-01-07 21:42:51 jsp: Error on form - forwarding to Retry.jsp 2003-01-07 21:42:51 jsp: Entering Retry.jsp - error on form I changed the scope back to request.jsp and I get to Verify.jsp, but the error message in catalina.out is still there. What could be causing this? And why would changing the scope to session cause me to enter into that Retry.jsp loop? It's hard to say without seeing your code, but I'm guessing that Retry.jsp tries to forward to CCProcess under some condition which only triggers when one of your form bean properties is not null. Then CCProcess tries to validate, fails, forwards to Retry.jsp, which then forwards back to CCProcess, etc. When you use request scope, the form bean is blanked out and you never enter the loop. Good luck! -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Thanks! Denise -Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 9:41 PM To: 'Tomcat Users List' Subject: RE: Java Bean Scope questions (a lengthy one) Wow someone read all of that!! ;) For Question #1: I should have mentioned this before... I tried to use session scope at one point (don't recall the exact reason but I thought of it as an attempt to resolve a different problem). When I set the scope to session, it caused problems with my form validation. Currently if the form is not validated, the user is brought back to Retry.jsp and error messages appear next to the offending input field. When I used session scope, Retry.jsp would be reloaded, but the error messages would not be displayed... Any thoughts on that? I am going to go back and attempt this again now that everything is working as it should up to Verify.jsp and see if I stand corrected... For Question #2 - that's exactly what I needed to know!! For Question #3 - hopefully I can get the session scope to work, but then how would I program that button? Would I just put onClick=Retry.jsp ? Tim, thank you so much for taking the time!! Denise :) -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 9:24 PM To: Tomcat Users List Subject: RE: Java Bean Scope questions (a lengthy one) -Original Message- From: Denise Mangano [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 9:19 PM To: 'Tomcat Users List' Subject: Java Bean Scope questions (a lengthy one) Question #1: Why does CCSubmit.jsp not have access to formBean properties. I am thinking this is because technically by submitting a form with an action of CCSubmit.jsp control isn't being forwarded to CCSubmit.jsp so the instance of formBean isn't forwarded. The scope of formBean
RE: Object Pooling
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 2:52 PM To: Tomcat Users List Subject: Re: Object Pooling I'm rewriting this reply, maybe I wasn't clear enough :-) My application have two types of objects that are constantly created and destroyed. I believe that they could be pooled in some way (maybe using commons pooling package. These types are: 1- Objects that handle user interaction. Basically they are the objects that actually implement tasks that would be otherwise done using servlets. In pratice, JSPs send data to them (like html form data) and they process it and return the results to the browser. These ones i'm not sure (yet) if I should pool. I'm not familiar with Struts, I would like to know how it does that. Someone can give me some tips? If you're talking about Struts actions, they're not pooled, exactly. One instance of each action is created on demand and cached indefinitely. Actions need to be written so that a single instance can be used by multiple threads simultaneously. That way, you can just instantiate it once and no pooling is necessary. 2- These I strongly believe I should cache, and I'm already caching them, but with an solution designed by myself. I have some database tables that stores user permissions for the application. Basically, there are two tables that stores an module ID and who can access it (by user id, user profession, etc). I was thinking about loading all of them in memory at system startup and update them from time to time (or using Observable interfaces)? There's a difference between caching and pooling. It sounds more like you're talking about using caches (e.g., storing instances that hold copies of external data) which is often a good idea. Pools are stores of unused instances that client code can borrow an instance from for some period of time, and then return the instance when it's done. It sounds like caching may be a good idea in this case, especially if you don't expect the data to change much and all changes will be going through the cached objects. If some other program may be writing updates directly to the database, however, you'll need to worry about your cached data going out of date. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 What do you think about it? You may want to pursue object pooling, but the prevailing conventional wisdom is that it's not really necessary. Object Pooling is important for objects that are particularly expensive to create (due to internal object requirements, like connecting to external resources) and is not really appropriate simply for lots of standard generic Java objects. While instantiating an object certainly has some cost, creating and tossing them away is not overly expensive. Now, perhaps you've done some testing and found these particular objects to be problematic, but it seems to me to be a toss up between simply creating new objects versus using an object pool. Any object pool is necessarily going to at least have synchronization issues tied to it which may in the end cost more overall than creating and disposing of the objects. Modern GCs are pretty good about tossing away temporary objects. Now, if you're perhaps doing some things in a tight loop, then maybe simply a judicious use of the objects would be better. Say, rather than using a generic object pool, simply creating the few necessary instances for your loop before hand and reusing them explicity within the loop rather than constantly creating new ones. -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 -- To unsubscribe, e-mail: mailto:tomcat-user- [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: Object Pooling
-Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 4:11 PM To: Tomcat Users List Subject: RE: Object Pooling Yes... I guess I didn't know the difference between caching and pooling. Anyway, if now I got the idea, I should use a cache for the second case, ok. There is a good opensource implementation around? Well, first I'd ask whether the custom implementation you said you already have is up to the task. If you already have something that works, why replace it? If you do need to replace it, then the choice of what to replace it with will be largely determined by what you need from it. You can use EJBs as a database cache, or one of the many object-relational mapping tools like Jakarta OJB. Really, it's hard to pick one tool that would work for all situations, and this is starting to get a little off-topic for this list. It's probably worth taking a look at OJB as a starting point (http://jakarta.apache.org/ojb/objectcache.html). And in the first case, as my objects are not thread safe maybe I should use a pool, shouldn't I? Or maybe the effort doesn't pay? It's going to depend greatly on what happens when these objects are instantiated. If they do something very expensive every time (load a file, make a DB query, etc) and it would be possible to do that initialization just once, rather than once per request, then pooling might be helpful. If you're just creating a new object and not doing anything resource-intensive, then pooling probably won't gain you much. As with any optimization, it's best to actually measure performance before changing anything to make sure there's really a bottleneck, and then measure again after changing (if you decide to do so) to make sure you're really improving it. Cheers, -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 On Mon, 2002-12-23 at 18:52, Tim Moore wrote: -Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 2:52 PM To: Tomcat Users List Subject: Re: Object Pooling I'm rewriting this reply, maybe I wasn't clear enough :-) My application have two types of objects that are constantly created and destroyed. I believe that they could be pooled in some way (maybe using commons pooling package. These types are: 1- Objects that handle user interaction. Basically they are the objects that actually implement tasks that would be otherwise done using servlets. In pratice, JSPs send data to them (like html form data) and they process it and return the results to the browser. These ones i'm not sure (yet) if I should pool. I'm not familiar with Struts, I would like to know how it does that. Someone can give me some tips? If you're talking about Struts actions, they're not pooled, exactly. One instance of each action is created on demand and cached indefinitely. Actions need to be written so that a single instance can be used by multiple threads simultaneously. That way, you can just instantiate it once and no pooling is necessary. 2- These I strongly believe I should cache, and I'm already caching them, but with an solution designed by myself. I have some database tables that stores user permissions for the application. Basically, there are two tables that stores an module ID and who can access it (by user id, user profession, etc). I was thinking about loading all of them in memory at system startup and update them from time to time (or using Observable interfaces)? There's a difference between caching and pooling. It sounds more like you're talking about using caches (e.g., storing instances that hold copies of external data) which is often a good idea. Pools are stores of unused instances that client code can borrow an instance from for some period of time, and then return the instance when it's done. It sounds like caching may be a good idea in this case, especially if you don't expect the data to change much and all changes will be going through the cached objects. If some other program may be writing updates directly to the database, however, you'll need to worry about your cached data going out of date. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 What do you think about it? You may want to pursue object pooling, but the prevailing conventional wisdom is that it's not really necessary. Object Pooling is important for objects that are particularly expensive to create (due to internal object requirements, like connecting to external resources) and is not really
RE: Should not be this hard(why is this a security risk)
See these messages: http://www.mail-archive.com/announcements@jakarta.apache.org/msg00122.ht ml http://www.mail-archive.com/announcements@jakarta.apache.org/msg00128.ht ml -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Randy Paries [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 11:20 AM To: 'Tomcat Users List' Subject: RE: Should not be this hard(why is this a security risk) That is what I needed ... Thanks all To follow this up, why is this a security risk? Do they want specific mapping for each servlet? Thanks -Original Message- From: PELOQUIN,JEFFREY (HP-Boise,ex1) [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 9:54 AM To: 'Tomcat Users List' Subject: RE: Should not be this hard From the release notes Enabling invoker servlet: Starting with Tomcat 4.1.12, the invoker servlet is no longer available by default in all webapp. Enabling it for all webapps is possible by editing $CATALINA_HOME/conf/web.xml to uncomment the /servlet/* servlet-mapping definition. Using the invoker servlet in a production environment is not recommended and is unsupported. -Original Message- From: Randy Paries [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 8:51 AM To: 'Tomcat Users List' Subject: Should not be this hard Hello, me again This should have been so easy (famous last words) I am upgrading from tomcat jakarta-tomcat-4.0.4 to jakarta-tomcat-4.1.17 4.0.4 was working fine. For some reason I can not find my servlets ARG! In my web.xml I have a load-on-startup/ and in the log file , the servlet Starts ok But if I goto http://bart.mydomain.com:8080/servlet/uServlet I get a 404... Here is some details. I have to be missing something very simple. My static html and jsps work ok when I goto http://bart.mydomain.com:8080/index.html http://bart.mydomain.com:8080/jsp/dirgloblogin.jsp But if I goto http://bart.mydomain.com:8080/servlet/uServlet I get a 404 from the log file I get : 2002-12-19 09:42:13 StandardContext[]: Mapping contextPath='' with requestURI='/servlet/uServlet' and relativeURI='/servlet/uServlet 2002-12-19 09:42:13 StandardContext[]: Trying exact match 2002-12-19 09:42:13 StandardContext[]: Trying prefix match 2002-12-19 09:42:13 StandardContext[]: Trying extension match 2002-12-19 09:42:13 StandardContext[]: Trying default match 2002-12-19 09:42:13 StandardContext[]: Mapped to servlet 'default' with servlet path '/servlet/uServlet' and path info 'null' and update=true 2002-12-19 09:42:13 default: DefaultServlet.serveResource: Serving resource '/servlet/uServlet' headers and data In my server.xml I have Engine name=Standalone defaultHost=localhost debug=9 Host name=localhost debug=0 appBase=/home/unit unpackWARs=true autoDeploy=true Context path= docBase=/home/unit crossContext=true debug=9 reloadable=false /Context #ls -ls /home/unit/WEB-INF/classes total 104 32 -rwxrwxrwx1 apache apache 32734 Dec 18 21:31 bbsServlet.class 4 drwxrwxrwx3 apache apache 4096 Aug 24 22:19 com 36 -rw-rw-r--1 apache apache 33984 Nov 6 15:43 EditjsServlet.class 32 -rwxrwxrwx1 apache apache 31030 Dec 18 21:31 uServlet.class Thanks for any Help!!! -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [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: Should not be this hard(why is this a security risk)
-Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 12:09 PM To: [EMAIL PROTECTED] Subject: RE: Should not be this hard(why is this a security risk) These messages indicate that a fix is in the works: A new Tomcat 4.1.x release incorporating the fix to the invoker servlet will be made available shortly. Am I reading this correctly as saying the quick fix is to disable the invoker, but the long term fix is to change the invoker to make the problem go away? Actually, it's more the other way around. The quick fix was to patch the invoker servlet so that it doesn't allow you to invoke built-in servlets (such as the DefaultServlet). That eliminates the specific JSP source vulnerability that was reported in those messages. However, other servlets could have analogous problems. If for some reason you write a custom servlet that serves file content, for example, it could be vulnerable. Worse, any third-party servlets in your classpath can be executed, regardless of whether you actually use them or not in your application. All things said, the invoker servlet is a liability, and it's certainly not necessary in any case. It's best to use explicit mappings. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Larry [EMAIL PROTECTED] 12/19/02 09:38 AM See these messages: http://www.mail-archive.com/announcements@jakarta.apache.org/msg00122.ht ml http://www.mail-archive.com/announcements@jakarta.apache.org/msg00128.ht ml -- 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: How to start a standalone app from a servlet and problems with reading properties file
What does partial success mean? And in regards to question three, what exactly did you try, and in what manner did it fail? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: aps olute [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 1:11 PM To: Tomcat Users List Subject: Re: How to start a standalone app from a servlet and problems with reading properties file Can you kindly read the entire posting before responding? I did mention I attmpted to use geResourceAsStream() with partial sucess didnt I? There are several questions posted, so please read the entirety and put your responses according to the numbered question. The next reader of the post would most likely ignore the entire post because you Andreas Probst seem to answer the entire post without regard to the whole picture. There were 3 question posted. Your partial answer may have answered one, and did not answer the rest. --- Andreas Probst [EMAIL PROTECTED] wrote: Hi, this question has been answered many times. Look for properties files in the archive. Hint: Use servletContext.getResourceAsStream(); On 19 Dec 2002 at 9:20, aps olute wrote: Greetings, I have been trying to do the following using Tomcat 4.1.12: 1) Attempt to have a servlet read a properties or any text file. Reading the file from the doGet() method by: BufferedReader br = null; br = new BufferedReader(new FileReader(file)); //file is test.properties Result: Varying success, because I dont quite comprehend the Tomcat startup directory. Discovered that there is dependency on from where Tomcat was started. For example, if started Tomcat by ./bin/starup.sh from tomcat_home/bin/, I must have the file the servlet reads located at tomcat_cat/bin/. If I started Tomcat from tomcat_home/webapps/ by ../bin/startup.sh, I must have the properties file located at tomcat_home/webapps/ or else the servlet will not find this. 2) Atempt to have a servlet read a properties or any text file. Reading the file from the init() method by: BufferedReader br = null; br = new BufferedReader(new FileReader(file)); Result: Starting Tomcat from tomcat_home/bin/ by ./bin/startup.sh, failure to get Tomcat even to start, the log shows it only goes as far as Apache Tomcat/4.1.12 and stops. Starting Tomcat from tomcat_home/webapps/ by ../bin/startup.sh Tomcat starts, some other context are running, but the servlet reading this properties file on this specific context fails to find the properties file. Is using File IO bad in the init() method? I want to do this to initialize a standalone application. I surmized I cant read a properties file from init() method using File class. I did try as one suggested about using getResourceAsStream() with partial success. 3) Can a stand alone application be started at all from a servlet? I cant seem to get this to work, either from the init() or doGet() method. I can not launch an application why from a servlet, why? Any help on #3 please? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to start a standalone app from a servlet and problems with reading properties file
Well when you call getResourceAsStream, the path is resolved relative to the package the class is in, so if the servlet and the support class are in different packages, this would be expected. What if you call it on the servlet class from the support class? e.g., InputStream is = WhateverTheServletIsCalled.class.getResourceAsStream( parmPassedFromServlet ) or even better, instead of passing the file name from the servlet to the support class, why not have the servlet just load the properties and pass the properties object to the support class? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: aps olute [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 1:45 PM To: Tomcat Users List Subject: Re: How to start a standalone app from a servlet and problems with reading properties file Tim, Thanks for responding. Partial success was I was able to read the properties file using code snippet below in the servlet init() method: Properties p = new Properties(); InputStream is = getClass().getResourceAsStream(configFileName); //configFileName is test.properties p.load(is) This property file is loaded and parsed for a property needed by a support class. The parameter read is passed to the support class. When doing exact same InputStream is = getClass().getResourceAsStream(parmPassedFromservlet); in the support class, Tomcat does not start. I posted this earlier last week on: http://marc.theaimsgroup.com/?l=tomcat-userm=103982860916736; w=2 Basically, I am facing two issues, 1) dependent on where I start Tomcat from and 2) Using getResourceAsStream() fails in the support class. Any tips would be appreciated. Thanks. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.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]
RE: How to start a standalone app from a servlet and problems with reading properties file
If you MUST create a File object, then you really need to know the full path of the file somehow. You can try using servletContext.getRealPath(/WEB-INF/classes/ + configFileName) but that will mean that you cannot distribute your webapp as a packed WAR, and it may not work in other circumstances (depending on the appserver, security settings, etc.) And of course, you can put the file wherever you want in the webapp, it doesn't have to be in classes (and probably shouldn't be, since it's not a class, natch). Just pass getRealPath the path relative to the context root. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: aps olute [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 2:14 PM To: Tomcat Users List Subject: RE: How to start a standalone app from a servlet and problems with reading properties file The problem is someone else had written the support class. The support class will only take (File f) as its argument in its constructor. The support classes are written by separate developers. I can make changes to the portion I am responsible for but cant do much with the other part. Anyhow, the support class is having a fit not finding this file to read. My servlet sits at mycontext/WEB-INF/classes/ and the support class sits at mycontext/WEB-INF/classes/util/ so the relative path to that support class is then mycontext/WEB-INF/classes/util/ and this is where I would put the file it needs? --- Tim Moore [EMAIL PROTECTED] wrote: Well when you call getResourceAsStream, the path is resolved relative to the package the class is in, so if the servlet and the support class are in different packages, this would be expected. What if you call it on the servlet class from the support class? e.g., InputStream is = WhateverTheServletIsCalled.class.getResourceAsStream( parmPassedFromServlet ) or even better, instead of passing the file name from the servlet to the support class, why not have the servlet just load the properties and pass the properties object to the support class? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: aps olute [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 1:45 PM To: Tomcat Users List Subject: Re: How to start a standalone app from a servlet and problems with reading properties file Tim, Thanks for responding. Partial success was I was able to read the properties file using code snippet below in the servlet init() method: Properties p = new Properties(); InputStream is = getClass().getResourceAsStream(configFileName); //configFileName is test.properties p.load(is) This property file is loaded and parsed for a property needed by a support class. The parameter read is passed to the support class. When doing exact same InputStream is = getClass().getResourceAsStream(parmPassedFromservlet); in the support class, Tomcat does not start. I posted this earlier last week on: http://marc.theaimsgroup.com/?l=tomcat-userm=103982860916736; w=2 Basically, I am facing two issues, 1) dependent on where I start Tomcat from and 2) Using getResourceAsStream() fails in the support class. Any tips would be appreciated. Thanks. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.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]
RE: in search of more efficient design
Maybe a bit more than one word would be more helpful. ;-) Instead of having 60 - 70 servlet classes, you could have one servlet with 60 - 70 delegates that are loaded on demand. Struts includes the main servlet, and basically consists of a framework for creating and invoking those delegate classes. I'm not sure, though, whether they're actually loaded (and unloaded) on demand, or whether it loads on startup and keeps them all in memory. I have a feeling that it's half half: loads on demand, but then keeps them in memory until the webapp is restarted. Maybe Craig can comment. It's also worth noting that the memory freed from garbage collecting objects in Java isn't returned to the OS, but kept as the VMs free internal heap space. So just because the VM shows that it's using 500M of space doesn't mean that there are actually 500M of objects in memory. If there was high load at some earlier point that pushed it up to 500, it will stay there until you restart the VM. I don't know if that's relevant to your case, though. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Jacob Hookom [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 3:07 PM To: 'Tomcat Users List' Subject: RE: in search of more efficient design One word... struts -Original Message- From: ilasno [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 1:29 PM To: [EMAIL PROTECTED] Subject: in search of more efficient design PREAMBLE - I apologize if this is off-topic. I have been on this search for a month, and have searched the web far and wide, but have mostly found either J2EE design recommendations (higher-level than i am prepared to explore right now) or software vendors trying to sell me load-testing programs. I would appreciate pointers to self-enlightenment sites almost as much as more specific guidance. SHORT VERSION - I am a beginner-intermediate webapp designer, and my first large-scale development is using around 500 mb of memory, with low client load. I am seeking ways to both measure where this extreme resource-usage is stemming from and design tips to bring it down. LONG VERSION - The site I am developing is for a company that wishes to be able to change/update portions of their site through a web-based private section of their site. The result is an extensive admin implemented through a combination of jsp pages (for forms, and feedback) and corresponding servlets (for processing and database updating through db-access modules). The admin section is obviously much bigger and more resource-intensive than the public portion, which just hits the database once-an-hour for updates and displays the current data. Conversely, while the admin section is much larger (many more servlets with larger file sizes, more processing), it is obviously used much less (one or two users per day as opposed to many per day for the public portion). I have steered away from keeping variables global within servlets (including db-access module instances), so that within a doGet or doPost everything i need is created, and then i am assuming when the method ends everything is garbage-collected? is it possible to have that much memory used just to hold 60 or 70 servlets ready for requests? I am wondering if my design is flawed, or a bad idea altogether.. any help or guidance would be greatly appreciated. jesse -- i am deprogrammed -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [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: in search of more efficient design
-Original Message- From: Jacob Hookom [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 3:51 PM To: 'Tomcat Users List' Subject: RE: in search of more efficient design I thought 1 vs many servlets were brought up a while back (possibly late July), the conclusion was that it was VM dependent if I remember correctly. Probably appserver dependent. The question is really whether the infrequently used classes are unloaded from memory after use, because AFAIK no containers load servlets before they're first invoked unless you specify that they load on startup. With servlets, they may be unloaded after some period of inactivity, but that will be container-dependent and I don't think Tomcat supports that. With struts actions, I believe the answer is no; once an action is loaded, it's in memory until the ActionServlet is destroyed. You could create your own ActionServlet subclass, however, that throws out its action cache after a while. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 2:17 PM To: Tomcat Users List Subject: RE: in search of more efficient design Maybe a bit more than one word would be more helpful. ;-) Instead of having 60 - 70 servlet classes, you could have one servlet with 60 - 70 delegates that are loaded on demand. Struts includes the main servlet, and basically consists of a framework for creating and invoking those delegate classes. I'm not sure, though, whether they're actually loaded (and unloaded) on demand, or whether it loads on startup and keeps them all in memory. I have a feeling that it's half half: loads on demand, but then keeps them in memory until the webapp is restarted. Maybe Craig can comment. It's also worth noting that the memory freed from garbage collecting objects in Java isn't returned to the OS, but kept as the VMs free internal heap space. So just because the VM shows that it's using 500M of space doesn't mean that there are actually 500M of objects in memory. If there was high load at some earlier point that pushed it up to 500, it will stay there until you restart the VM. I don't know if that's relevant to your case, though. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Jacob Hookom [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 3:07 PM To: 'Tomcat Users List' Subject: RE: in search of more efficient design One word... struts -Original Message- From: ilasno [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 1:29 PM To: [EMAIL PROTECTED] Subject: in search of more efficient design PREAMBLE - I apologize if this is off-topic. I have been on this search for a month, and have searched the web far and wide, but have mostly found either J2EE design recommendations (higher-level than i am prepared to explore right now) or software vendors trying to sell me load-testing programs. I would appreciate pointers to self-enlightenment sites almost as much as more specific guidance. SHORT VERSION - I am a beginner-intermediate webapp designer, and my first large-scale development is using around 500 mb of memory, with low client load. I am seeking ways to both measure where this extreme resource-usage is stemming from and design tips to bring it down. LONG VERSION - The site I am developing is for a company that wishes to be able to change/update portions of their site through a web-based private section of their site. The result is an extensive admin implemented through a combination of jsp pages (for forms, and feedback) and corresponding servlets (for processing and database updating through db-access modules). The admin section is obviously much bigger and more resource-intensive than the public portion, which just hits the database once-an-hour for updates and displays the current data. Conversely, while the admin section is much larger (many more servlets with larger file sizes, more processing), it is obviously used much less (one or two users per day as opposed to many per day for the public portion). I have steered away from keeping variables global within servlets (including db-access module instances), so that within a doGet or doPost everything i need is created, and then i am assuming when the method ends everything is garbage-collected? is it possible to have that much memory used just to hold 60 or 70 servlets ready for requests? I am wondering if my design is flawed, or a bad idea altogether.. any help or guidance
RE: in search of more efficient design
-Original Message- From: Rick Fincher [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 5:02 PM To: Tomcat Users List Subject: Re: in search of more efficient design Is this correct? My JVM memory use expands and contracts all the time during a Tomcat run. The JVM will get bigger until it hits the memory limits set up at start time, then it will GC and get smaller, according to the OS anyway. This is on Solaris but I can't imagine that they would make the JVM such a memory pig on other OS's. Early versions maybe, but not now. I could be wrong, but I've seen it repeated often enough on here that I guess I took it as gospel! ;-) Well, at best then, it varies based on the specific JVM you're using. In general, I'd say you can't assume that all of the memory used by the JVM process is actually in use by the application, and you especially can't assume at any point that the GC has freed all of the memory that it could. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Rick - Original Message - snip It's also worth noting that the memory freed from garbage collecting objects in Java isn't returned to the OS, but kept as the VMs free internal heap space. snip -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:tomcat-user- [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: JSP to Servlet to JSP pathing issue. Relative PathingPlease help.
-Original Message- From: Mike W-M [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:44 AM To: Tomcat Users List Subject: Re: JSP to Servlet to JSP pathing issue. Relative PathingPlease help. True (and I missed that that was the whole point of your exercise) but redirecting is the (only) way to get the browser's URL to change. If you think about it, you're basically saying that you want two different URLs (one to the servlet and one to the jsp), when displayed in the browser, to mean the same thing - which just isn't going to work. Two possible solutions: a) The ugly but quicker one: code the absolute URL in the jsp's form's action attribute. b) The elegant one: Don't link to the jsp page at all. Always link to the servlet, then make the servlet check for the existence of parameters. If your parameters exist then it was a form submission, so do what ever you do now and then forward() to the jsp. (This leaves the URL the same in the browser and doesn't lose the request-info.) If parameters don't exist, then just forward() to the jsp page (without doing any processing). It'll presumably behave like it does now when you request it directly. However, the browser's URL will still have the servlet's URL - and you can code all the paths relative to that. Another option: use an HTML base tag in the JSP with the direct path to the JSP, so that the client will always resolve the URL relative to that JSP, even when the address bar shows the servlet's address. That will probably be the quickest and easiest change for you, but in truth Mike's solution B is probably the best in the long term. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 Mike. - Original Message - From: Jason Johnston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 17, 2002 3:25 PM Subject: Re: JSP to Servlet to JSP pathing issue. Relative PathingPlease help. The redirecting doesn't seem to work. That tells the browser client to initiate a new request and all the information that I placed in the request object is gone, which undermines the purpose of the form. The forums have a lot on my problem, just no answers that have worked for me. Has anyone else ran into the issue of using a form in a JSP to submit data to a Servlet, have that servlet return data to the very same JSP? Thanks in advance. [EMAIL PROTECTED] 12/16/02 12:53PM Thanks for the advice, I didn't know you could redirect. The javadoc on the RequestDispatcher only lists the forward and include methods. I'll try that. The initial call to the servlet is actually being made by the client browser via a form response. [EMAIL PROTECTED] 12/16/02 12:00PM If you want the path in the browser's address bar to change, I think you have to use a redirect rather than a forward. (I've read that even then it's not guaranteed to work (since it's browser-dependent), but it's working fine for me. There's the disadvantage of an additional network round-trip that's not ideal, but I don't know of any other way.) [Actually, I guess you're already redirecting from the original jsp request to the servlet. If you changed that to forward then that'd probably solve you're problem without the additional round-trip] Mike. - Original Message - From: Jason Johnston [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, December 16, 2002 5:46 PM Subject: JSP to Servlet to JSP pathing issue. Relative Pathing Please help. I have a JSP that has a form that I want processed by a servlet. The servlet then places the results in the page context and redirects back to the JSP. Everything works fine on the first go, but the second time through the path in the client's browser is no longer valid. Initially, the path is: http://localhost:8080/testgroup/lookup.jsp This then sends the form data to the /testgroup/servlet/dolookup?parameters The servlet executes and uses the request dispatcher to load the original JSP. RequestDispatcher rd=getServletContext().getRequestDispatcher(//lookup.jsp); rd.forward(request,response); The original JSP comes up fine and has the results, but the path in the browser URL is still the servlet address. Since the form sends to a relative path, the second time you try to run, it doesn't work. http://localhost:8080/testgroup/servlet/test.dolookup?epaid=J2466search =id firstname=lastname= This seems to be a very simple relative pathing problem, but I've tried various solutions with no luck. I'm sure someone else has run into this and found a solution. If anyone has any insight, please help. Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL
RE: File access from a servlet.
-Original Message- From: Patrick Martz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 1:42 PM To: '[EMAIL PROTECTED]' Subject: File access from a servlet. Hi all. I'm currently working on a java servlet with tomcat and I want it to be able to load a different data file dependent on certain parameters passed to the servlet. The problem is that if I just try to open the file with the file name (i.e. FileInputStream fin = new FileInputStream(blah.dta);) it fails to find the file. I am guessing this is because the runtime directory is different from the directory the servlet is running in? (the data file and the servlet are in the same directory, but the servlet fails to find the file still). So my question is, is there a way to get the current runtime directory for Tomcat so that I can perhaps supply a relative path to get to the file and have the servlet be able to open it? Thanks! Patrick P.S. For debugging purposes I HAVE tested opening of the file from a stub class and it works just fine that way, but fails from the servlet. Rather than using FileInputStream, try ServletContext.getResourceAsStream. This is the preferred method for accessing files within your webapp. You pass in the path relative to the context root directory. An added bonus is that this will still work if you deploy your webapp as a WAR. http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html#getResourceAsStream(java.lang.String) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: File access from a servlet.
-Original Message- From: Patrick Martz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 2:02 PM To: 'Tomcat Users List' Subject: RE: File access from a servlet. Ok well that's exactly the problem. getResourceAsStream requires you to supply the path of the resource and that is what I'm missing. I did a quick look at ServletContext and iterated through the attributes and found none that seemed to give me what I want. These are the attributes currently defined: org.apache.catalina.jsp_classpath javax.servlet.context.tempdir org.apache.catalina.resources org.apache.catalina.WELCOME_FILES None of which seems to be what I'm looking for...essentially something that will tell me the path of my current context so I can modify that path to access my data file. :) But the path is relative to the root of the context, so you don't need to know the path to the context, just where the file is within it. For example, if your file is actually in /usr/local/tomcat/webapps/myapp/data/blah.dta, you would call ServletContext.getResourceAsStream(/data/blah.dta). If you *really* want the path of the context root, you can use ServletContext.getRealPath(/) (or ServletContext.getRealPath(/data/blah.dta) to get the file's path) but that won't work with WARs, and shouldn't really be necessary. I just reread your message and realized that you said that the data is stored in the directory with the servlet class file. Maybe you can use getClass().getResourceAsStream(blah.dta)? -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:46 AM To: Tomcat Users List Subject: RE: File access from a servlet. -Original Message- From: Patrick Martz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 1:42 PM To: '[EMAIL PROTECTED]' Subject: File access from a servlet. Hi all. I'm currently working on a java servlet with tomcat and I want it to be able to load a different data file dependent on certain parameters passed to the servlet. The problem is that if I just try to open the file with the file name (i.e. FileInputStream fin = new FileInputStream(blah.dta);) it fails to find the file. I am guessing this is because the runtime directory is different from the directory the servlet is running in? (the data file and the servlet are in the same directory, but the servlet fails to find the file still). So my question is, is there a way to get the current runtime directory for Tomcat so that I can perhaps supply a relative path to get to the file and have the servlet be able to open it? Thanks! Patrick P.S. For debugging purposes I HAVE tested opening of the file from a stub class and it works just fine that way, but fails from the servlet. Rather than using FileInputStream, try ServletContext.getResourceAsStream. This is the preferred method for accessing files within your webapp. You pass in the path relative to the context root directory. An added bonus is that this will still work if you deploy your webapp as a WAR. http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html#getResourceAsStream(java.lang.String) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat/IIS losing request parameters
Try this: http://localhost/mydir/test%20with%20spaces.jsp?one=1two=2 Literal spaces are not legal in URLs (as Cees pointed out) but they can be encoded as %20 and that should be decoded correctly by Tomcat. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Ian Pilborough [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 6:29 AM To: 'Tomcat Users List' Subject: Tomcat/IIS losing request parameters Hi, I have problem with IIS and Tomcat losing request parameters. I have a set-up with IIS 5.0 and Tomcat 4.0.6 on Windows 2002 Advanced Server and JDK 1.3.1_01 and for sometime this has worked fine, but I have just noticed that request parameters are lost when there are spaces in the filenames of a JSP being served. With this code to loop through request.getParameters() on two pages I get two different outputs from the same request parameters. % int i =0; for (Enumeration e = request.getParameterNames() ; e.hasMoreElements() ;) {% %=++i% = %=e.nextElement()%BR %} % For http://localhost/mydir/testwithoutspaces.jsp?one=1two=2 I get: 1 = one 2 = two For http://localhost/mydir/test with spaces.jsp?one=1two=2 I get nothing returned. If I hit the pages via port 8080 I get the correct response (i.e. from testwithoutspaces.jsp above) from both pages. I can't see what is happening here and wondered if this is a known feature when using filenames that contain spaces between words. I've looked for similar problems with lost request parameters and all I have found is that IE sending URLs in UTF-8 can cause a problem with certain versions of Tomcat. None of the problems I reviewed mentioned IIS and Tomcat in conjunction though. If tomcat handles the URLs fine as standalone on port 8080 the only difference is with requests being passed through to Tomcat from IIS via the AJP connector. I've got two further problems, in that I didn't configure the original system and that the system is in a co-location centre that I don't have much access to. I'm currently setting up a test environment with IIS, but that's not working at present, the original test environment didn't use IIS and so I'm fighting to get a test set-up ready to work on this. (The joys of picking up other's pieces eh?) Finally, it is not possible to create the filenames without spaces in them due to the software that produces each JSP (it's a long story, but not relevant to this discussion). If anyone has any ideas, please send me a message, otherwise I shall continue to trawl the net. Cheers, Ian -- 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: 4.1.12 JSP Tag Lifecycle -- Where to re-initialize tag?
Mostly in doStartTag. See http://jakarta.apache.org/taglibs/guidelines.html for more tips. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 2:34 PM To: Tomcat Users List Subject: 4.1.12 JSP Tag Lifecycle -- Where to re-initialize tag? In out port of code from 3.2 to 4.1, we're encountering some problems with how Tomcat reuses our tags. I looked at the code, and TagHandlerPool does not call the 'release' method of the tag unless the pool is full (this is within the reuse method). My question, then, where is the appropriate place to re-initialize internal properties for a jsp tag? The life cycle diagram doesn't really have a precise place to reinitialize the content to their defaults, so I'm curious where others are putting this kind of code. Regards, Will Hartung ([EMAIL PROTECTED]) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Directory Structure
-Original Message- From: Jim Henderson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 3:29 PM To: 'Tomcat Users List' Subject: RE: Directory Structure For 3+ days I have been trying to get a servlet to run in Tomcat 4.1.12. It ran fine in 4.0. It is the only servlet in webapp package of 6 JSP pages. The JSP pages work OK, they even use the JSTL. The application is displayed in a series of HTML frames, with the servlet being the last item to be displayed. If I comment out most of the code in my servlet and comment out the package xxx at the top of the file, it works (no function but is displayed) and it is pulled out of the java .jar file. I have tried almost every combination of servlet-mapping in the web.xml file that I can think of. When I include the package mfnettags at the top of the java source file I have made subdirectories and copies of it all over the place in the WAR file mfnettags\servlet\classes mfnettags\servlet\classes\mfnettags mfnettags\WEB-INF\classes\mfnettags mfnettags\WEB-INF\classes mfnettags\WEB-INF\mfnettags mfnettags\WEB-INF\mfnettags\classes etc ... in hopes that it would find it. I have tried to follow every posted suggestion on how to process: javax.servlet.ServletException: Cannot allocate servlet instance for path /mfnettags/servlet/DocViewServlet and java.lang.NoClassDefFoundError: DocViewServlet (wrong name: mfnettags/DocViewServlet) or Requested resource ... not available. The Java servlet name is: DocViewServlet The Java servlet package is: mfnettags The web application is: mfnettags This is driving me bananas. Any suggestions? What are you using for your servlet element and servlet-mapping element? The class, if you have package mfnettags should be at mfnettags/WEB-INF/classes/mfnettags/DocViewServlet.class The servlet declaration should be like this: servlet servlet-nameDocViewServlet/servlet-name servlet-classmfnettags.DocViewServlet/servlet-class /servlet The mapping should be something like this: servlet-mapping servlet-nameDocViewServlet/servlet-name url-pattern/servlet/DocViewServlet/url-pattern !-- or whatever you like -- /servlet mapping It sounds to me like you may have forgotten the package name in the servlet-class element above. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: RE: I don´t understand the objective of this open list !
-Original Message- From: Mike DiChiappari [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 5:11 PM To: Tomcat Users List Subject: Re: RE: I don´t understand the objective of this open list ! David, You are a perfect case in point. I want to use tomcat, but I am not a geek. I want proper user level documentation. I should not have to know about how a damn java app server works internally (nor how to build it) in order to setup one up and use it. So buy a commercial app server with commercial support. Or hire a consultant that knows Tomcat. There are lots of productive things you could do to get an app server working, but complaining on the mailing list about how sucky Tomcat is probably won't. Is the point of Jarkata to keep geeks happily typing away or to provide something useful? Software is not useful if you can't explain how to use it properly. I believe the point originally was to provide reference implementation code for the servlet spec that could be used as an example or basis for commercial app servers. But plenty of people have used it successfully as a production standalone app server, so that's where it is today. YMMV. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Error with THIS web.xml file:
According to the official DTD, the order of elements in web.xml matters. If you move your welcome-file-list after the servlet-mapping, it should work ok. You can find the correct order by reading the DTD at the URL in the DOCTYPE, but here it is for convenience: !ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:03 PM To: 'Tomcat Users List' Subject: Error with THIS web.xml file: This is my web.xml file: ?xml version=1.0 encoding=ISO-8859-1? !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-nameCarpool Database/display-name descriptionUtility to mitigate the impact of the impending transit strike/description welcome-file-list welcome-filestart.jsp/welcome-file welcome-filestart.html/welcome-file welcome-fileindex.html/welcome-file welcome-fileindex.htm/welcome-file welcome-fileindex.jsp/welcome-file /welcome-file-list servlet servlet-nameDisplayServlet/servlet-name display-nameDisplayServlet/display-name servlet-classDisplayServlet/servlet-class /servlet servlet-mapping servlet-nameDisplayServlet/servlet-name url-pattern/DisplayServlet/url-pattern /servlet-mapping /web-app For the life of me, I can't figure out why there's a problem, but Tomcat refuses to parse this! I keeps complaining about line 20, column 11, which is where my first servlet tag starts. Is there something stupid I'm missing here? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Error with THIS web.xml file:
Yes, exactly! http://java.sun.com/dtd/web-app_2_3.dtd is a real URL for the DTD. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:09 PM To: 'Tomcat Users List' Subject: RE: Error with THIS web.xml file: Ah... That did it. Where can I get a hold of the official DTD? Can I just puke that URL into IE's location bar to download it? -Original Message- From: Tim Moore [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:06 PM To: Tomcat Users List Subject: RE: Error with THIS web.xml file: According to the official DTD, the order of elements in web.xml matters. If you move your welcome-file-list after the servlet-mapping, it should work ok. You can find the correct order by reading the DTD at the URL in the DOCTYPE, but here it is for convenience: !ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*) -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:03 PM To: 'Tomcat Users List' Subject: Error with THIS web.xml file: This is my web.xml file: ?xml version=1.0 encoding=ISO-8859-1? !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-nameCarpool Database/display-name descriptionUtility to mitigate the impact of the impending transit strike/description welcome-file-list welcome-filestart.jsp/welcome-file welcome-filestart.html/welcome-file welcome-fileindex.html/welcome-file welcome-fileindex.htm/welcome-file welcome-fileindex.jsp/welcome-file /welcome-file-list servlet servlet-nameDisplayServlet/servlet-name display-nameDisplayServlet/display-name servlet-classDisplayServlet/servlet-class /servlet servlet-mapping servlet-nameDisplayServlet/servlet-name url-pattern/DisplayServlet/url-pattern /servlet-mapping /web-app For the life of me, I can't figure out why there's a problem, but Tomcat refuses to parse this! I keeps complaining about line 20, column 11, which is where my first servlet tag starts. Is there something stupid I'm missing here? -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [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]