Writing files accessible from a browser

2006-08-07 Thread Romain Quilici
Hi all, I have been reading several messages about writing files inside a web application, but I found no answer regarding my problem. I need to write files on the file system that can be accessible with a browser(I write images). - The most reliable solution I found was to use the webapp's

Re: Writing files accessible from a browser

2006-08-07 Thread Li
if you have apache server, you can write file to its home dir, and then use http://youdomain/image_dir/image_name.suffix to view. On 8/7/06, Romain Quilici [EMAIL PROTECTED] wrote: Hi all, I have been reading several messages about writing files inside a web application, but I found no answer

Re: Writing files accessible from a browser

2006-08-07 Thread Romain Quilici
Thanks for the answer, this solution was part of my investigation, and was actually the first idea I had. The problem with this approach is I don't know how to access the /image_dir/ from within my web application. Maybe using something like String path = servletContext.getRealPath(/); String

Re: Writing files accessible from a browser

2006-08-07 Thread Li
Hi, Here are few steps of achieving it (just tested, and it works): 1. use FileOutputStream or any output streaming object to write a image file into the directory in Windows, the path string should look like: c:\apache_home\httpdocs\images\1.jpg in unix/linux, the path should look like

Re: Writing files accessible from a browser

2006-08-07 Thread Romain Quilici
Hi, thanks for the advice, But I want to avoid harcoded links such as $APACHE_HOME\httpdocs\images or a href=http://yourdomain/images/1.jpg; in my jsp. Indeed I don't want to modify these values if I decide Tomcat to run on another port, or to install Tomcat in another directory or even OS.

Re: Writing files accessible from a browser

2006-08-07 Thread Li
Hi, It is not advisable to make your webapp dir writable, can you tell me what exactly would you like to achieve so that I may get more info to help out ... On 8/7/06, Romain Quilici [EMAIL PROTECTED] wrote: Hi, thanks for the advice, But I want to avoid harcoded links such as

Re: Writing files accessible from a browser

2006-08-07 Thread Romain Quilici
Hi, Hope I will be clear enough: One part of my web application receives encodes stream that it has to convert to jpg images. When an image is written on the server, it notifies a Servlet which pushes the name (or the url) of the newly generated image inside client browser(thanks to

Re: Writing files accessible from a browser

2006-08-07 Thread Almir Kazazic
Hi, to avoid using absolut paths you can find that out on runtime by getContext().getRealPath(/) - will return your path to the root regards On 8/7/06, Romain Quilici [EMAIL PROTECTED] wrote: Hi, Hope I will be clear enough: One part of my web application receives encodes stream that it

Re: Writing files accessible from a browser

2006-08-07 Thread Romain Quilici
I agree with you, but getContext().getRealPath(/), will return the path to my webapp root, so it means I am going to create my image dir under my webapp, which is fine unless my application is deployed in a war file. In such case I won't be able to write in my webapp. Maybe using String path =

Re: Writing files accessible from a browser

2006-08-07 Thread Almir Kazazic
Oh I see, something like that , i do not think taht this will work String imagePath = path+../imagedir; but you will have to either convert path to instance of directory object, or chop of the end by some string functions , using String imagePath = path+../imagedir; as path works for browser

Re: Writing files accessible from a browser

2006-08-07 Thread Mohsen Saboorian
You can use a servlet init param inside web.xml for avoiding hardcoded solutions. e.g. context-param param-nameMY_PATH/param-name param-valuec:\my\path\to\imgs/param-value /context-param On 8/7/06, Romain Quilici [EMAIL PROTECTED] wrote: Hi, Hope I will be clear enough: One part of my web

FYI tomcat 100% load SSL

2006-08-07 Thread Oscar Mechanic
For those of you who ever have this problem Symptoms 1) Cannot connect to tomcat after a period of time 2) Heavy load on startup 3) Various strangeness with SSL certs e.g. WEB browsers reject certs/incomplete TLS handshake Observed case Tomcat version we tried jakarta-tomcat-5.0.12 and

decompile java class

2006-08-07 Thread Tomcat
Hello would you pleas help me with this , when I am trying to decompile a class file with javap -c myclass.class I am receiving following error : Error: Binary file myclass contains com.cnsw.reveiw.conf how can I decompile the class file that contain another class , also I want to use it

Re: FYI tomcat 100% load SSL

