Re: Getting the date/time from the client
One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting the date/time from the client
Hi, May be you can use: request.getDateHeader() Have a look at, there is a related thread there: http://www.theserverside.com/discussions/thread.tss?thread_id=38542 Vinu Varghese [EMAIL PROTECTED] wrote: Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org ~Regards, ~~Alireza Fattahi - Try the all-new Yahoo! Mail . The New Version is radically easier to use The Wall Street Journal
Re: Getting the date/time from the client
Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting the date/time from the client
SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org
Re: Getting the date/time from the client
uh... no luck yet. getDateHeader only returns the date value when you have some query strings in date format. So, send the time as a part of query string like this index.jsp?requesttime=25:40:12 or something similar. If one has a better solution let him know. SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 2:23 AM Subject: Re: Getting the date/time from the client SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting the date/time from the client
The HTTP spec (rfc2616) says clients should only send the Date header with http messages with body content (POST, PUT) and even then it's optional. Try adding a date string as a parameter on your GET request which your servlet can then parse from request.getParameter(...). One way to do this would be to change your link to a form with a hidden input field for your date value. Add an onclick/onsubmit javascript handler to your form button which sets the value of the hidden field to the current date in a format that your servlet will understand. for example: function setDate(form) { form.dateField.value = new Date().toString(); } Example assumes a hidden form input field with name dateField. HTH, Jon Vinu Varghese wrote: SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
forwarding to a remote host
Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar.
Tomcat shutdowns unexpectedly - Please help
Hi, Please help me in guiding to find out the root cause of this problem. Tomcat Version: jakarta-tomcat-4.1.31 Server OS: SUN OS 5.8 JDK version: j2sdk1.4.2_11 Initially the tomcat server is running perfectly and there is no problem. There is no operation done on the server. Simply it is kept idle. After some 3 or 4 hours the tomcat gets shutdown unexpectedly. This happens repeatedly. Whenever I start the server, after some 3 or 4 hours it gets stopped. There is not enough log to find the cause. I have posted this query in lot of forum and still it is a hard luck. I configured debug=5 in server.xml under conf directory to get maximum log, then also no use. There is no application running in the tomcat server. Simply the when tomcat is started in this SUN server after a few ours it stops always. Please help me. Please let me know if I need to give more information. Thanks in advance, Thanks and Regards, Arunan
Re: Tomcat shutdowns unexpectedly - Please help
I'm no expert, but off the top of my head it appears your JVM is crashing. Especially true if there is absolutely no logging data just before the process stops. You may have indications of what's happening in other log files like syslog or a core dump file. You may also want to look at bug reports for your OS and JDK. --David Arunan Kannan wrote: Hi, Please help me in guiding to find out the root cause of this problem. Tomcat Version: jakarta-tomcat-4.1.31 Server OS: SUN OS 5.8 JDK version: j2sdk1.4.2_11 Initially the tomcat server is running perfectly and there is no problem. There is no operation done on the server. Simply it is kept idle. After some 3 or 4 hours the tomcat gets shutdown unexpectedly. This happens repeatedly. Whenever I start the server, after some 3 or 4 hours it gets stopped. There is not enough log to find the cause. I have posted this query in lot of forum and still it is a hard luck. I configured debug=5 in server.xml under conf directory to get maximum log, then also no use. There is no application running in the tomcat server. Simply the when tomcat is started in this SUN server after a few ours it stops always. Please help me. Please let me know if I need to give more information. Thanks in advance, Thanks and Regards, Arunan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting the date/time from the client
you can get a Locale from the request, and adjust the time accordingly. Vinu Varghese wrote: but that still sets the server date - yes ? Pid wrote: write a filter that activates for that url, and get the time just before you doFilter. if you need to, you can pass the date obj as an attribute Date date = new Date(); hreq.setAttribute(thisIsTheDate, date); chain.doFilter(hreq, hres); Jon Wingfield wrote: The HTTP spec (rfc2616) says clients should only send the Date header with http messages with body content (POST, PUT) and even then it's optional. Try adding a date string as a parameter on your GET request which your servlet can then parse from request.getParameter(...). One way to do this would be to change your link to a form with a hidden input field for your date value. Add an onclick/onsubmit javascript handler to your form button which sets the value of the hidden field to the current date in a format that your servlet will understand. for example: function setDate(form) { form.dateField.value = new Date().toString(); } Example assumes a hidden form input field with name dateField. HTH, Jon Vinu Varghese wrote: SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org
Re: forwarding to a remote host
not unless you've got clustering setup and the cluster is correctly sharing session data. the session data is otherwise local to the server in use. Vinu Varghese wrote: Avi, What will happen with the session and objects bound to it ?, Will they be accessible in the second server ? - Regards Vinu Avi Deitcher wrote: Zohar, - In the same host context, use RequestDispatcher.forward() - In the same host but different context, if cross-context enabled, get the RequestDispatcher for that context then use forward() - Different host entirely, or cross-context not enabled, you will probably need to rebuild the request. I usually use the Jakarta Commons HTTPClient for this. Check out http://jakarta.apache.org/commons/httpclient/ Anyone have a better suggestion? Avi Zohar wrote: Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: forwarding to a remote host
Hi Zohar Check this http://marc.theaimsgroup.com/?l=tomcat-userm=108568149602563w=2 http://marc.theaimsgroup.com/?l=tomcat-userm=108568149602563w=2 Hope this helps - Regards Vinu Zohar wrote: Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar. -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org
Re: Getting the date/time from the client
Thanks Pid, I think that is a good idea Let me try - Regards Vinu Pid wrote: you can get a Locale from the request, and adjust the time accordingly. Vinu Varghese wrote: but that still sets the server date - yes ? Pid wrote: write a filter that activates for that url, and get the time just before you doFilter. if you need to, you can pass the date obj as an attribute Date date = new Date(); hreq.setAttribute(thisIsTheDate, date); chain.doFilter(hreq, hres); Jon Wingfield wrote: The HTTP spec (rfc2616) says clients should only send the Date header with http messages with body content (POST, PUT) and even then it's optional. Try adding a date string as a parameter on your GET request which your servlet can then parse from request.getParameter(...). One way to do this would be to change your link to a form with a hidden input field for your date value. Add an onclick/onsubmit javascript handler to your form button which sets the value of the hidden field to the current date in a format that your servlet will understand. for example: function setDate(form) { form.dateField.value = new Date().toString(); } Example assumes a hidden form input field with name dateField. HTH, Jon Vinu Varghese wrote: SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the machine the browser is running). Is there any way to accomplish this ? Thanks regards Vinu -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Vinu Varghese [EMAIL PROTECTED] www.x-minds.org
Re: url changes
Change the servlet mapping in Blojsom from blog/* to *. Then change the name of the Blojsom webapp to blogs. The end result is the desired URL such as http://www.company.com/blogs/employee.name. Consult the Blojsom docs before making these changes to insure they work as expected and Blojsom is properly configured. --David Graham Reeds wrote: I am setting up a website. Part of the site is employee blogs. As well as the blogs there will be forums, products, etc. making: http://www.company.com/blogs/employee.name http://www.company.com/forums/ http://www.company.com/products/product.name For the blogging software I chose Blojsom. Normally it installs into a blojsom folder in webapps. However its url is: http://www.company.com/blojsom/blogs/employee.name I would like to remove the blojsom folder. One way would be to install it to the root webapp folder. This however, is undesirable as it makes setting up the rest of the site difficult. I feel that there should be a way of configuring the web.xml in the WEB-INF file to give me the results I want. Also we don't have access to the server as they are using 3rd party hosting. If you need the web.xml (or any other file) posted then please ask. Thanks, Graham. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: forwarding to a remote host
What's the easiest way to transfer all the data from the Request to the PostMethod? - Original Message - From: Avi Deitcher [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 14:38 Subject: Re: forwarding to a remote host Zohar, - In the same host context, use RequestDispatcher.forward() - In the same host but different context, if cross-context enabled, get the RequestDispatcher for that context then use forward() - Different host entirely, or cross-context not enabled, you will probably need to rebuild the request. I usually use the Jakarta Commons HTTPClient for this. Check out http://jakarta.apache.org/commons/httpclient/ Anyone have a better suggestion? Avi Zohar wrote: Hello list, I have a servlet that handles POST requests. Sometimes the request needs to be forwarded to a different servlet, which may be running on a different server. What is the best way to do that? Thanks, Zohar. -- __ Avi Deitcher [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat memory allocation
We have a /3GB switch (and the /PAE switch active), but the allocation limit is still 1500m. We were using j2sdk-1_4_2_03 and tomcat-5.0.19. I have now tried the combination jdk-1_5_0_06 and tomcat-5.5..17.exe with the same poor result. So something seems to be wrong but what is it? Rg. Elly -Oorspronkelijk bericht- Van: Mark Thomas [mailto:[EMAIL PROTECTED] Verzonden: donderdag 6 juli 2006 3:25 Aan: Tomcat Users List Onderwerp: Re: tomcat memory allocation Speulman, Elly wrote: Hi, Is there anyone out there who has been able to configure more than 1550M for Tomcat 5.0 on a Windows advanced server installation. The server has a total of 4Gb of memory. We are just not able to cross a border. Config of Tomcat memory takes place via the Tomcat configuration buttons. Perhaps someone even has a solution? This is a windows limitation. Do a Google for /3GB and /PAE boot.ini switches. The maximum memory varies by version (2003 is 32GB, 2003 SP1 is 64GB) and I can't remember them all but the short (actually quite long) answer is: The default windows installation has a maximum of 4GB RAM. Of this, the kernel is allocated 2GB and user processes the rest with a maximum per process of 2GB (although in practice is is usually around 1.6GB). The /PAE switch should make all the physical memory in your machine visible to windows up to the maximum supported by your OS and SP versions. However, 2GB is still allocated to the kernel and user process are still limited to 2GB (really 1.6GB) each. The /3GB switch reduces the kernel allocation to 1GB and makes 3GB (really about 2.6GB) available per user process but total memory is still limited to 4GB. Using both /PAE and /3GB together gets 'interesting'. kernel memory is reduced to 1GB, user processes limited to 3GB per process and total memory is the smallest of physical memory, OS/SP maximum and 16GB. Note the 16GB upper limit. This caught me out recently on a 48GB windows box. On your box, I would use the /3GB switch but be aware of the 16GB upper limit for total system memory in this case. HTH, Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Dit bericht is uitsluitend bestemd voor de hierboven genoemde geadresseerde(n) en kan vertrouwelijke informatie bevatten. Indien het mailbericht verkeerd is geadresseerd verzoeken wij u dringend ons dit te laten weten (telefonisch of per mail). Verspreiding en/of openbaarmaking van dit mailbericht aan derden is strikt verboden. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat memory allocation
I think you need 64bit jvm. With 32bit vm 1.5 is pretty much the limit. With 64 bit sky is your limit :-) regards Leon On 7/11/06, Speulman, Elly [EMAIL PROTECTED] wrote: We have a /3GB switch (and the /PAE switch active), but the allocation limit is still 1500m. We were using j2sdk-1_4_2_03 and tomcat-5.0.19. I have now tried the combination jdk-1_5_0_06 and tomcat-5.5..17.exe with the same poor result. So something seems to be wrong but what is it? Rg. Elly -Oorspronkelijk bericht- Van: Mark Thomas [mailto:[EMAIL PROTECTED] Verzonden: donderdag 6 juli 2006 3:25 Aan: Tomcat Users List Onderwerp: Re: tomcat memory allocation Speulman, Elly wrote: Hi, Is there anyone out there who has been able to configure more than 1550M for Tomcat 5.0 on a Windows advanced server installation. The server has a total of 4Gb of memory. We are just not able to cross a border. Config of Tomcat memory takes place via the Tomcat configuration buttons. Perhaps someone even has a solution? This is a windows limitation. Do a Google for /3GB and /PAE boot.ini switches. The maximum memory varies by version (2003 is 32GB, 2003 SP1 is 64GB) and I can't remember them all but the short (actually quite long) answer is: The default windows installation has a maximum of 4GB RAM. Of this, the kernel is allocated 2GB and user processes the rest with a maximum per process of 2GB (although in practice is is usually around 1.6GB). The /PAE switch should make all the physical memory in your machine visible to windows up to the maximum supported by your OS and SP versions. However, 2GB is still allocated to the kernel and user process are still limited to 2GB (really 1.6GB) each. The /3GB switch reduces the kernel allocation to 1GB and makes 3GB (really about 2.6GB) available per user process but total memory is still limited to 4GB. Using both /PAE and /3GB together gets 'interesting'. kernel memory is reduced to 1GB, user processes limited to 3GB per process and total memory is the smallest of physical memory, OS/SP maximum and 16GB. Note the 16GB upper limit. This caught me out recently on a 48GB windows box. On your box, I would use the /3GB switch but be aware of the 16GB upper limit for total system memory in this case. HTH, Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Dit bericht is uitsluitend bestemd voor de hierboven genoemde geadresseerde(n) en kan vertrouwelijke informatie bevatten. Indien het mailbericht verkeerd is geadresseerd verzoeken wij u dringend ons dit te laten weten (telefonisch of per mail). Verspreiding en/of openbaarmaking van dit mailbericht aan derden is strikt verboden. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat shutdowns unexpectedly - Please help
If the app is crashing then you would see exceptions thrown in wither catalina.out / stdout_MMDD.log / stderr_MMDD.log If the service is crashing on startup(misconfigured JVM, startup jars missing) then check the jakarta_service_MMDD.log HTH, Martin-- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: David Smith [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 7:51 AM Subject: Re: Tomcat shutdowns unexpectedly - Please help I'm no expert, but off the top of my head it appears your JVM is crashing. Especially true if there is absolutely no logging data just before the process stops. You may have indications of what's happening in other log files like syslog or a core dump file. You may also want to look at bug reports for your OS and JDK. --David Arunan Kannan wrote: Hi, Please help me in guiding to find out the root cause of this problem. Tomcat Version: jakarta-tomcat-4.1.31 Server OS: SUN OS 5.8 JDK version: j2sdk1.4.2_11 Initially the tomcat server is running perfectly and there is no problem. There is no operation done on the server. Simply it is kept idle. After some 3 or 4 hours the tomcat gets shutdown unexpectedly. This happens repeatedly. Whenever I start the server, after some 3 or 4 hours it gets stopped. There is not enough log to find the cause. I have posted this query in lot of forum and still it is a hard luck. I configured debug=5 in server.xml under conf directory to get maximum log, then also no use. There is no application running in the tomcat server. Simply the when tomcat is started in this SUN server after a few ours it stops always. Please help me. Please let me know if I need to give more information. Thanks in advance, Thanks and Regards, Arunan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat shutdowns unexpectedly - Please help
Hi, I hope I get it correctly, the Tomcat shutdowns when it is ideal. That means no one is working with it and there is no connection to it. If I assume correct and this is the case, please let me know if this shutdown happens when there are some connections to it. We had this problem once with Apache and OracleAS, the OracleAS shouted down itself when it does not received any requests (made a suicide!) We end up writing a small program which was connected to Tomcat every 10 min and requested a dummy page. It solved it. P.S: Did you configure your Tomcat with Apache? Hope it helps you! Martin Gainty [EMAIL PROTECTED] wrote: If the app is crashing then you would see exceptions thrown in wither catalina.out / stdout_MMDD.log / stderr_MMDD.log If the service is crashing on startup(misconfigured JVM, startup jars missing) then check the jakarta_service_MMDD.log HTH, Martin-- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: David Smith To: Tomcat Users List Sent: Tuesday, July 11, 2006 7:51 AM Subject: Re: Tomcat shutdowns unexpectedly - Please help I'm no expert, but off the top of my head it appears your JVM is crashing. Especially true if there is absolutely no logging data just before the process stops. You may have indications of what's happening in other log files like syslog or a core dump file. You may also want to look at bug reports for your OS and JDK. --David Arunan Kannan wrote: Hi, Please help me in guiding to find out the root cause of this problem. Tomcat Version: jakarta-tomcat-4.1.31 Server OS: SUN OS 5.8 JDK version: j2sdk1.4.2_11 Initially the tomcat server is running perfectly and there is no problem. There is no operation done on the server. Simply it is kept idle. After some 3 or 4 hours the tomcat gets shutdown unexpectedly. This happens repeatedly. Whenever I start the server, after some 3 or 4 hours it gets stopped. There is not enough log to find the cause. I have posted this query in lot of forum and still it is a hard luck. I configured debug=5 in server.xml under conf directory to get maximum log, then also no use. There is no application running in the tomcat server. Simply the when tomcat is started in this SUN server after a few ours it stops always. Please help me. Please let me know if I need to give more information. Thanks in advance, Thanks and Regards, Arunan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ~Regards, ~~Alireza Fattahi - Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail.
Question for mod_jk experts: Impact of exceeding maxThreads on mod_jk?
Hi, This is a question for mod_jk folks. We ran into a situation where maxThreads on one of the Tomcats in our mod_jk load balanced cluster were exceeded. The result of this situation was that mod_jk could not talk to any of the Tomcats. It appeared like the whole cluster is non-responsive. My question is: Is this a known mod_jk bug? If not Environment: -- RHEL 4.2 on all servers 4 X Apache 2.0.52 Web Servers with mod_jk 1.2.15 Sticky load balancing mod_jk: __ Sticky loadbalancing prepost_timeout, reply_timeout, connect_timeout set 1.5 min 6 X Tomcat 5.5.15 Tomcats are on the physically separate machines from the Apache Web servers Tomcat maxThreads setting is 300 -- Thank you, Edmon Begoli http://blogs.ittoolbox.com/eai/software - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
File isn't found in ROOT directory
I have placed an index.jsp file that I created in my servers webapps/ROOT folder. When I place the following address in my browser: http://localhost/index.jsp I still come up with the tomcat homepage on my local host. I know that file is located in the ROOT/admin folder is there some way that my browser is overridding my request for my index.jsp file for the tomcat homepage index.jsp instead? I've tried opening other jsp's that I migrated to this folder and I get a 404 not found message when I do this. Brian
Re: Tomcat shutdowns unexpectedly - Please help
Hi David, Martin, and Alireza, Thank you very much for your comments and suggestions. Thanks a lot. Hi David, There is no logs corresponding to this shutdown anywhere on the system. I couldn't find any thing relevent to this crash on syslog or at any other place. Thanks for your help. Hi Martin, Here is the log from catalina.out file. Please have a look at it. Jul 10, 2006 11:57:18 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.31 Jul 10, 2006 11:57:21 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Jul 10, 2006 11:57:21 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jul 10, 2006 11:57:21 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=2/53 config=/temp/jakarta-tomcat-4.1.31 /conf/jk2.pro perties Stopping service Tomcat-Standalone and here are the logs from localhost_admin_log.2006-07-10.txt 2006-07-11 05:01:40 StandardContext[/admin]: Servlet /admin threw load() excepti on javax.servlet.ServletException: Wrapper cannot find servlet class org.apache.web app.admin.ApplicationServlet or a class it depends on at org.apache.catalina.core.StandardWrapper.loadServlet (StandardWrapper. java:844) 6) at org.apache.catalina.core.StandardWrapper.load( StandardWrapper.java:77 t.ja 3363)rg.apache.catalina.core.StandardContext.loadOnStartup(StandardContex 586)at org.apache.catalina.core.StandardContext.start( StandardContext.java:3 .java:774) org.apache.catalina.core.ContainerBase.addChildInternal (ContainerBase 0) at org.apache.catalina.core.ContainerBase.addChild( ContainerBase.java:76 --at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156) 2006-07-11 05:01:40 StandardWrapper[/admin:invoker]: Loading container servlet i nvoker I couldn't understand much. Can you please let me know some more info about this. As you said, I tried to find some timeout parameters in the conf files. !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 9080 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=9080 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=9443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true / !-- Note : To disable connection timeouts, set connectionTimeout value to -1 -- In the server.xml the ConnectionTimeout is set to 2. I will change that to 0 and let you know the results. Thanks for your help. Hi Alireza, The tomcat I am using is not configured with apache. Initially I run some sample application and left it ideal for some 3 to 4 hr. There is no action done in this time. Then the tomcat gets shutdown unexpectedly. I will try your suggestion and let you know the result. Thanks for your help. Thanks again for all, Thanks and Regards, Arunan On 7/11/06, Martin Gainty [EMAIL PROTECTED] wrote: I would also look at workers.properties files and make sure socket_KeepAlive is set on Also socket_timeout is set to 0 so it never times out M- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Mr Alireza Fattahi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org; Martin Gainty [EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 9:45 AM Subject: Re: Tomcat shutdowns unexpectedly - Please help Hi, I hope I get it correctly, the Tomcat shutdowns when it is ideal. That means no one is working with it and there is no connection to it. If I assume correct and this is the case, please let me know if this shutdown happens when there are some connections to it. We had this problem once with Apache and OracleAS, the OracleAS shouted down itself when it does not received any requests (made a suicide!) We end up writing a small program which was connected to Tomcat every 10 min and requested a dummy page. It solved it. P.S: Did you configure your Tomcat with Apache? Hope it helps you! Martin Gainty [EMAIL PROTECTED] wrote: If the app is crashing then you would see exceptions thrown in wither catalina.out / stdout_MMDD.log / stderr_MMDD.log If the service is crashing on startup(misconfigured JVM, startup jars missing) then check the jakarta_service_MMDD.log HTH, Martin-- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to
Re: File isn't found in ROOT directory
what version of tomcat? what have you got defined in the Host ...s in your server.xml? McRaven, Brian wrote: I have placed an index.jsp file that I created in my servers webapps/ROOT folder. When I place the following address in my browser: http://localhost/index.jsp I still come up with the tomcat homepage on my local host. I know that file is located in the ROOT/admin folder is there some way that my browser is overridding my request for my index.jsp file for the tomcat homepage index.jsp instead? I've tried opening other jsp's that I migrated to this folder and I get a 404 not found message when I do this. Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Common Access Card Authentication
Is it possible to configure Tomcat to authenticate users using the DoD Common Access Card? I found a module for the SunONE app server and a commercial product for Windows, but nothing for Tomcat. Thanks, Bill
RE: File isn't found in ROOT directory
I'm using Tomcat 5.5.17 and the server.xml file has this in it: Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Thanks, Brian -Original Message- From: Pid [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 10:56 AM To: Tomcat Users List Subject: Re: File isn't found in ROOT directory what version of tomcat? what have you got defined in the Host ...s in your server.xml? McRaven, Brian wrote: I have placed an index.jsp file that I created in my servers webapps/ROOT folder. When I place the following address in my browser: http://localhost/index.jsp I still come up with the tomcat homepage on my local host. I know that file is located in the ROOT/admin folder is there some way that my browser is overridding my request for my index.jsp file for the tomcat homepage index.jsp instead? I've tried opening other jsp's that I migrated to this folder and I get a 404 not found message when I do this. Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Running Tomcat Embedded
Thanks Bill, I've looked at that and we actually have it running that way. What I'm looking for is a way to duplicate org.apache.catalina.startup.Bootstrap class in my own startup. I believe that JBoss does something similar? What I really want to do is get my version of Tomcat that I startup to work like starting Tomcat manually. I want it to read the server.xml and context.xml files for web apps. Is this possible? Mike Wannamaker Senior Software Developer Hummingbird Ltd. 552 Princess St, Kingston, ON, K7L 1C7 Tel: (613) 548-4355 x4535 Fax (613) 548-7801 E-Mail: Mike Wannamaker www.hummingbird.com IMPORTANT NOTICE: This communication is privileged and contains confidential information for the sole use of the intended recipient(s). Any unauthorized disclosure, copying or use of this communication is strictly prohibited. If you have received this message in error, please contact the sender and delete this message without printing it or otherwise retaining a copy. -Original Message- From: Bill Barker [mailto:[EMAIL PROTECTED] Sent: July 10, 2006 11:44 PM To: users@tomcat.apache.org Subject: Re: Running Tomcat Embedded Mike Wannamaker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I wish to run Tomcat from within my own JVM. I would like it to run just like Tomcat does today, however I'd just like to setup the various paths, for like web app root directory, config directory, lib directory etc Is there anyway to do this easily? Like I said I just want to create an instance of Tomcat/Catalina and setProperties(...); and then call start(); Any help is appreciated. Most people use Embedded (http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catali na/startup/Embedded.html) since it at least has some documentation. Commons-modeler has a simple (if slightly out of date :) example of how to embed Tomcat using JMX. This is useful if you want Tomcat to run in a different ClassLoader than the rest of your application (and at least personally, I find it easier to use). In either case, you need to set the properties on the sub-components (e.g. Engine, Host, Contex(s)) yourself, so you are responsible for creating them. Mike Wannamaker Senior Software Developer Hummingbird Ltd. 552 Princess St, Kingston, ON, K7L 1C7 Tel: (613) 548-4355 x4535 Fax (613) 548-7801 E-Mail: Mike Wannamaker www.hummingbird.com IMPORTANT NOTICE: This communication is privileged and contains confidential information for the sole use of the intended recipient(s). Any unauthorized disclosure, copying or use of this communication is strictly prohibited. If you have received this message in error, please contact the sender and delete this message without printing it or otherwise retaining a copy. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Installing My Own DirContext
Does anyone have any input on this? What I want is through some config settings install my own DirContext.class so that when the web app is trying to get resources like pages, it'll use my DirContext to try to find them. This way I can have some common files located outside each web application and not have to have them installed within the web app itself. IE: My DirContext will provide aliasing so that I can do this Alias login=c:\tomcat\webres\login so that a request to something like http://myapp/mycontext/login/login.jsp will be given to my DirContext class and I'll look for c:\tomcat\webres\login\login.jsp and return it if found. Mike Wannamaker - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File isn't found in ROOT directory
Two issue here: 1. Place the index.jsp in webapps/ROOT instead of webapps/ROOT/admin 2. ROOT context that comes with tomcat has all it's jsp files pre-compiled. Your new index.jsp is being ignored in favor of the pre-compiled version. Remove the servlet mapping in webapps/ROOT/WEB-INF/web.xml, restart tomcat (or just the ROOT webapp if you have the manager webapp up and running), and all should be as expected. --David Pid wrote: what version of tomcat? what have you got defined in the Host ...s in your server.xml? McRaven, Brian wrote: I have placed an index.jsp file that I created in my servers webapps/ROOT folder. When I place the following address in my browser: http://localhost/index.jsp I still come up with the tomcat homepage on my local host. I know that file is located in the ROOT/admin folder is there some way that my browser is overridding my request for my index.jsp file for the tomcat homepage index.jsp instead? I've tried opening other jsp's that I migrated to this folder and I get a 404 not found message when I do this. Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: File isn't found in ROOT directory
I commented out the servlet-mapping but I still get the tomcat page for index.jsp. With my installation of Tomcat there already was a folder called admin with index.jsp in it. I'm not sure if I was making that clear in my last post. I thought that was where the tomcat index.jsp was coming from. I notice that if I put my index.jsp in a subfolder of the ROOT directory then I can access it. Brian -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:32 AM To: Tomcat Users List Subject: Re: File isn't found in ROOT directory Two issue here: 1. Place the index.jsp in webapps/ROOT instead of webapps/ROOT/admin 2. ROOT context that comes with tomcat has all it's jsp files pre-compiled. Your new index.jsp is being ignored in favor of the pre-compiled version. Remove the servlet mapping in webapps/ROOT/WEB-INF/web.xml, restart tomcat (or just the ROOT webapp if you have the manager webapp up and running), and all should be as expected. --David Pid wrote: what version of tomcat? what have you got defined in the Host ...s in your server.xml? McRaven, Brian wrote: I have placed an index.jsp file that I created in my servers webapps/ROOT folder. When I place the following address in my browser: http://localhost/index.jsp I still come up with the tomcat homepage on my local host. I know that file is located in the ROOT/admin folder is there some way that my browser is overridding my request for my index.jsp file for the tomcat homepage index.jsp instead? I've tried opening other jsp's that I migrated to this folder and I get a 404 not found message when I do this. Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File isn't found in ROOT directory
admin/index.jsp is a placeholder page for the admin webapp, not shipped with tomcat. If you placed it there, the url would be http://localhost:8080/admin/index.jsp. --David McRaven, Brian wrote: I commented out the servlet-mapping but I still get the tomcat page for index.jsp. With my installation of Tomcat there already was a folder called admin with index.jsp in it. I'm not sure if I was making that clear in my last post. I thought that was where the tomcat index.jsp was coming from. I notice that if I put my index.jsp in a subfolder of the ROOT directory then I can access it. Brian -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:32 AM To: Tomcat Users List Subject: Re: File isn't found in ROOT directory Two issue here: 1. Place the index.jsp in webapps/ROOT instead of webapps/ROOT/admin 2. ROOT context that comes with tomcat has all it's jsp files pre-compiled. Your new index.jsp is being ignored in favor of the pre-compiled version. Remove the servlet mapping in webapps/ROOT/WEB-INF/web.xml, restart tomcat (or just the ROOT webapp if you have the manager webapp up and running), and all should be as expected. --David Pid wrote: what version of tomcat? what have you got defined in the Host ...s in your server.xml? McRaven, Brian wrote: I have placed an index.jsp file that I created in my servers webapps/ROOT folder. When I place the following address in my browser: http://localhost/index.jsp I still come up with the tomcat homepage on my local host. I know that file is located in the ROOT/admin folder is there some way that my browser is overridding my request for my index.jsp file for the tomcat homepage index.jsp instead? I've tried opening other jsp's that I migrated to this folder and I get a 404 not found message when I do this. Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with mod_jk and multiple workers.
Good afternoon, I am trying to configure apache to send requests to multiple instances of tomcat using mod_jk. I am using Redhat 9 Apache/2.0.40 Tomcat-5.5.17 and have tried jakarta-tomcat-connectors-jk-1.2.6 jakarta-tomcat-connectors-1.2.14.1 jakarta-tomcat-connectors-1.2.15 I can get httpd to send requests to tomcat through mod_jk fine, but only if tomcat is listening on port 8009. It doesn't seem to matter what I put in my workers.properties file, mod_jk doesn't seem to be reading it. --- Snippet from httpd.conf: --- LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so JkWorkersFile /home/httpd/conf/my_workers.properties JkLogFile /var/log/httpd/my_mod_jk.log JkLogLevel debug JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T --- --- Contents of my_workers.properties --- worker.list=worker1,worker2,worker3 # Set properties for worker1 worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 # Set properties for worker2 worker.worker2.type=ajp13 worker.worker2.host=localhost worker.worker2.port=8109 # Set properties for worker3 worker.worker3.type=ajp13 worker.worker3.host=localhost worker.worker3.port=8209 Output in my_mod_jk.log (running with 1.2.14.1) [Tue Jul 11 16:00:52 2006] [5589:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5590:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5591:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5592:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5593:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5594:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5595:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5596:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5582:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] do_shm_open::jk_shm.c (240): Truncated shared memory to 66560 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] do_shm_open::jk_shm.c (272): Initialized shared memory size=66560 free=65536 addr=0x40ff4000 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] do_shm_open_lock::jk_shm.c (182): Opened shared memory lock /etc/httpd/logs/jk-runtime-status.lock [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] init_jk::mod_jk.c (2350): Initialized shm:/etc/httpd/logs/jk-runtime-status [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] uri_worker_map_open::jk_uri_worker_map.c (323): rule map size is 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] build_worker_map::jk_worker.c (236): creating worker ajp13 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] wc_create_worker::jk_worker.c (141): about to create instance ajp13 of ajp13 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] wc_create_worker::jk_worker.c (154): about to validate and init ajp13 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_validate::jk_ajp_common.c (1806): worker ajp13 contact is 'localhost:8009' [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1895): setting socket keepalive to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1934): setting socket timeout to -1 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1938): setting socket buffer size to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1942): setting connection recycle timeout to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1946): setting cache timeout to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1950): setting connect timeout to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1954): setting reply timeout to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1958): setting prepost timeout to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1962): setting recovery opts to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1966): setting number of retries to 3 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug]
Using a property file in java class (not servlet)
Hello, Is there anyway of referencing a properties file located in: /appName/WEB-INF/file.propertes From inside a standard java class file? steve
Re: Common Access Card Authentication
Good Afternoon Bill- First step is to setup SSL http://tomcat.apache.org/tomcat-4.1-doc/ssl-howto.html IN your certificate keystore specify algo which conforms to DoD level Security (I would check with www.RSASecurity.com for the following example to replace the default of X509) keytool -genkey -alias tomcat specify -keyalg RSA also be sure to uncomment the SSL HTTP/1.1 Connector to enable the secure connection- Let me know if you need any help, Martin -- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Riner Bill C Ctr AEDC/ATA [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, July 11, 2006 10:56 AM Subject: Common Access Card Authentication Is it possible to configure Tomcat to authenticate users using the DoD Common Access Card? I found a module for the SunONE app server and a commercial product for Windows, but nothing for Tomcat. Thanks, Bill
RE: File isn't found in ROOT directory
Dave et al, I'm not sure why my index.jsp file is now accessible but it is. I commented out the part of the web.xml file for the servlet-name and got an error. When I got rid of the comments my index file showed up in the browser on refresh as opposed to the tomcat version. All is well that ends well. I must have overlooked something in there like saving the web.xml file before I tried the address. I'm now having trouble getting my servlet recognized which I will post in a separate post. Brian -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:54 AM To: Tomcat Users List Subject: Re: File isn't found in ROOT directory admin/index.jsp is a placeholder page for the admin webapp, not shipped with tomcat. If you placed it there, the url would be http://localhost:8080/admin/index.jsp. --David McRaven, Brian wrote: I commented out the servlet-mapping but I still get the tomcat page for index.jsp. With my installation of Tomcat there already was a folder called admin with index.jsp in it. I'm not sure if I was making that clear in my last post. I thought that was where the tomcat index.jsp was coming from. I notice that if I put my index.jsp in a subfolder of the ROOT directory then I can access it. Brian -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:32 AM To: Tomcat Users List Subject: Re: File isn't found in ROOT directory Two issue here: 1. Place the index.jsp in webapps/ROOT instead of webapps/ROOT/admin 2. ROOT context that comes with tomcat has all it's jsp files pre-compiled. Your new index.jsp is being ignored in favor of the pre-compiled version. Remove the servlet mapping in webapps/ROOT/WEB-INF/web.xml, restart tomcat (or just the ROOT webapp if you have the manager webapp up and running), and all should be as expected. --David Pid wrote: what version of tomcat? what have you got defined in the Host ...s in your server.xml? McRaven, Brian wrote: I have placed an index.jsp file that I created in my servers webapps/ROOT folder. When I place the following address in my browser: http://localhost/index.jsp I still come up with the tomcat homepage on my local host. I know that file is located in the ROOT/admin folder is there some way that my browser is overridding my request for my index.jsp file for the tomcat homepage index.jsp instead? I've tried opening other jsp's that I migrated to this folder and I get a 404 not found message when I do this. Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using a property file in java class (not servlet)
Probably not without using standard java io and a file path (which you can't rely on for packed web-apps). If the file was in /appName/WEB-INF/classes it would be a resource that could be found by the classloader. HTH, Jon sbell wrote: Hello, Is there anyway of referencing a properties file located in: /appName/WEB-INF/file.propertes From inside a standard java class file? steve - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Alias' and the like
Hi, We're running Apache in front of multiple tomcats with mod_jk. We have an admin app that we'd like to access using a different URL from other server connections, and I am looking for advice on the best way to do this. We will have the single web app, but need to access parts of it from: http://myserver/admin and the rest of it from http://myserver/services I think I have several choices: 1) add a Tomcat context for /admin and /services in the conf directory. When I tried this, however, it seemed to load the whole web app twice (we're using Spring, so it loads the app Context twice ). Is there a way to just point to it, rather than load it? 2) add an Alias in Apache's httpd.conf what do I point it to seeing that it has to go through mod_jk and tomcat? 3) use mod_jk how would I do that? we currently have 3 load balancers defined, so we can balance 3 aspects of the system as follows: JKMount /services/admin/* adminloadbalancer JKMount /services/httpadaptor/* adaptorloadbalancer JkMount /services/* clientloadbalancer I'd like to do JKMount /admin/* adminloadbalancer but need the alias for /admin to point to /services/admin. I would be very grateful if someone could explain the best option... cheers, David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
session not maintained struts/tomcat 5.0.25
We have a struts application on tomcat 5.0.25 jdk1.4, which does not seem to maintain session, when the request lands up on a particular tomcat. We have two struts application, say app1, app2. tomcat 1 to 4 hosts app1. tomcat 6 to 8 hosts both app1 and app2. The problem happens for app1 when the request lands up on tomcat 6 to 8 hosting both the applications. While going through some of the previous post, I saw that 5.5 has a parameter emptySessionPath=true Is there anything similar for 5.0.25? I saw the sessionid changes between requests when the request lands up on tomcat 6 to 8. Why its happening for struts application on tomcat only? Our other applications not using struts works fine. I checked the session is obtained via the method request.getSession(false); Also if only tomcat 6 is running out of all the tomcats we never face the problem, the moment we put another tomcat into the mix the session is no longer maintained. Anybody had similar experience? Any help will be much appreciated, Thanks for reading. Rumpa Giri __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Accessing a servlet
Well I'm ticking these newbie questions off. I have a simple servlet that I want my form to access. I compiled the file fine and it is called JustALittleTest.class. I placed this file in the ROOT/WEB-INF/classes folder. In my JSP I have a form with some submit buttons. The action element of the form is set to =JustALittleTest. I changed my web.xml file so it now has the following entries: servlet servlet-nameJustALittleTest/servlet-name servlet-classJustAlittleTest.class/servlet-class /servlet servlet-mapping servlet-nameJustALittleTest/servlet-name url-pattern/JustALittleTest.class/url-pattern /servlet-mapping I've tried a few changes to the above entries but I haven't gotten it right yet. Should the servlet-class value have a .class extension? Is my url pattern accessing the correct folder? Brian
Re: session not maintained struts/tomcat 5.0.25
It was not tomcat, we found the problem. We have been looking in the wrong place all along. It was the IIS JK worker.properties file that had a typo. In the wroker.properties file the jvmRoute name was wrong for these tomcats 6 to 8. As a result, the request was never sent to the same server again by iis after the first request, neither the session was maintained. Thanks, Rumpa Rumpa Giri [EMAIL PROTECTED] wrote: We have a struts application on tomcat 5.0.25 jdk1.4, which does not seem to maintain session, when the request lands up on a particular tomcat. We have two struts application, say app1, app2. tomcat 1 to 4 hosts app1. tomcat 6 to 8 hosts both app1 and app2. The problem happens for app1 when the request lands up on tomcat 6 to 8 hosting both the applications. While going through some of the previous post, I saw that 5.5 has a parameter emptySessionPath=true Is there anything similar for 5.0.25? I saw the sessionid changes between requests when the request lands up on tomcat 6 to 8. Why its happening for struts application on tomcat only? Our other applications not using struts works fine. I checked the session is obtained via the method request.getSession(false); Also if only tomcat 6 is running out of all the tomcats we never face the problem, the moment we put another tomcat into the mix the session is no longer maintained. Anybody had similar experience? Any help will be much appreciated, Thanks for reading. Rumpa Giri __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: starting with windows service
Any word on this problem. SK. - Original Message - From: Shinya Koizumi [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, July 10, 2006 3:22 PM Subject: starting with windows service Recently i take over project developed by servlet. Currently whenever start the web server I have to click on the mycompany.bat file in CATALINA_HOME/bin folder mycompany.bat=== @echo off rem set CATALINA_OPTS=-Djava.security.debug=all cd %CATALINA_HOME%\bin\ catalina start -security pause === This way is different from how the tomcat starts up when starting tomcat from windows menu? How can I change the configuration so that the tomcat is going to start up just like when i click on mycompany.bat file? SK - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using a property file in java class (not servlet)
Thank you, that does help! - Original Message - From: Jon Wingfield [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:03 PM Subject: Re: Using a property file in java class (not servlet) Probably not without using standard java io and a file path (which you can't rely on for packed web-apps). If the file was in /appName/WEB-INF/classes it would be a resource that could be found by the classloader. HTH, Jon sbell wrote: Hello, Is there anyway of referencing a properties file located in: /appName/WEB-INF/file.propertes From inside a standard java class file? steve - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Increase heapsize with Tomcat 4.0.6
I am currently using Tomcat 4.0.6 with Vignette storyserver and IHS 1.3.26. I need to increase the heapsize. What is the correct method for this? Do I simply edit the catalina.sh file located at: /opt/vignette/tomcat-mcm/bin and increase the number next to Xmx? Or do I use a command to make it permanent? Thanks, Ibrahim ** This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited. Thank you.
RE: Accessing a servlet
I was able to refer to a book I have and so I dropped the .class extensions altogether. I get an error that requested resource is not available still. Any suggestions on this? My web.xml file has this entry: servlet servlet-nameJustALittleTest/servlet-name servlet-classJustAlittleTest/servlet-class /servlet servlet-mapping servlet-nameJustALittleTest/servlet-name url-pattern/JustALittleTest/url-pattern /servlet-mapping And my action attribute=JustALittleTest. Brian -Original Message- From: McRaven, Brian Sent: Tuesday, July 11, 2006 1:14 PM To: users@tomcat.apache.org Subject: Accessing a servlet Well I'm ticking these newbie questions off. I have a simple servlet that I want my form to access. I compiled the file fine and it is called JustALittleTest.class. I placed this file in the ROOT/WEB-INF/classes folder. In my JSP I have a form with some submit buttons. The action element of the form is set to =JustALittleTest. I changed my web.xml file so it now has the following entries: servlet servlet-nameJustALittleTest/servlet-name servlet-classJustAlittleTest.class/servlet-class /servlet servlet-mapping servlet-nameJustALittleTest/servlet-name url-pattern/JustALittleTest.class/url-pattern /servlet-mapping I've tried a few changes to the above entries but I haven't gotten it right yet. Should the servlet-class value have a .class extension? Is my url pattern accessing the correct folder? Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing a servlet
Did you reload the webapp after making the change? All changes to WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will require a reload before they become active in tomcat. --David McRaven, Brian wrote: I was able to refer to a book I have and so I dropped the .class extensions altogether. I get an error that requested resource is not available still. Any suggestions on this? My web.xml file has this entry: servlet servlet-nameJustALittleTest/servlet-name servlet-classJustAlittleTest/servlet-class /servlet servlet-mapping servlet-nameJustALittleTest/servlet-name url-pattern/JustALittleTest/url-pattern /servlet-mapping And my action attribute=JustALittleTest. Brian -Original Message- From: McRaven, Brian Sent: Tuesday, July 11, 2006 1:14 PM To: users@tomcat.apache.org Subject: Accessing a servlet Well I'm ticking these newbie questions off. I have a simple servlet that I want my form to access. I compiled the file fine and it is called JustALittleTest.class. I placed this file in the ROOT/WEB-INF/classes folder. In my JSP I have a form with some submit buttons. The action element of the form is set to =JustALittleTest. I changed my web.xml file so it now has the following entries: servlet servlet-nameJustALittleTest/servlet-name servlet-classJustAlittleTest.class/servlet-class /servlet servlet-mapping servlet-nameJustALittleTest/servlet-name url-pattern/JustALittleTest.class/url-pattern /servlet-mapping I've tried a few changes to the above entries but I haven't gotten it right yet. Should the servlet-class value have a .class extension? Is my url pattern accessing the correct folder? Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Accessing a servlet
OK I did that and now my system is hanging which I guess could be an error in my code or something with the server. I think it is my code so I'll look that over. Thanks for your help. Sorry for the confusion. Brian -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 2:48 PM To: Tomcat Users List Subject: Re: Accessing a servlet Did you reload the webapp after making the change? All changes to WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will require a reload before they become active in tomcat. --David McRaven, Brian wrote: I was able to refer to a book I have and so I dropped the .class extensions altogether. I get an error that requested resource is not available still. Any suggestions on this? My web.xml file has this entry: servlet servlet-nameJustALittleTest/servlet-name servlet-classJustAlittleTest/servlet-class /servlet servlet-mapping servlet-nameJustALittleTest/servlet-name url-pattern/JustALittleTest/url-pattern /servlet-mapping And my action attribute=JustALittleTest. Brian -Original Message- From: McRaven, Brian Sent: Tuesday, July 11, 2006 1:14 PM To: users@tomcat.apache.org Subject: Accessing a servlet Well I'm ticking these newbie questions off. I have a simple servlet that I want my form to access. I compiled the file fine and it is called JustALittleTest.class. I placed this file in the ROOT/WEB-INF/classes folder. In my JSP I have a form with some submit buttons. The action element of the form is set to =JustALittleTest. I changed my web.xml file so it now has the following entries: servlet servlet-nameJustALittleTest/servlet-name servlet-classJustAlittleTest.class/servlet-class /servlet servlet-mapping servlet-nameJustALittleTest/servlet-name url-pattern/JustALittleTest.class/url-pattern /servlet-mapping I've tried a few changes to the above entries but I haven't gotten it right yet. Should the servlet-class value have a .class extension? Is my url pattern accessing the correct folder? Brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Symbolic Links
How do I instruct Tomcat to follow symbolic links within the file system? For instance, I need to have index.html be a symbolic link to another file. Thanks, Brad Mann Software Engineer - Information Access Services HARRIS Corporation / GCSD (321) 984-6292
Re: Tomcat Symbolic Links
in your server.xml or context description Context .. allowLinking=true On Tuesday 11 July 2006 21:32, Mann, Bradley wrote: How do I instruct Tomcat to follow symbolic links within the file system? For instance, I need to have index.html be a symbolic link to another file. Thanks, Brad Mann Software Engineer - Information Access Services HARRIS Corporation / GCSD (321) 984-6292 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Symbolic Links
Thanks, works perfectly. All of the examples I found online describe putting attribute in a Resources tag below the Context tag, which was not working for me. Brad Mann Software Engineer - Information Access Services HARRIS Corporation / GCSD (321) 984-6292 -Original Message- From: dirk ooms [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 3:52 PM To: Tomcat Users List Subject: Re: Tomcat Symbolic Links in your server.xml or context description Context .. allowLinking=true On Tuesday 11 July 2006 21:32, Mann, Bradley wrote: How do I instruct Tomcat to follow symbolic links within the file system? For instance, I need to have index.html be a symbolic link to another file. Thanks, Brad Mann Software Engineer - Information Access Services HARRIS Corporation / GCSD (321) 984-6292 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Simple question, but can't figure out answer
Hello, I am trying to create some cgi pages for my company. Or I should say I have created some and now just want to add a header graphic in the main page. Nothing fancy. However, I cannot get my image to display, no matter how I embed the darned thing. I can't even get regular html to display from our installation. Is it a configuration thing? Or am I so green I just don't get it? (feel free to flame). Here is the only code I can get running that displays the image: #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; All good, it looks fine. However I cannot use this because then I cannot display anything else, or at least I cannot figure out how to. Any help is appreciated. I have been trying all kinds of things, so many I cannot recall half of the things I have tried. Truly frustrated from lack of knowledge. Regards, Jen Jennifer L Mead ICC Operations Sr Sys Engineer Con-way Enterprise Services 503.450.8578desk 503.550.6589cell [EMAIL PROTECTED]
Re: Simple question, but can't figure out answer
Jen, Unless there is a particular reason (e.g. dynamically created images), why are you reading image files directly in Perl, then dumping the output? You should just use CGI to generate HTML that looks like this: img src=/images/some/path.gif/ Even if you want to dynamically *choose* the image, you are better off having CGI/JSP/etc. dynamically fill in the src img src=${some_dynamic}/ or img src=%= someVal %/ rather than actually literally feeding the image. Mead, Jennifer L - VSCM wrote: Hello, I am trying to create some cgi pages for my company. Or I should say I have created some and now just want to add a header graphic in the main page. Nothing fancy. However, I cannot get my image to display, no matter how I embed the darned thing. I can't even get regular html to display from our installation. Is it a configuration thing? Or am I so green I just don't get it? (feel free to flame). Here is the only code I can get running that displays the image: #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; All good, it looks fine. However I cannot use this because then I cannot display anything else, or at least I cannot figure out how to. Any help is appreciated. I have been trying all kinds of things, so many I cannot recall half of the things I have tried. Truly frustrated from lack of knowledge. Regards, Jen Jennifer L Mead ICC Operations Sr Sys Engineer Con-way Enterprise Services 503.450.8578 desk 503.550.6589 cell [EMAIL PROTECTED] -- __ Avi Deitcher [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple question, but can't figure out answer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 More stupid question... 1 - Why are you using perl when you have tomcat - can't you just use a jsp? 2 - why can't you use an img tag? and have tomcat deliver the page... 3 - You are using tomcat aren't you? Confused Andrew On 11/07/2006, at 11:00 PM, Mead, Jennifer L - VSCM wrote: Hello, I am trying to create some cgi pages for my company. Or I should say I have created some and now just want to add a header graphic in the main page. Nothing fancy. However, I cannot get my image to display, no matter how I embed the darned thing. I can't even get regular html to display from our installation. Is it a configuration thing? Or am I so green I just don't get it? (feel free to flame). Here is the only code I can get running that displays the image: #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFEtBNWW126qUNSzvURAogbAJ9HHFxXIVUpt+xZFUKSMO08P6P2TgCeL1+a DMEBngY+kTShxsFNyHjz7yM= =EoBF -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simple question, but can't figure out answer
I am using perl CGI because that is what the company wants. I haven't used jsp ever, but I am researching it to teach myself. Then I could introduce it and convince my boss to let me develop in it. I have used the img page over and over to no avail. That is why I was concerned that it was a browser setting or tomcat specific. It should work. Yes we have tomcat installed. I should have realized that most folks on this list are jsp programmers and NOT perl CGI. Oh bother. Thanks for the reply, Jennifer -Original Message- From: Andrew Miehs [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 2:09 PM To: Tomcat Users List Subject: Re: Simple question, but can't figure out answer -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 More stupid question... 1 - Why are you using perl when you have tomcat - can't you just use a jsp? 2 - why can't you use an img tag? and have tomcat deliver the page... 3 - You are using tomcat aren't you? Confused Andrew On 11/07/2006, at 11:00 PM, Mead, Jennifer L - VSCM wrote: Hello, I am trying to create some cgi pages for my company. Or I should say I have created some and now just want to add a header graphic in the main page. Nothing fancy. However, I cannot get my image to display, no matter how I embed the darned thing. I can't even get regular html to display from our installation. Is it a configuration thing? Or am I so green I just don't get it? (feel free to flame). Here is the only code I can get running that displays the image: #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFEtBNWW126qUNSzvURAogbAJ9HHFxXIVUpt+xZFUKSMO08P6P2TgCeL1+a DMEBngY+kTShxsFNyHjz7yM= =EoBF -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with mod_jk and multiple workers.
It might not be the reason for your problems, but you should not start this with an apache version that old. If you want to use mod_jk, consider first updating to apache 2.0.58 or something close to it. Is your JkWorkersFile readable for the apache user? I never noticed such behaviour, so no other clue than these obvious ones. Rainer Jim Riordan schrieb: Good afternoon, I am trying to configure apache to send requests to multiple instances of tomcat using mod_jk. I am using Redhat 9 Apache/2.0.40 Tomcat-5.5.17 and have tried jakarta-tomcat-connectors-jk-1.2.6 jakarta-tomcat-connectors-1.2.14.1 jakarta-tomcat-connectors-1.2.15 I can get httpd to send requests to tomcat through mod_jk fine, but only if tomcat is listening on port 8009. It doesn't seem to matter what I put in my workers.properties file, mod_jk doesn't seem to be reading it. --- Snippet from httpd.conf: --- LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so JkWorkersFile /home/httpd/conf/my_workers.properties JkLogFile /var/log/httpd/my_mod_jk.log JkLogLevel debug JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T --- --- Contents of my_workers.properties --- worker.list=worker1,worker2,worker3 # Set properties for worker1 worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 # Set properties for worker2 worker.worker2.type=ajp13 worker.worker2.host=localhost worker.worker2.port=8109 # Set properties for worker3 worker.worker3.type=ajp13 worker.worker3.host=localhost worker.worker3.port=8209 Output in my_mod_jk.log (running with 1.2.14.1) [Tue Jul 11 16:00:52 2006] [5589:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5590:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5591:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5592:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5593:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5594:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5595:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5596:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:52 2006] [5582:16384] [debug] jk_cleanup_shmem::mod_jk.c (1747): Shmem cleanup [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] do_shm_open::jk_shm.c (240): Truncated shared memory to 66560 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] do_shm_open::jk_shm.c (272): Initialized shared memory size=66560 free=65536 addr=0x40ff4000 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] do_shm_open_lock::jk_shm.c (182): Opened shared memory lock /etc/httpd/logs/jk-runtime-status.lock [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] init_jk::mod_jk.c (2350): Initialized shm:/etc/httpd/logs/jk-runtime-status [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] uri_worker_map_open::jk_uri_worker_map.c (323): rule map size is 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] build_worker_map::jk_worker.c (236): creating worker ajp13 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] wc_create_worker::jk_worker.c (141): about to create instance ajp13 of ajp13 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] wc_create_worker::jk_worker.c (154): about to validate and init ajp13 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_validate::jk_ajp_common.c (1806): worker ajp13 contact is 'localhost:8009' [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1895): setting socket keepalive to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1934): setting socket timeout to -1 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1938): setting socket buffer size to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1942): setting connection recycle timeout to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1946): setting cache timeout to 0 [Tue Jul 11 16:00:54 2006] [5582:16384] [debug] ajp_init::jk_ajp_common.c (1950): setting connect timeout to 0 [Tue Jul 11 16:00:54 2006]
RE: Getting the date/time from the client
Is that really appropriate?? What if I have my Locale set to France, and my clock set to Pacific Standard Time? Then what? (assume I am on the east coast of the USA...) Tim -Original Message- From: Vinu Varghese [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 8:05 AM To: Tomcat Users List Subject: Re: Getting the date/time from the client Thanks Pid, I think that is a good idea Let me try - Regards Vinu Pid wrote: you can get a Locale from the request, and adjust the time accordingly. Vinu Varghese wrote: but that still sets the server date - yes ? Pid wrote: write a filter that activates for that url, and get the time just before you doFilter. if you need to, you can pass the date obj as an attribute Date date = new Date(); hreq.setAttribute(thisIsTheDate, date); chain.doFilter(hreq, hres); Jon Wingfield wrote: The HTTP spec (rfc2616) says clients should only send the Date header with http messages with body content (POST, PUT) and even then it's optional. Try adding a date string as a parameter on your GET request which your servlet can then parse from request.getParameter(...). One way to do this would be to change your link to a form with a hidden input field for your date value. Add an onclick/onsubmit javascript handler to your form button which sets the value of the hidden field to the current date in a format that your servlet will understand. for example: function setDate(form) { form.dateField.value = new Date().toString(); } Example assumes a hidden form input field with name dateField. HTH, Jon Vinu Varghese wrote: SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] minds.org To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client date/time (ie the time of the
Re: Simple question, but can't figure out answer
Hi Jennifer, Very strange! Tomcat and perl cgi! cool - didn't know it worked... Are you sure you are not using Apache with mod_jk, or mod_proxy? As for the perl. Where is the page that prints the HTML? why don't you just add print 'img src='.$IMAGE_DIRECTORY.$image.''; Very confused Or could it be that you are using the wrong document root? does http://myservername/images/icc-logo.gif deliver the correct image? Andrew. #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
On 7/3/06, Rainer Jung [EMAIL PROTECTED] wrote: version 1.2.16 of the Apache Tomcat mod_jk web server connector has been tagged. This version contains numerous bug fixes and some new improvements over our last release 1.2.15. Please test and share your experience. If no critical bugs will be found, we will have a formal release vote starting at Friday, July 7th. So, July 7th was last week, would you say mod_jk 1.2.16 is ready for a formal release? The reason why I ask is because I'm in the process of building a new development + production environment and might as well run with the latest and greatest. I downloaded it and it compiled cleanly on Solaris 9 (I think I used to have to do some trickery) - I haven't run in to any bugs with the light testing I've done. -- brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
AFAIK - version 1.2.16 had a regression bug so mod_jk team is planning to release 1.2.17. Regards, Edmon On 7/11/06, Brian Munroe [EMAIL PROTECTED] wrote: On 7/3/06, Rainer Jung [EMAIL PROTECTED] wrote: version 1.2.16 of the Apache Tomcat mod_jk web server connector has been tagged. This version contains numerous bug fixes and some new improvements over our last release 1.2.15. Please test and share your experience. If no critical bugs will be found, we will have a formal release vote starting at Friday, July 7th. So, July 7th was last week, would you say mod_jk 1.2.16 is ready for a formal release? The reason why I ask is because I'm in the process of building a new development + production environment and might as well run with the latest and greatest. I downloaded it and it compiled cleanly on Solaris 9 (I think I used to have to do some trickery) - I haven't run in to any bugs with the light testing I've done. -- brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thank you, Edmon Begoli http://blogs.ittoolbox.com/eai/software - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
Please have a look at: http://marc.theaimsgroup.com/?l=tomcat-devm=115234851210076w=2 I'll roll 1.2.17 in the next hours, but it will take a couple of days before we have a final vote done. Rainer Edmon Begoli schrieb: AFAIK - version 1.2.16 had a regression bug so mod_jk team is planning to release 1.2.17. Regards, Edmon On 7/11/06, Brian Munroe [EMAIL PROTECTED] wrote: On 7/3/06, Rainer Jung [EMAIL PROTECTED] wrote: version 1.2.16 of the Apache Tomcat mod_jk web server connector has been tagged. This version contains numerous bug fixes and some new improvements over our last release 1.2.15. Please test and share your experience. If no critical bugs will be found, we will have a formal release vote starting at Friday, July 7th. So, July 7th was last week, would you say mod_jk 1.2.16 is ready for a formal release? The reason why I ask is because I'm in the process of building a new development + production environment and might as well run with the latest and greatest. I downloaded it and it compiled cleanly on Solaris 9 (I think I used to have to do some trickery) - I haven't run in to any bugs with the light testing I've done. -- brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
Hi Would anyone know the correct way to increase the heapsize on Tomcat 4.0.6? Could I simply edit the catalina.sh file, increasing the value after 'Xmx'? Or is there a export command or a set command which properly increases it? Thanks, Ibrahim ** This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited. Thank you.
Re: mod_jk 1.2.16 release candidate: ready to test
Add Xmx to catalina.sh. Set it in JAVA_OPTS Regards, Edmon On 7/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Would anyone know the correct way to increase the heapsize on Tomcat 4.0.6? Could I simply edit the catalina.sh file, increasing the value after 'Xmx'? Or is there a export command or a set command which properly increases it? Thanks, Ibrahim ** This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited. Thank you. -- Thank you, Edmon Begoli http://blogs.ittoolbox.com/eai/software - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: mod_jk 1.2.16 release candidate: ready to test
Yes and you can use this -XX:MinHeapFreeRatio=NN That keeps the free memory at least NN of what is being used (or it is supposed to). Hope this helps, Jen -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 2:45 PM To: Tomcat Users List Cc: Tomcat Users List Subject: Re: mod_jk 1.2.16 release candidate: ready to test Hi Would anyone know the correct way to increase the heapsize on Tomcat 4.0.6? Could I simply edit the catalina.sh file, increasing the value after 'Xmx'? Or is there a export command or a set command which properly increases it? Thanks, Ibrahim ** This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited. Thank you. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simple question, but can't figure out answer
Oh yes tomcat works for any language CGI, you need to go into the conf files and uncomment a few things but it works. Not recommended because it bypasses the security built into tomcat. Here is a sample code with the img tag inserted: #!/usr/local/bin/perl -w # # # script:ot_main.pl - main entry page into ICC outage tracker tool # # purpose: a cgi script that calls pages that insert, display and update #outage tracker records for ICC # # links: ot_entry_form.pl - page to enter outage records #ot_view_all.pl - page to view all outage records in database # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); $|=1 ; $q = new CGI; print $q-header(text/html), $q-start_html(ICC Outage Tracker CGI Tool ); print $q-h1=(ICC Outage Tracker CGI Tool ), $q-h2, $q-hr, $q-img({-src='icc-logo.gif'}), $q-p, end_html; print a href=\ot_entry_form.pl\; print Enter a New Outage Incident; print p; print a href=\ot_view_all.pl\; print View Recorded Outage Incidents; print p; What this does is draw the box where the image should be. When I right click on it and look at the properties and it finds the right file. Just thought someone else would have ran into this Jen -Original Message- From: Andrew Miehs [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 2:27 PM To: Tomcat Users List Subject: Re: Simple question, but can't figure out answer Hi Jennifer, Very strange! Tomcat and perl cgi! cool - didn't know it worked... Are you sure you are not using Apache with mod_jk, or mod_proxy? As for the perl. Where is the page that prints the HTML? why don't you just add print 'img src='.$IMAGE_DIRECTORY.$image.''; Very confused Or could it be that you are using the wrong document root? does http://myservername/images/icc-logo.gif deliver the correct image? Andrew. #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
Edmon, I currently have the following: JAVA_OPTS=-Xms256m -Xmx512m -verbosegc I'd like to double the max. So do I simply edit to : JAVA_OPTS=-Xms256m -Xmx1024m -verbosegc and restart Tomcat? would the changes apply or does something else need to be done or in another file as well? Thanks, Ibrahim Edmon Begoli [EMAIL PROTECTED] 07/11/2006 02:49 PM Please respond to Tomcat Users List To: Tomcat Users List users@tomcat.apache.org cc: Subject:Re: mod_jk 1.2.16 release candidate: ready to test Add Xmx to catalina.sh. Set it in JAVA_OPTS Regards, Edmon On 7/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Would anyone know the correct way to increase the heapsize on Tomcat 4.0.6? Could I simply edit the catalina.sh file, increasing the value after 'Xmx'? Or is there a export command or a set command which properly increases it? Thanks, Ibrahim ** This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited. Thank you. -- Thank you, Edmon Begoli http://blogs.ittoolbox.com/eai/software - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This communication (including any attachments) may contain privileged or confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this communication and/or shred the materials and any attachments and are hereby notified that any disclosure, copying, or distribution of this communication, or the taking of any action based on it, is strictly prohibited. Thank you.
RE: Simple question, but can't figure out answer
Ok, it is something with my unix environment because I just pointed my code to the same gif on my windows box and up it comes! All code is fine, which I suspected because I have tried so many variations of it something had to work. Not sure what it could be but maybe I actually don't know where my image directory is. Even though I am giving it a fully qualified path, there must be a default image directory somewhere? Not sure. Jen -Original Message- From: Mead, Jennifer L - VSCM [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 2:53 PM To: Tomcat Users List Subject: RE: Simple question, but can't figure out answer Oh yes tomcat works for any language CGI, you need to go into the conf files and uncomment a few things but it works. Not recommended because it bypasses the security built into tomcat. Here is a sample code with the img tag inserted: #!/usr/local/bin/perl -w # # # script:ot_main.pl - main entry page into ICC outage tracker tool # # purpose: a cgi script that calls pages that insert, display and update #outage tracker records for ICC # # links: ot_entry_form.pl - page to enter outage records #ot_view_all.pl - page to view all outage records in database # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); $|=1 ; $q = new CGI; print $q-header(text/html), $q-start_html(ICC Outage Tracker CGI Tool ); print $q-h1=(ICC Outage Tracker CGI Tool ), $q-h2, $q-hr, $q-img({-src='icc-logo.gif'}), $q-p, end_html; print a href=\ot_entry_form.pl\; print Enter a New Outage Incident; print p; print a href=\ot_view_all.pl\; print View Recorded Outage Incidents; print p; What this does is draw the box where the image should be. When I right click on it and look at the properties and it finds the right file. Just thought someone else would have ran into this Jen -Original Message- From: Andrew Miehs [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 2:27 PM To: Tomcat Users List Subject: Re: Simple question, but can't figure out answer Hi Jennifer, Very strange! Tomcat and perl cgi! cool - didn't know it worked... Are you sure you are not using Apache with mod_jk, or mod_proxy? As for the perl. Where is the page that prints the HTML? why don't you just add print 'img src='.$IMAGE_DIRECTORY.$image.''; Very confused Or could it be that you are using the wrong document root? does http://myservername/images/icc-logo.gif deliver the correct image? Andrew. #!/usr/local/bin/perl -w # # use warnings; use CGI qw/:standard/; use CGI::Carp qw( fatalsToBrowser ); use constant BUFFER_SIZE = 4_096; use constant IMAGE_DIRECTORY = /images; $|=1 ; $q = new CGI; print $q-header( -type = image/gif ); binmode STDOUT; my $buff = ; my $image = icc-logo.gif; local *IMAGE; open IMAGE, IMAGE_DIRECTORY . /$image or die cannot open file $image: $!; while ( read( IMAGE, $buff, BUFFER_SIZE ) ) { print $buff; } close IMAGE; - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
On 7/11/06, Richard Mixon [EMAIL PROTECTED] wrote: Thanks to all those who replied with respect to the orginal thread. Please do not hijack and existing thread. Start a new thread. You have thoroughly mucked up this thread on mod_jk 1.2.16 rele4ase candidate: ready to test. Richard, I was just about to go all Mark Thomas on it! :) 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 subscribers this makes your new message appear as part of the old thread. This makes it harder for other users to find relevant information when searching the lists. This is known as thread hijacking and is behaviour that is frowned upon on this list. Frequent offenders will be removed from the list. It should also be noted that many list subscribers automatically ignore any messages that hijack another thread. The correct procedure is to create a new message with a new subject. This will start a new thread. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting the date/time from the client
A good devil's advocate question, or was it rhetorical? Either way it's got exactly the answer you'd expect, you'll set the date to whatever Locale the Request returns. Obviously. Tim Lucia wrote: Is that really appropriate?? What if I have my Locale set to France, and my clock set to Pacific Standard Time? Then what? (assume I am on the east coast of the USA...) Tim -Original Message- From: Vinu Varghese [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 8:05 AM To: Tomcat Users List Subject: Re: Getting the date/time from the client Thanks Pid, I think that is a good idea Let me try - Regards Vinu Pid wrote: you can get a Locale from the request, and adjust the time accordingly. Vinu Varghese wrote: but that still sets the server date - yes ? Pid wrote: write a filter that activates for that url, and get the time just before you doFilter. if you need to, you can pass the date obj as an attribute Date date = new Date(); hreq.setAttribute(thisIsTheDate, date); chain.doFilter(hreq, hres); Jon Wingfield wrote: The HTTP spec (rfc2616) says clients should only send the Date header with http messages with body content (POST, PUT) and even then it's optional. Try adding a date string as a parameter on your GET request which your servlet can then parse from request.getParameter(...). One way to do this would be to change your link to a form with a hidden input field for your date value. Add an onclick/onsubmit javascript handler to your form button which sets the value of the hidden field to the current date in a format that your servlet will understand. for example: function setDate(form) { form.dateField.value = new Date().toString(); } Example assumes a hidden form input field with name dateField. HTH, Jon Vinu Varghese wrote: SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] minds.org To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { long l = request.getDateHeader(Date); Date d = new Date(l); System.out.println(d); } SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 12:51 AM Subject: Getting the date/time from the client Hi All, I am doing a project in jsp/servlet and tomcat, which requires to take the client
RE: Getting the date/time from the client
I was playing devil's advocate -- since we don't really know the OP's requirement(s), but we do know the OP seemed to really want the client's time. -Original Message- From: Pid [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 6:38 PM To: Tomcat Users List Subject: Re: Getting the date/time from the client A good devil's advocate question, or was it rhetorical? Either way it's got exactly the answer you'd expect, you'll set the date to whatever Locale the Request returns. Obviously. Tim Lucia wrote: Is that really appropriate?? What if I have my Locale set to France, and my clock set to Pacific Standard Time? Then what? (assume I am on the east coast of the USA...) Tim -Original Message- From: Vinu Varghese [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 8:05 AM To: Tomcat Users List Subject: Re: Getting the date/time from the client Thanks Pid, I think that is a good idea Let me try - Regards Vinu Pid wrote: you can get a Locale from the request, and adjust the time accordingly. Vinu Varghese wrote: but that still sets the server date - yes ? Pid wrote: write a filter that activates for that url, and get the time just before you doFilter. if you need to, you can pass the date obj as an attribute Date date = new Date(); hreq.setAttribute(thisIsTheDate, date); chain.doFilter(hreq, hres); Jon Wingfield wrote: The HTTP spec (rfc2616) says clients should only send the Date header with http messages with body content (POST, PUT) and even then it's optional. Try adding a date string as a parameter on your GET request which your servlet can then parse from request.getParameter(...). One way to do this would be to change your link to a form with a hidden input field for your date value. Add an onclick/onsubmit javascript handler to your form button which sets the value of the hidden field to the current date in a format that your servlet will understand. for example: function setDate(form) { form.dateField.value = new Date().toString(); } Example assumes a hidden form input field with name dateField. HTH, Jon Vinu Varghese wrote: SK, That javascript prints the current client time. But I want the client time with the request. The scenario is : I have a index.jsp %@ page language=java contentType=text/html; charset=ISO-8859- 1 pageEncoding=ISO-8859-1% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titleInsert title here/title /head body Client time : a href=clienttime.htm Click/a /body /html and a servlet that can take the client time (Hoping to :-) ) which is mapped to 'clienttime.htm' protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/plain); long time = request.getDateHeader(Date); // Hoping to get the client date. PrintWriter out = response.getWriter(); out.println(Server time + new Date()); out.println(Client time (long) + time); out.println(Client time + new Date(time)); } Is there any way to do this (get the client time from the request) ? Or Am I trying to do a dumb thing ? ;) Thanks Regards Vinu Shinya Koizumi wrote: Vinu Yeah, you are right about it, I can't get getDateHeader working. For the solution one, I have setup like this for jsp and worked. %@ page session=false % html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 title%= application.getServerInfo() %/title /head body Current Time: % out.println(SCRIPT LANGUAGE=JavaScript); out.println(var currentTime = new Date();); out.println(document.write(currentTime.toLocaleString());); out.println(/SCRIPT); out.println(/HEAD); % /body /html SK - Original Message - From: Vinu Varghese [EMAIL PROTECTED] minds.org To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 11, 2006 1:24 AM Subject: Re: Getting the date/time from the client Thanks SK, I tried the second solution , but request.getDateHeader(Date) returns -1 . Also I didn't understand the first solution ( embed a javascript), Can u pls elaborate that. Thanks and regards Vinu Shinya Koizumi wrote: One is to embed javascript in the output out.println(HTMLHEADtitleJavaScriptExample/title); out.println(SCRIPT LANGUAGE=JavaScript); out.println(function back() {); out.println(history.back(-1);); out.println(}); out.println(/SCRIPT); out.println(/HEAD); The other solution is to get it from the request header.
Re: Installing My Own DirContext
Mike Wannamaker wrote: Does anyone have any input on this? What I want is through some config settings install my own DirContext.class Just configure a Resources element for your Context http://tomcat.apache.org/tomcat-5.5-doc/config/resources.html http://tomcat.apache.org/tomcat-5.5-doc/config/context.html Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
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 subscribers this makes your new message appear as part of the old thread. This makes it harder for other users to find relevant information when searching the lists. This is known as thread hijacking and is behaviour that is frowned upon on this list. Frequent offenders will be removed from the list. It should also be noted that many list subscribers automatically ignore any messages that hijack another thread. The correct procedure is to create a new message with a new subject. This will start a new thread. Mark tomcat-user-owner - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk 1.2.16 release candidate: ready to test
OK - related to the subject. Does mod_jk have unit tests that we could use to do/help with regression testing? We found number of bugs in previous versions of mod_jk, but these were unfortunatelly bugs found in production environment. Since then we started using Apache workbench and push to test but I would be really interested to run some mod_jk native tests if available. Even if not available I would not mind creating some for the mod_jk team for as long as someone from the mod_jk dev. team can assist with hints of what are the most important scenarios. Thank you, Edmon On 7/11/06, Mark Thomas [EMAIL PROTECTED] wrote: 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 subscribers this makes your new message appear as part of the old thread. This makes it harder for other users to find relevant information when searching the lists. This is known as thread hijacking and is behaviour that is frowned upon on this list. Frequent offenders will be removed from the list. It should also be noted that many list subscribers automatically ignore any messages that hijack another thread. The correct procedure is to create a new message with a new subject. This will start a new thread. Mark tomcat-user-owner - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thank you, Edmon Begoli http://blogs.ittoolbox.com/eai/software - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple question, but can't figure out answer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/2006, at 11:53 PM, Mead, Jennifer L - VSCM wrote: What this does is draw the box where the image should be. When I right click on it and look at the properties and it finds the right file. Just thought someone else would have ran into this And where is your image on the disk? ./tomcat/webapps/ROOT/images ? Looks as if it simply cant find it... Andrew -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFEtDPuW126qUNSzvURAqsaAJ9sPOCAL+bhEP2yC5QHU74H9/y5IwCgjIgI q7JCUSODlyeQgMZ+ME9N8Ks= =EAuh -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple question, but can't figure out answer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ahhh... and in webapps/ROOT/ create a directory called WEB-INF (please note capitals) that should fix your problem... Regards Andrew On 11/07/2006, at 11:53 PM, Mead, Jennifer L - VSCM wrote: What this does is draw the box where the image should be. When I right click on it and look at the properties and it finds the right file. Just thought someone else would have ran into this -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFEtDShW126qUNSzvURAgtxAJwPa2jrrkN0241hVlxaxDf+eZd1bgCfbfSl 5pIOXiiNKc5pHCZHpqZlO08= =haVp -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Next try: mod_jk 1.2.17 release candidate ready to test
Hi, thanks to everyone who tested 1.2.16. Unfortunately we had one regression bug in the status worker (hanging update request because of double locking). For full results please see: http://marc.theaimsgroup.com/?l=tomcat-devm=115234851210076w=2 Today version 1.2.17 of the Apache Tomcat mod_jk web server connector has been tagged. This version fixes the new bugs from 1.2.16 and adds one improvement. Please test and share your experience. If no critical bugs will be found, we will have a formal release vote starting at Saturday, July 15th. The source distribution can be downloaded from: http://tomcat.apache.org/dev/dist/ The updated documentation can be found at http://tomcat.apache.org/dev/docs/tomcat-connectors-1.2.17/ Please see http://tomcat.apache.org/dev/docs/tomcat-connectors-1.2.17/changelog.html for a complete list of changes. Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Tomcat Embedded
Mike Wannamaker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks Bill, I've looked at that and we actually have it running that way. What I'm looking for is a way to duplicate org.apache.catalina.startup.Bootstrap class in my own startup. I believe that JBoss does something similar? What I really want to do is get my version of Tomcat that I startup to work like starting Tomcat manually. I want it to read the server.xml and context.xml files for web apps. Actually, I believe that JBoss uses JMX-embedding (I know that the JMX-embedding was largely developed to help JBoss, but I've never cared enough to actually look through the JBoss code :). Is this possible? If you want it to start exactly like it would normally, then of course you could always just create in instance of Bootstrap, and call init and start on it (this is what jsvc does). Otherwise, you probably want to extend Catalina instead of Embedded and override load() so that you can specify alternate locations for server.xml and add Digester rules to do customizations that are more then just setting attributes. Setting the lib directories is just a matter of defining the CL that you load Catalina from, and passing it the shared CL to setParentClassLoader. Changing the location of where Tomcat looks for the context.xml files is more work, since you'd have to extend HostConfig, and then remove the one that Tomcat added, and add yours instead. Mike Wannamaker Senior Software Developer Hummingbird Ltd. 552 Princess St, Kingston, ON, K7L 1C7 Tel: (613) 548-4355 x4535 Fax (613) 548-7801 E-Mail: Mike Wannamaker www.hummingbird.com IMPORTANT NOTICE: This communication is privileged and contains confidential information for the sole use of the intended recipient(s). Any unauthorized disclosure, copying or use of this communication is strictly prohibited. If you have received this message in error, please contact the sender and delete this message without printing it or otherwise retaining a copy. -Original Message- From: Bill Barker [mailto:[EMAIL PROTECTED] Sent: July 10, 2006 11:44 PM To: users@tomcat.apache.org Subject: Re: Running Tomcat Embedded Mike Wannamaker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I wish to run Tomcat from within my own JVM. I would like it to run just like Tomcat does today, however I'd just like to setup the various paths, for like web app root directory, config directory, lib directory etc Is there anyway to do this easily? Like I said I just want to create an instance of Tomcat/Catalina and setProperties(...); and then call start(); Any help is appreciated. Most people use Embedded (http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catali na/startup/Embedded.html) since it at least has some documentation. Commons-modeler has a simple (if slightly out of date :) example of how to embed Tomcat using JMX. This is useful if you want Tomcat to run in a different ClassLoader than the rest of your application (and at least personally, I find it easier to use). In either case, you need to set the properties on the sub-components (e.g. Engine, Host, Contex(s)) yourself, so you are responsible for creating them. Mike Wannamaker Senior Software Developer Hummingbird Ltd. 552 Princess St, Kingston, ON, K7L 1C7 Tel: (613) 548-4355 x4535 Fax (613) 548-7801 E-Mail: Mike Wannamaker www.hummingbird.com IMPORTANT NOTICE: This communication is privileged and contains confidential information for the sole use of the intended recipient(s). Any unauthorized disclosure, copying or use of this communication is strictly prohibited. If you have received this message in error, please contact the sender and delete this message without printing it or otherwise retaining a copy. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]