Want to run servlets from other directory than webapps
Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Want to run servlets from other directory than webapps
Yoo, Do you use tomcat stand-alone? Or with Apache Putting a context in server.xml should work, but this is not the prevered way in tomcat 5! Greetings O. On 5/11/05, Raueber Hotzenplotz [EMAIL PROTECTED] wrote: Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.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: Want to run servlets from other directory than webapps
Hi Rudi, Here's how I do it, and this also seems to be the 'correct' way of doing it with Tomcat5 (as it doesn't mean messing with any container-level files). Into {tomcathome}\conf\Catalina\localhost\ I place a correctly formed context file, for example ApplicationName.xml (very minimal for demonstration purposes... you could, of course, make it do whatever a normal context file would). ApplicationName.xml - ?xml version=1.0 encoding=UTF-8? Context path=/ApplicationName docBase=C:/share/ApplicationCode/ debug=1 reloadable=true /Context --- End ApplicationName.xml The C:/share/ApplicationCode/ directory would contain the JSPs, the META-INF dir, the WEB-INF dir, etc. Restart your tomcat Server and away you go. You can even use the admin utility to tweak it. Cheers, PST On 5/11/05, Raueber Hotzenplotz [EMAIL PROTECTED] wrote: Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.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: Want to run servlets from other directory than webapps
I'm running Tomcat as standalone server at the moment - that could change later on. What's the preferred way in Tomcat 5? Thanks! --- Oto Bossert [EMAIL PROTECTED] wrote: Yoo, Do you use tomcat stand-alone? Or with Apache Putting a context in server.xml should work, but this is not the prevered way in tomcat 5! Greetings O. On 5/11/05, Raueber Hotzenplotz [EMAIL PROTECTED] wrote: Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.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] ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Want to run servlets from other directory than webapps
Thanks PST! Will try it out tomorrow. Rudi --- Patrick Thomas [EMAIL PROTECTED] wrote: Hi Rudi, Here's how I do it, and this also seems to be the 'correct' way of doing it with Tomcat5 (as it doesn't mean messing with any container-level files). Into {tomcathome}\conf\Catalina\localhost\ I place a correctly formed context file, for example ApplicationName.xml (very minimal for demonstration purposes... you could, of course, make it do whatever a normal context file would). ApplicationName.xml - ?xml version=1.0 encoding=UTF-8? Context path=/ApplicationName docBase=C:/share/ApplicationCode/ debug=1 reloadable=true /Context --- End ApplicationName.xml The C:/share/ApplicationCode/ directory would contain the JSPs, the META-INF dir, the WEB-INF dir, etc. Restart your tomcat Server and away you go. You can even use the admin utility to tweak it. Cheers, PST On 5/11/05, Raueber Hotzenplotz [EMAIL PROTECTED] wrote: Hi I've got Tomcat-5.0.27-r5 installed. Running servlets (localhost) located in /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no problem. What do I need to do to run servlets from my user directory (e.g. /home/user/myapp)? I've tried to use http://localhost:8080/admin to add an additional context, setting path and docbase to /home/user/myapp, but this doesn't work. I've also tried to change appbase to /home/user/myapp in conf/server.xml, but again no success. I've uncommented the 'invoker' lines in conf/web.xml - for the moment anyway: servlet servlet-nameinvoker/servlet-name servlet-class org.apache.catalina.servlets.InvokerServlet /servlet-class init-param param-namedebug/param-name param-value0/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping How do you configure Tomcat? Do you use the admin tool or do you do it manually? The admin tool works strange e.g. after deleting some context it was still in the list. Thanks! Regards, Rudi ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.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] ___ Does your mail provider give you FREE antivirus protection? Get Yahoo! Mail http://uk.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
refering files in other directory from one webapps
Hi, I have set a webapp like below: Context path=/music docBase=C:/My Music debug=0/ I have mp3 files in C:/My Music and I can reach the mp3 files like this: http://ip:8080/music/test.mp3 and browser will play the song (with Win Media Player) is it posible that I use same webapps http://ip:8080/music/ and play mp3 files in other directory? I have written a JSP that stream the mp3 files as below and it works, but is it possible that Tomcat can refer to the mp3 files in other directory directly? or any other ways? % String filename = C:\\my.mp3; File file = new File(filename); ReadableByteChannel rbc = Channels.newChannel(new FileInputStream(file)); WritableByteChannel wbc = Channels.newChannel(response.getOutputStream()); response.setContentType(audio/mpeg); response.setContentLength((int)file.length()); response.setHeader(Content-Disposition, attachment; filename=+filename.substring(filename.lastIndexOf(File.separator)+1)+;); ByteBuffer bb = ByteBuffer.allocateDirect(1024); while (rbc.read(bb) != -1) { bb.flip(); wbc.write(bb); bb.clear(); } wbc.close(); rbc.close(); % - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: refering files in other directory from one webapps
Howdy, but is it possible that Tomcat can refer to the mp3 files in other directory directly? or any other ways? snip % String filename = C:\\my.mp3; File file = new File(filename); snip What happens if you do String filename = c:\\someOtherDirectory\blah.mp3; ... ? Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: refering files in other directory from one webapps
No prob, can still get the file - Original Message - From: Shapira, Yoav [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 8:59 PM Subject: RE: refering files in other directory from one webapps Howdy, but is it possible that Tomcat can refer to the mp3 files in other directory directly? or any other ways? snip % String filename = C:\\my.mp3; File file = new File(filename); snip What happens if you do String filename = c:\\someOtherDirectory\blah.mp3; ... ? Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. 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: in other directory
i dont see howe to start tomcat form another directory., can you help me more? can you say me where is it? thansk Carlos - Original Message - From: "Grobe, Gary" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 22, 2001 10:35 PM Subject: RE: in other directory In the docs dir, read the tomcat-apache-howto.html, where you'll find a link to Tomcat User's Guide, then where it says "Starting Tomcat from Another Directory". It does a better job explaining than anything. -Original Message- From: Landaluze Produktions IS - Carlos [mailto:[EMAIL PROTECTED]] Sent: Monday, January 22, 2001 3:16 PM To: [EMAIL PROTECTED] Subject: in other directory how can i say to tomcat that the webs home directory doesn't the /opt/tomcat/webapps/ROOT and is the /usr/local/httpd/htdocs directory? thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
in other directory
how can i say to tomcat that the webs home directory doesn't the /opt/tomcat/webapps/ROOT and is the /usr/local/httpd/htdocs directory? thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: in other directory
In the docs dir, read the tomcat-apache-howto.html, where you'll find a link to Tomcat User's Guide, then where it says "Starting Tomcat from Another Directory". It does a better job explaining than anything. -Original Message- From: Landaluze Produktions IS - Carlos [mailto:[EMAIL PROTECTED]] Sent: Monday, January 22, 2001 3:16 PM To: [EMAIL PROTECTED] Subject: in other directory how can i say to tomcat that the webs home directory doesn't the /opt/tomcat/webapps/ROOT and is the /usr/local/httpd/htdocs directory? thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
How to find classes in an other directory than WEB-INF/classes ?
Bonjour, When many webapps use the same pakages, like utility classes, it would be interressant to share them to have only one copy of the class files. With Tomcat 3.1, if you add a list of paths in the shell variable "appClassPath", tomcat can find classes outside the directory WEB-INF/classes . eg. set appClassPath=%myPaths%;%appJars%;%sysJars% With tomcat 4.0, I try to give itomcat my list of paths which are already in the the shell variable "CLASSPATH" , but it does'nt work. My "little" modify in catalina.bat : set CP=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar set CLASSPATH=%CP%;%CLASSPATH% echo --Using CLASSPATH: %CLASSPATH% I read standardClassLoader.java and I understand (?) that the class loader try to find the classes in a list of "repositories". How to add "repository" in the standardClassLoader to allow it to find classes in an other directory than WEB-INF/classes ? Is it possible to specify paths in the node "loader" ? I have not found the documentation of the node "loader" of the configuration file "server.xml". Someone try to write it ? Thanks. Olivier Gattaz. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
How to add repository to allow the standardClassLoader to find classes in an other directory than WEB-INF/classes ?
Bonjour, When many webapps use the same pakages, like utility classes, it would be interressant to share them to have only one copy of the class files. With Tomcat 3.1, you can add a list of path in the shell variable "appClassPath" to allow tomcat to find the utility classes. eg. set appClassPath=%myPaths%;%appJars%;%sysJars% With tomcat 4.0, I try to kepp my paths which are already in the the shell variable "CLASSPATH" with this little modification , but it does'nt work. set CP=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar set CLASSPATH=%CP%;%CLASSPATH% echo --Using CLASSPATH: %CLASSPATH% How to add "repository" in the standardClassLoader to allow it to find classes in an other directory than WEB-INF/classes ? I have not found the documentation of the node "loader" of the configuration file "server.xml". Someone try to write it ? Thanks. Olivier Gattaz. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
How to add repository to allow the standardClassLoader to find classes in an other directory than WEB-INF/classes ?
Bonjour, When many webapps use the same pakages, like utility classes, it would be interressant to share them to have only one copy of the class files. With Tomcat 3.1, you can add a list of path in the shell variable "appClassPath" to allow tomcat to find the utility classes. eg. set appClassPath=%myPaths%;%appJars%;%sysJars% With tomcat 4.0, I try to kepp my paths which are already in the the shell variable "CLASSPATH" with this little modification , but it does'nt work. set CP=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar set CLASSPATH=%CP%;%CLASSPATH% echo --Using CLASSPATH: %CLASSPATH% How to add "repository" in the standardClassLoader to allow it to find classes in an other directory than WEB-INF/classes ? I have not found the documentation of the node "loader" of the configuration file "server.xml". Someone try to write it ? Thanks. Olivier Gattaz. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]