2006-08-07 Thread Chris Lear
* Oscar Mechanic wrote (07/08/06 12:04): For those of you who ever have this problem Symptoms 1) Cannot connect to tomcat after a period of time 2) Heavy load on startup 3) Various strangeness with SSL certs e.g. WEB browsers reject certs/incomplete TLS handshake Observed case

RE: Writing files accessible from a browser

2006-08-07 Thread Tim Lucia
One solution which is often mentioned to this question is to return a URL to a servlet which knows how to generate the .jpg image as its response. Set the context type appropriately, and write the JPEG bytes to the output stream. Tim -Original Message- From: Mohsen Saboorian

Re: FYI tomcat 100% load SSL

2006-08-07 Thread Mark Thomas
Oscar Mechanic wrote: For those of you who ever have this problem When starting a new thread (ie sending a message to the list about a new topic) please do not reply to an existing message and change the subject line. To many of the list archiving services and mail clients used by list

Re: Classpath problem

2006-08-07 Thread David Smith
The quick answer: Do not mess with classpath. Tomcat has a very specific classloader hierarchy. See http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html for details. If this does not answer your question, please post a more detailed message with specifics. --David Julien

Re: apache Tomcat webserver problem

2006-08-07 Thread David Smith
Question: Is the other computer you are trying to contact tomcat from on the same subnet or outside your cable router. I ask because 192.168.x.x addresses are not routeable. You can get around that with config settings in your cable router, check the docs for details. Outside of that,

Re: Restarting Tomcat causes application to be displayed across all instances

2006-08-07 Thread David Smith
Tomcat does not explicitely use any specific classpath outside of it's own. It even ignores the system set CLASSPATH variable. Check your config settings and webapp for references to ~/cvs/fable/* directory. --David Ryan O'Hara wrote: I think I found a promising lead to what is going wrong

Re: Problem with java.library.path

2006-08-07 Thread David Smith
Your log message sited below is not related to accessing jpl.jar. It's just a message stating it couldn't use the new native APR connector and is falling back to the traditional Coyote connector. As far as an external jar file, best practice is include it in your webapp in WEB-INF/lib. In

Upgrade problem (useBean)

2006-08-07 Thread Lars Nielsen Lind
I have tried to upgrade from apache-2.0.54/tomcat-5.5.9 to apache-2.2.3/apache-5.5.17 (also tried with apache-2.0.59). When I use this UseBean at index.jsp (root of webapplication): jsp:useBean id=conn_applikationsinfo scope=request class=internet.database.SimpleUseOfConnectionPool / I have

Re: Problem with java.library.path

2006-08-07 Thread Minh Tu Thanh Tran
Thanks David, Again, I want to start the prolog engine, so I need to load the library of prolog when I start Tomcat 5.5.17. I think the command line is: java -Djava.library.path=$PLLIBDIR $1 But I do not know where to put this command line in Tomcat in order to load the prolog library when

Re: howto deal with war files if context.xml needs configration?

2006-08-07 Thread Mikolaj Rydzewski
Holger Klawitter wrote: I have written a webapplication with I would like to distribute as a war file amongst a few hosts. There is a resource in the context file which needs some individual configuration per server. * I used to unpack directly into the webapps directory and doing the

Re: howto deal with war files if context.xml needs configration?

2006-08-07 Thread Almir Kazazic
where can I find more information about old way ? On 8/7/06, Mikolaj Rydzewski [EMAIL PROTECTED] wrote: Holger Klawitter wrote: I have written a webapplication with I would like to distribute as a war file amongst a few hosts. There is a resource in the context file which needs some

Re: Writing files accessible from a browser

2006-08-07 Thread Moises Lejter
I had a similar question, earlier... There is another issue here: you are right that WAR files are expanded back into a folder - at least by default - so one could still create a folder within the web app to write to, and which is visible to browsers... Until one deploys an updated WAR file.

RE: apache Tomcat webserver problem

