RE: Does Apache worth it?
Images... -Original Message- From: Benjamin Wong [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 01, 2001 1:01 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Does Apache worth it? Hi, I am very interested in this issue as well. What if all the pages of the website are generated through servlets and JSP's (except for the token few images/gifs) ? In cases of no static content, would Apache still make any difference ? Thanks. Ben - Original Message - From: David Crooke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 01, 2001 12:39 PM Subject: Re: Does Apache worth it? The built in webserver in a Java appserver is really only suitable for testing with - if you are serving more than a few thousand pages per day, or doing anything remotely serious for production use, or your server is on the internet, you should use a real webserver in front of Tomcat, and Apache is the one of choice. Principal reasons are: Performance - Apache is much faster at handling connections and doing basic processing on URLs; it's IO is well optimised (the only thing that beats it is a kernel-space websever like khttpd or Tux) You can also get it to serve any bits of purely static content, such as image files, taking some load off the Java layer. Finally, you can more easily multiplex across multiple Java VM's on multiple boxes, for scalability and redundancy. Configurability - Apache is very powerful and flexible as far as configuration is concerned, and can handle all kinds of complex multi-site hosting issues. Security - Apache has been used on the internet for years by many, many sites, and has withstood all kinds of attacks; most of the vulnerabilities in it have been found and eliminated. By contrast, Tomcat's built in server has not had this level of robust testing. By avoiding the need to connect Tomcat directly to port 80/443, Apache provides an additional layer of insulation between your appserver and the bad guys. Nivedan Nadraj wrote: Hi Eitan, Apache as far as I know is a powerful full blown HTTP server. Tomcat is also a webserver and as you already know it supports servlets and JSP's. The internals of how Tomcat and apache differ I do not know. But from the docs I guess it's the divide and rule policy. Anyting related to static it is directed to Apache since it is a proven and powerful HTTP service and when it is servlets or JSP it is redirected to Tomcat. Basic developement we can use Tomcat I guess for production it is better to use Apache to serve the static files. There is more to it...this is my part. Nive --- Eitan Ben Noach [EMAIL PROTECTED] wrote: Hello all, We are intending to use Apache Tomcat as web server in our product, and preliminary experiments show excellent performance. Most of our web pages are JSPs and servlets, and few HTMLs and Gifs. We wonder what is the contribution of Apache in our scenario - some of us think that Tomcat standalone is enough. Is there any advantage of using Apache and not Tomcat standalone? We will appreciate any contributing input. Thanks, - Eitan Ben-Noach Proficiency, Ltd. Tel: +972.2.548.0287 Fax: +972.2.586.3871 email: [EMAIL PROTECTED] The Intelligence in Engineering Supply Chain Collaboration http://www.proficiency.com/ __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
RE: Accessing environment variables
Java system properties are different from environment variables as you probably know. If you look at your start up script (tomcat.sh) you will see that the command is executed with a -Dtomcat.home=${TOMCAT_HOME}. The -D parameter is how you set environment properties for Java at run time. If you use System.getProperty(tomcat.home) you should get what you are looking for. -Jamey -Original Message- From: Brandon Cruz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 2:08 PM To: [EMAIL PROTECTED] Subject: Accessing environment variables I have a question which is somewhat off topic... Is there a way to access my environment varibables(ex. TOMCAT_HOME) from my servlets running in tomcat? I just need to somehow return the path to TOMCAT_HOME. Is there some simple method call that can achieve this? Thanks in advance! Brandon
RE: Configuring uriworkermap.properties (ISAPI REDIRECTOR for Tomcat /IIS 5.0)
I believe you've answered your own question:) -Jamey -Original Message- From: test test [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 6:46 PM To: '[EMAIL PROTECTED]' Cc: Daniel Kang Subject: Configuring uriworkermap.properties (ISAPI REDIRECTOR for Tomcat /IIS 5.0) Hello I have managed to get IIS 5.0 to serve the JSP examples. I have added a context for my own files which are sitting under the Jakarta directory and this works fine. How can I get JSP files located under c:/inetpub/wwwroot/ to work ? I suspect I may have to add another context , can anyone help ? Many thanks Hamant
RE: Memory usage
Actually, setting a Java object to null (assuming that there are no other references to that object) is the normal way of telling the VM that the object may be garbage collected. The garbage collection takes place asynchronously however and at the discretion of the VM in a background thread. The act of deleting all references to an object does not free the memory associated with the object until the garbage collector cleans up the object. -Jamey -Original Message- From: Jurrius, Mark [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 7:43 AM To: [EMAIL PROTECTED] Subject: RE: Memory usage Correct me if I'm wrong. If for instance I want a bean removed knowing that System.gc() does not happen immediately, would setting the bean equal to null force the bean to be removed from memory right away and not have to rely on the garbage collection to eventually take place? Mark -Original Message- From: William Kaufman [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 10:07 AM To: '[EMAIL PROTECTED]' Subject:RE: Memory usage That your finalize method is called, doesn't mean that the garbage collector has released your objects. The only way to be shure that this happens, is to explicitly run System.gc(). Even that's not sufficient: it just suggests to the VM that garbage-collecting might be a good idea right now. Any actual garbage collection would take place later, in another thread. And, even when it does happen, that doesn't mean all the memory will necessarily be released to the OS: the VM will hold on to some so that it won't need to go back to the OS on the next allocation. You might want to get a memory profiler (like JProbe) and see where the memory is going. At the very least, try doing something like, Runtime rt = Runtime.getRuntime(); System.err.println(Free=+rt.freeMemory()+, total=+rt.totalMemory()); often, to see how much memory is actually in use, and how much is just allocated from the OS. -- Bill K. -Original Message- From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 5:51 AM To: '[EMAIL PROTECTED]' Subject: AW: Memory usage That your finalize method is called, doesn't mean that the garbage collector has released your objects. The only way to be shure that this happens, is to explicitly run System.gc(). Otherwise it's up to the VM when it will free the memory. (Sun's JDK per default only releases memory if otherwise an OutOfMemoryError would occur, so unless you reach this border the VM will constanly grow) See also the options for the JVM: -verbose:gc (Any VM) -Xincgc (Sun SDK 1.3.*) -Xms (Sun + IBM) -Xmx (Sun + IBM) -Ursprüngliche Nachricht- Von: Garry De Toffoli [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 3. Mai 2001 14:34 An: [EMAIL PROTECTED] Betreff: Memory usage snip/ I have in trouble with the memory usage with Tomcat 3.21, WinNt 2000 and Jdk 1.3 of Sun. the problem is that any operation does not release the memory occuped; to control the memory usage I use the Task Manager; when Tomcat start, the memory used from the process Java is of 9608 K; when I request a Jsp page that has an error, like a variable not declared, the memory used is 11868K; if I wait for 1 ay also, this value does not change, so the memory used is not released, running a correct Jsp page, the memory used increase, and this is not released yet; I have written a log on the finalize method of my class, and this is called, so the garbage collector release all my object. This behavoir is normal? Probably changing the version of Tomcat this problem may be corrected. snip/
RE: ServletOutputStream
For any given HTTP request the server returns a single response of a single type. If you want to return test/html then that is what the server will tell the browser it is returning and in turn, the browser will try to display the data that way. If you want to return a byte stream like image/jpeg then the browser expects just the bytes making up that stream and no additional stuff like text. You should avoid mixing use of the ServletOutputStream for different types of data. As for your include problem you should avoid trying to do multiple things per request as the Servlet API will often throw errors and if not, stuff will often still not work the way you intended. I found a piece of code at our company in which someone was trying to write to the ServletOutputStream but on an error they would call the HttpServletResponse.sendRedirect(String) call. I don't remember whether the servlet API explicitly threw an error but the code sure didn't work as intended. -Jamey -Original Message- From: Georges Boutros [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 17, 2001 11:43 AM To: Tomcat (E-mail) Subject: ServletOutputStream hi, i want to use the ServletOutputStream to send the data of a JPG image to the browser. ServletOutputStream ServletOut = response.getOutputStream(); it's working good but i can't write any text before or after the image. if i set response.setContentType("text/html"); i see the text that i wrote and the data of the image as text (which is normal) and if i set response.setContentType("image/jpeg"); i don't see the text neither the Image i use ServletOut.Print("hello"); to write my text if i include a file with: request.getRequestDispatcher("/jsp/web/test.jsp").include(request, response); i got an error that OutputStream is already being used for this request can anyone help me thanks Georges