2006-08-07 Thread Peter Crowther
From: Rahul Sood [mailto:[EMAIL PROTECTED] Now when I try to access the app using the following url http://192.168.15.100:8080/sample from my machine it works fine. But if i go to another machine, I am not able to access the website. Have you checked your firewall settings? That's the

RE: Apache, mod_jk and Tomcat looses sessions

2006-08-07 Thread Markus
Markus wrote on Monday, July 31, 2006 5:39 PM: Markus wrote on Monday, July 31, 2006 5:34 PM: I've got the following problem on one server using Apache 2.0.54-5 (Debian x86) with mod_jk 1.2.15 (self-compiled) and tomcat 5.5.17: I try to create a redirect to a page with a session-id if there

Some initial config help needed (limiting manager/admin pages to specific IPs)

2006-08-07 Thread FH
This past week is my first experience/time working w/ tomcat so please bear w/ me. I think I have most of it figured out, the server seems to be running ok and I've successfully limited the connections to it to ssl only by a couple of hacks to the server.xml config file[1] The one final thing I

Code performance question #1

2006-08-07 Thread David Kerber
I have a couple of questions about the performance of my code, but I'm going to ask them in separate threads. The first one is, if I have this loop: for ( ii = 0; ii data.length; ii++ ) { where data is defined as byte[] , is the .length property evaluated each time through the loop,

Re: Code performance question #1

2006-08-07 Thread David Kerber
By the way, this code is in a servlet running under 5.5.12, if it matters. David Kerber wrote: I have a couple of questions about the performance of my code, but I'm going to ask them in separate threads. The first one is, if I have this loop: for ( ii = 0; ii data.length; ii++ ) {

Re: Writing files accessible from a browser

2006-08-07 Thread Len Popp
So, you need a directory where you can write files and serve them to the web, and you don't want that directory to be hard-coded in your application. First, you need a way to specify the directory when the app is installed. (In general your app may need a bunch of configuration settings.) There

Re: Code performance question #1

2006-08-07 Thread Leon Rosenberg
data.length is evaluated each time. here's the example to demonstrate it: public class TestLoop { public static void main(String a[]){ byte data[] = new byte[10]; int counter = 0; for (int i=0; idata.length; i++){

Re: Code performance question #2

2006-08-07 Thread Leon Rosenberg
thats ugly, why don't you tokenize it into string pairs, store the pairs and works with them? leon On 8/7/06, David Kerber [EMAIL PROTECTED] wrote: This code is part of a servlet running in TC 5.5.12, jre ver 1.5.0.6. I use this code to break out individual data fields from a line which is

RE: Code performance question #2

2006-08-07 Thread Peter Crowther
From: David Kerber [mailto:[EMAIL PROTECTED] It is executed for over 2 million data lines per day, so this routine is executed over 10 million times per day. [snippet of code that parses the line each time elided] Opinion: You're optimising the wrong piece of code. You're calling this 5

Re: Code performance question #1

2006-08-07 Thread David Kerber
Thanks for the help! Leon Rosenberg wrote: data.length is evaluated each time. here's the example to demonstrate it: public class TestLoop { public static void main(String a[]){ byte data[] = new byte[10]; int counter = 0; for (int i=0; idata.length; i++){

RE: Silent install of tomcat 4.1.31 on windows fails

2006-08-07 Thread Propes, Barry L
typically, when I've installed Tomcat, and always on Windows, be it testing with a box at home or on a server at work, I've simply unipped it to my C or D drive. But I was able to create it as a service nonetheless w/.o any additional registry keys. I think it mainly needs the service set up

Re: Code performance question #2

2006-08-07 Thread David Kerber
I'm not sure how to Split it on the , put it into a suitably keyed structure such as a Map other than the way I'm doing it already, unless I'm not understanding your suggestion. So I think I need to give a bit more info about how this is used: I can't control the data coming in; it's from a

Re: Code performance question #2

2006-08-07 Thread David Kerber
See my response to Peter; I can't control the format of that data string (it's from a different application). I just need to split out the data fields and store them away in a disk file. Or am I missing the point of your suggestion? Dave Leon Rosenberg wrote: thats ugly, why don't you

RE: apache Tomcat webserver problem

2006-08-07 Thread Propes, Barry L
probably a firewall! -Original Message- From: Rahul Sood [mailto:[EMAIL PROTECTED] Sent: Saturday, August 05, 2006 9:03 AM To: users@tomcat.apache.org Subject: apache Tomcat webserver problem Hello. pI have set up tomcat's service catalina to have the default host 192.168.15.100 and

Re: How to identify busy Tomcat threads

2006-08-07 Thread Ramdas . Hegde
Since this is an application in production, i cannot add in any instrumentation to enable JConsole or JMX information. What i have currently to work with is the Tomcat status at page http://server:8009/status/status and that has information like : jk-8009 Max threads: 400 Min spare threads: 375

Mod_jk load balacing algorithm

2006-08-07 Thread Sharma, Siddharth
Is it possible to change mod_jk's load-balacing algorithm to random (from round robin)? If yes, how? TIA Sidd - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Code performance question #2

2006-08-07 Thread Peter Crowther
From: David Kerber [mailto:[EMAIL PROTECTED] Is there a more efficient split method I could use? Or am I completely missing the point of what you are suggesting? I think you've slightly missed the point. I assume you're calling your function 5 times, each with a different field name that

Re: Apache, mod_jk and Tomcat looses sessions

2006-08-07 Thread Pid
are you rewriting the URLs in each of the pages to maintain the session? each URL should get modified as a result: /path/to/file.jsp;jsessiond=00?q=param what's your jk config? (unless i've missed something, and given that most people seem to get this to work OK, it's probably a problem

Re: Code performance question #2

2006-08-07 Thread Pid
here's another obvious question: if you're in a servlet, and you're getting an separated string from somewhere, where is the somewhere that you're getting it from? does the servlet activate and collection the data somehow, or does the data get sent to the servlet (in, for example the query

Re: How to identify busy Tomcat threads

2006-08-07 Thread Edmon Begoli
Ramdas, JConsole or any JMX tool would just give you a slightly more information. I am not sure how much more helpful it would be. With JConsole you would be able to look at the memory usage, heap stats, connector information, database pool sizes, etc. and with that information you would

Re: Mod_jk load balacing algorithm

2006-08-07 Thread Rainer Jung
mod_jk neither supports round-robin, nor random load-balancing. Currently you can choose between three algorithms: method=B (busyness): choose the worker with the lowwest number of requests currently in processing. method=R (requests): choose the worker that did the lowest number of

Re: Code performance question #2

2006-08-07 Thread David Kerber
Peter Crowther wrote: From: David Kerber [mailto:[EMAIL PROTECTED] Is there a more efficient split method I could use? Or am I completely missing the point of what you are suggesting? I think you've slightly missed the point. I assume you're calling your function 5 times, each with a

Re: Code performance question #2

2006-08-07 Thread David Kerber
Pid wrote: here's another obvious question: if you're in a servlet, and you're getting an separated string from somewhere, where is the somewhere that you're getting it from? does the servlet activate and collection the data somehow, or does the data get sent to the servlet (in, for example

RE: Mod_jk load balacing algorithm

2006-08-07 Thread Sharma, Siddharth
Oh ok. I am not sure how I got the round-robin thing in my head. Anyhow, how does one configure this? I assume this is load balancer worker type configuration. -Original Message- From: Rainer Jung [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 1:15 PM To: Tomcat Users List

Re: Mod_jk load balacing algorithm

2006-08-07 Thread Mohan Wickramasinghe
Hello We are using the new Busyness method with 1.2.18 We have also using 'sticky sessions'. Clarification on As soon as there will be real load, behaviour will differ. We have 9 nodes on 3 identitical servers with identical settings, lb factor equal on all nodes, but we see one node which had

chat software

2006-08-07 Thread Dave
I am using JBoss and JSF. Can anyone recommend a chat software that enables instant conversation between two users? It is better to be open source, support audio and file transfer. Thanks! - Yahoo! Music Unlimited - Access over 1 million

Load balancing question

2006-08-07 Thread Sharma, Siddharth
We have a 12 (tomcat 5.5.16) instance cluster on 4 physical machines running redhat linux. There is an Apache installed on each machine (4 mod_jks). Each mod_jk's worker.properties is configured exactly the same way i.e. each mod-jk load-balances across all 12 tomcat instances. All instances have

HTTPS and Keys

2006-08-07 Thread William Chu
Hello, When configuring tomcat for HTTPS, how does tomcat know which key to use? If you run the keytool command multiple times, you generate multiple keys. The keys are stored in the .keystore file and so if I generate multiple keys, which one gets picked? Thanks, Will

Re: How is a cipher chosen when the ciphers attribute in server.xml is not specified?

2006-08-07 Thread Jack Ashburn
Cheers, Mark. On 8/7/06, Mark Thomas [EMAIL PROTECTED] wrote: Jack Ashburn wrote: Hi, I'm configuring my Tomcat server so that it uses a strong cipher for SSL. From the docs in both Tomcat 4.1 and 5.0, the ciphers attribute for the connector element in server.xml accepts A comma seperated

Re: Problem compiling mod_jk 1.2.18 with Apache 1.3.27

2006-08-07 Thread fredk2
Hi Rainer, Wonderful, many many thanks - your patch worked beautifully. I have no more errors with 1.3.27 on Solaris 8 nor Linux. (my apologies for the delay - I wasted time experimenting with the patch command on Solaris and Linux :-( I am opening another email thread about some strange

RE: Re: How to call beforeSessionDestroyed of SessionListener

2006-08-07 Thread Umesh Kudtarkar
Hi Moises, Actually I am not trying to call it. I am hoping as per servlet 2.4 spec there is some mechanism of getting HttpSession before it is destroyed. My sessionListener class checks for some session attribute and updates some bits in database. In case of session timeout by the time

JK 1.2.18 win32 dll not working

2006-08-07 Thread Julie Szmyd
Hi, I tried to upgrade an older version of the win32 JK isapi_redirect.dll to the jk-1.2.18 version that I downloaded from http://mirrors.ibiblio.org/pub/mirrors/apache/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.18. For some reason, IIS is not able to load the ISAPI filter. It errors

Re: Upgrade problem (useBean)

2006-08-07 Thread Mark Thomas
Lars Nielsen Lind wrote: All my webapps and contents (including WEB-INF and components) are copied from an existing running solution with no problems. Anyone that know how to solve this? Is there a more complete stack trace and/or exception in the logs? Mark

Re: Problem with java.library.path

2006-08-07 Thread Mark Thomas
Minh Tu Thanh Tran wrote: Thanks David, Again, I want to start the prolog engine, so I need to load the library of prolog when I start Tomcat 5.5.17. I think the command line is: java -Djava.library.path=$PLLIBDIR $1 But I do not know where to put this command line in Tomcat in order to

Re: Some initial config help needed (limiting manager/admin pages to specific IPs)

2006-08-07 Thread Mark Thomas
FH wrote: This past week is my first experience/time working w/ tomcat so please bear w/ me. I think I have most of it figured out, the server seems to be running ok and I've successfully limited the connections to it to ssl only by a couple of hacks to the server.xml config file[1] The one

Re: Load balancing question

2006-08-07 Thread Rainer Jung
Hi, first of all I assume you are using version 1.2.18 of mod_jk? Otherwise please update. Sharma, Siddharth schrieb: We have a 12 (tomcat 5.5.16) instance cluster on 4 physical machines running redhat linux. There is an Apache installed on each machine (4 mod_jks). Each mod_jk's

how to log a class in shared/lib

2006-08-07 Thread Jason Novotny
Hi, I have a lightweight singleton that I need to place in shared/lib so that it may be accessed by a few other webapps. My question is what logging jar will make my life the easiest to use in my singleton? My assumption is that each webapp should be able to configure which classes it

Re: Mod_jk load balacing algorithm

2006-08-07 Thread Rainer Jung
Hi, Mohan Wickramasinghe schrieb: Hello We are using the new Busyness method with 1.2.18 We have also using 'sticky sessions'. Clarification on As soon as there will be real load, behaviour will differ. We have 9 nodes on 3 identitical servers with identical settings, lb factor

Re: Code performance question #2

2006-08-07 Thread Mark Thomas
David Kerber wrote: I haven't run a profiler on this code; I've tried, but getting the configuration figured out has stumped me every time. I have had good results with YourKit. Simple to set up and a nice output that shows where the time is spent. I have used to to investigate reported

Re: HTTPS and Keys

2006-08-07 Thread Mark Thomas
William Chu wrote: Hello, When configuring tomcat for HTTPS, how does tomcat know which key to use? If you run the keytool command multiple times, you generate multiple keys. The keys are stored in the .keystore file and so if I generate multiple keys, which one gets picked? By default,

Re: Writing files accessible from a browser

2006-08-07 Thread Li
you are right Moises, if you really wanna write to somewhere within the webapp deploy folder, a better is to make a soft symbol link point to the directory that stores the image, catalina_home/webapps --- your_web image_dir --- /tmp/images/ so next time

Re: Mod_jk load balacing algorithm

2006-08-07 Thread Mohan2005
Hello Thaks. We will enable loggin to find this, but since its a production setup will it affect performance ? This is a set of stats. Apache was running for 3 weeks. (Hope this is clear) mod_jk 1.2.18 with Busyness and sticky sessions (all nodes are identicical). Name Type jvmRoute

Re: Writing files accessible from a browser

2006-08-07 Thread Romain Quilici
Hi all, thanks a lot for all solutions proposed. I think I am going create the directory within my webapp, but without symbolic link, as my images are temporary files. So even if the directory is deleted it really does not matter Thanks again Romain Li wrote: you are right Moises, if you