Why the time is way off?
The time in my Java web applications is way off the mark. For example, the time on the log4j message file is Apr 18 13:44 when the time on the Linux box is Apr 17 21:44. The applications use the same time data of log4j. There is not such issue in the development Window box, but only on the deployment Linux box. The applications don't change the time setting, nor the time zone. I have to ask whether it is possible that TC can be configured with different time set as its underlaid OS or not. Is a way to find out the time setting in a TC? I don't have a control of TC on the deployment box, btw.Thanks,Vernon _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx
RE: AW: Non-Latin Character Display
Thanks both Konstantin and Rashmi. The recommended article covers all aspects of non-Latin language Java web development. I already did all recommended steps whenever they were applied. So, why I didn't get the character display correctly? The Java web applications I have always use some sort of page composite technique, Tiles for example. The page tag <[EMAIL PROTECTED] contentType="text/html; charset=UTF-8" %> was only used in the template JSP file. but not every page component JSP files. After applied the JSP page tag to the JSP file with Chinese characters, the problem is solved. Thanks again. Vernon Original Message Follows From: "Konstantin Breu" <[EMAIL PROTECTED]> Reply-To: "Tomcat Users List" To: "'Tomcat Users List'" Subject: AW: Non-Latin Character Display Date: Sat, 17 Mar 2007 23:41:53 +0100 The original post was this: http://mail-archives.apache.org/mod_mbox/tomcat-users/200703.mbox/%3cBAY103- [EMAIL PROTECTED] (text also quoted below) I have tested it with Eclipse 3.2 and Tomcat 6 (jre1.5.0_10), with chinese, korean and hebrew characters, it works... Which Tomcat and JDK version are you using? I can do a further test... ;-) There might also be some conversion of the file before it is stored and compiled at the server... (for example conversion when commiting it to a versioning system) this is the text of the original post: > I have several Java web applications on Tomcat where non-Latin characters > function properly with only one exception. Non-Latin characters, Chinese in > this case, can be displayed properly thorough the JSTL message tag. The > related configuration are followings: > > HTML: > JSP: <%@ page contentType="text/html;charset=UTF-8" language="java" %> > > The applications can take Chinese character inputs correctly with a filter > of converting request character encoding to "UTF-8". > > The only problem is that Chinese characters don't displayed properly when > they are directly typied on a JSP file. I have set the Eclipse file text > encoding to utf-8 and the characters are shown correctly in the IDE. > > I believe that is a TC configuration related issue. After having "set > JAVA_OPTS= -Dfile.encoding=UTF-8" in the catalina.bat file, nothing has > changed. > > How to solve this problem? > > Thanks in advance. -Ursprüngliche Nachricht- Von: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 17. März 2007 22:04 An: Tomcat Users List Betreff: Re: Non-Latin Character Display I haven't been following this thread, and don't know what the original request / problem was but, perhaps you may find this article useful - it's written very well IMHO. Character Conversions from Browser to Database http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/index.html I'm not sure if the above will be of use to you. Also some additional related links: http://www.w3.org/International/O-charset.en.php -Rashmi - Original Message From: Vernon _ <[EMAIL PROTECTED]> To: users@tomcat.apache.org Sent: Saturday, March 17, 2007 1:13:23 PM Subject: Re: Non-Latin Character Display No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail - 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] _ Its tax season, make sure to follow these few simple tips http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips.aspx?icid=HMMartagline - 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: Non-Latin Character Display
> As I mentioned in my post, I already have the JSP page set as> > HTML: /> > JSP: <%@ page contentType="text/html;charset=UTF-8" language="java" %> Mark was suggesting that you set the request encoding, not the response encoding. The above is character set setting which is different from character encoding. They are two different things. In my original post, I already mentioned that I have converted the request character encoding to utf-8. > I use a MVC framework. So, I am not sure anywhere using GET. Uhh right. I'm sure you use GET requests sometimes. Better set it in .the connector. Honestly, the client should be reporting the request encoding, and you should be honoring it. I can't see how this connect with the issue. > I have this issue for ages. I haven't been able to resolve. I have to > move long text into a message property file to go around this problem. Localized text should probably be in a separate file, anyway. I don't know whether you understand the background or not. I was talking about something in between two i18n approaches. When one is not working, I have to use the other one. How are you typing those characters into your java source files? If you are using a source file encoding other than the default encoding on your system, you might have to tell the JSP compiler what encoding the files are in. You can't go wrong using \uWXYZ instead of native characters. I typed the characters into a JSP file directly as I said in my original post. I also try put a unicode in JSP file as what it is in a message property file. The unicdoe shows up as what it is. I believe the problem is laid in the process of either JSP file translation or/and servlet compiling. That is why I took a shot on the file encoding of Java option. It doesn't work, however. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF+32M9CaO5/Lv0PARAkMrAJ9/cfgcX2drWxcFLAUUGTwgOc5bygCfYwp8 6NszrV4jEM2cVQqFiyH+b6o= =iC5l -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] _ Get a FREE Web site, company branded e-mail and more from Microsoft Office Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/ - 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: Non-Latin Character Display
Thanks, Mark. As I mentioned in my post, I already have the JSP page set as HTML: JSP: <%@ page contentType="text/html;charset=UTF-8" language="java" %> I use a MVC framework. So, I am not sure anywhere using GET. I have this issue for ages. I haven't been able to resolve. I have to move long text into a message property file to go around this problem. Original Message Follows From: Mark Thomas <[EMAIL PROTECTED]> Reply-To: "Tomcat Users List" To: Tomcat Users List Subject: Re: Non-Latin Character Display Date: Fri, 16 Mar 2007 21:17:37 -0400 Vernon _ wrote: > I believe that is a TC configuration related issue. After having "set > JAVA_OPTS= -Dfile.encoding=UTF-8" There is no need to do this. This setting is read only on some JVMs. Try the following. If you use GET, you'll need to set the encoding in the connector as well. <%@ page contentType="text/html; charset=UTF-8" %> Character encoding test page Data posted to this form was: <% request.setCharacterEncoding("UTF-8"); out.print(request.getParameter("mydata")); %> 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] _ Watch free concerts with Pink, Rod Stewart, Oasis and more. Visit MSN Presents today. http://music.msn.com/presents?icid=ncmsnpresentstagline&ocid=T002MSN03A07001 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Non-Latin Character Display
I have several Java web applications on Tomcat where non-Latin characters function properly with only one exception. Non-Latin characters, Chinese in this case, can be displayed properly thorough the JSTL message tag. The related configuration are followings: HTML: JSP: <%@ page contentType="text/html;charset=UTF-8" language="java" %> The applications can take Chinese character inputs correctly with a filter of converting request character encoding to "UTF-8". The only problem is that Chinese characters don't displayed properly when they are directly typied on a JSP file. I have set the Eclipse file text encoding to utf-8 and the characters are shown correctly in the IDE. I believe that is a TC configuration related issue. After having "set JAVA_OPTS= -Dfile.encoding=UTF-8" in the catalina.bat file, nothing has changed. How to solve this problem? Thanks in advance. _ Exercise your brain! Try Flexicon. http://games.msn.com/en/flexicon/default.htm?icid=flexicon_hmemailtaglinemarch07 - 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: Application Path
Harry, Thanks for your detailed information. The approach doesn't work for my situation for the reason of url definiton in the application. For instance, I have a url mapping for /home.htm but not /myapp/home.htm. And changing the mapping xml file doesn't seem to be a good way to deal with this issue although it is doable. The mapping mechanism varies from a framework to another framework. I use the Spring for this project. Using the BASE tag means that you only need to change that one single value - all the other URLs in your pages would stay fixed, because they are relative to the BASE tag. So, for example, you could have a common tag library that sets the BASE tag value dynamically for all your pages - IOW, one tag library services all your pages. As for altering the code between development and deployment, the solutions to that are trivial: if you are rebuilding between development and deployment, then use a different build property to set a runtime property that your tag library references. If you're using the same build, then have a runtime variable that you can set, which you tag library references. I've used this method, and I recommend it. It's simple, and portable. Harry Mantheakis > Thanks for all your information. > > I was thinking of a application configuration solution so that I don't need > to alter the code between development and deployment. I have several > applications in various development phases in my box. I try to figure to > handle them together. > > > Vernon > __ > http://www.vicina.info > > > Original Message Follows > From: Harry <[EMAIL PROTECTED]> > Reply-To: "Tomcat Users List" > To: Tomcat Users List > Subject: Re: Application Path > Date: Tue, 07 Nov 2006 09:31:27 + > MIME-Version: 1.0 > Received: from mail.apache.org ([140.211.11.2]) by > bay0-mc9-f5.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Tue, 7 > Nov 2006 01:31:58 -0800 > Received: (qmail 18223 invoked by uid 500); 7 Nov 2006 09:32:06 - > Received: (qmail 18212 invoked by uid 99); 7 Nov 2006 09:32:06 - > Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) > by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 01:32:06 -0800 > Received: neutral (herse.apache.org: local policy) > Received: from [80.168.70.142] (HELO relay2.mail.uk.clara.net) > (80.168.70.142)by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 > 01:31:51 -0800 > Received: from mantheakis.claranet.co.uk ([80.168.130.24] helo=[10.0.0.3])by > relay2.mail.uk.clara.net with esmtp (Exim 4.50)id 1GhNIn-0007na-7mfor > users@tomcat.apache.org; Tue, 07 Nov 2006 09:31:29 + > X-Message-Info: txF49lGdW42h0cbO+nEGCm+Gy+i+Lt7qOV5pel0LBy8= > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Precedence: bulk > List-Help: <mailto:[EMAIL PROTECTED]> > List-Unsubscribe: <mailto:[EMAIL PROTECTED]> > List-Post: <mailto:users@tomcat.apache.org> > List-Id: > Delivered-To: mailing list users@tomcat.apache.org > X-ASF-Spam-Status: No, hits=0.5 required=10.0tests=DNS_FROM_RFC_ABUSE > X-Spam-Check-By: apache.org > User-Agent: Microsoft-Entourage/10.1.6.040913.0 > X-Virus-Checked: Checked by ClamAV on apache.org > Return-Path: [EMAIL PROTECTED] > X-OriginalArrivalTime: 07 Nov 2006 09:31:58.0422 (UTC) > FILETIME=[92575F60:01C7024F] > > Alternatively, you can set a BASE reference within the HEAD element of each > page, and then use relative-paths in all your URLs: > > > >... >http://www.webadorable.com/your-app-context-name-here/"/> >... > > > ... > > > > > The BASE value can (should!) be set dynamically, of course - with a tag > library, or whatever. > > Notice that the BASE reference has a trailing slash, whilst your relative > paths must start without a leading slash. > > Harry Mantheakis > > >> Is there any reason you can't just have the paths composed dynamically?: >> >> src="${pageContext.request.contextPath}/webapp/relpath/to/image.jpg" > /> >> >> For the ROOT webapp, the expression will return an empty path, so it's >> always correct. >> >> --David >> >> Vernon _ wrote: >>> >>> I have another new application deployed in a non-root directory. I >>> need to have absolute paths for CSS and Javascript in order to import >>> them properly with differenct level structure of JSP files. I can >>> deploy it as the root application or add the application name in the >>> absolute path. Neither solutions are very good. Any good practise to >>> solve this issue?
Re: Application Path
Thanks for all your information. I was thinking of a application configuration solution so that I don't need to alter the code between development and deployment. I have several applications in various development phases in my box. I try to figure to handle them together. Vernon __ http://www.vicina.info Original Message Follows From: Harry <[EMAIL PROTECTED]> Reply-To: "Tomcat Users List" To: Tomcat Users List Subject: Re: Application Path Date: Tue, 07 Nov 2006 09:31:27 + MIME-Version: 1.0 Received: from mail.apache.org ([140.211.11.2]) by bay0-mc9-f5.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Tue, 7 Nov 2006 01:31:58 -0800 Received: (qmail 18223 invoked by uid 500); 7 Nov 2006 09:32:06 - Received: (qmail 18212 invoked by uid 99); 7 Nov 2006 09:32:06 - Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 01:32:06 -0800 Received: neutral (herse.apache.org: local policy) Received: from [80.168.70.142] (HELO relay2.mail.uk.clara.net) (80.168.70.142)by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 01:31:51 -0800 Received: from mantheakis.claranet.co.uk ([80.168.130.24] helo=[10.0.0.3])by relay2.mail.uk.clara.net with esmtp (Exim 4.50)id 1GhNIn-0007na-7mfor users@tomcat.apache.org; Tue, 07 Nov 2006 09:31:29 + X-Message-Info: txF49lGdW42h0cbO+nEGCm+Gy+i+Lt7qOV5pel0LBy8= Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Help: <mailto:[EMAIL PROTECTED]> List-Unsubscribe: <mailto:[EMAIL PROTECTED]> List-Post: <mailto:users@tomcat.apache.org> List-Id: Delivered-To: mailing list users@tomcat.apache.org X-ASF-Spam-Status: No, hits=0.5 required=10.0tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org User-Agent: Microsoft-Entourage/10.1.6.040913.0 X-Virus-Checked: Checked by ClamAV on apache.org Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 07 Nov 2006 09:31:58.0422 (UTC) FILETIME=[92575F60:01C7024F] Alternatively, you can set a BASE reference within the HEAD element of each page, and then use relative-paths in all your URLs: ... http://www.webadorable.com/your-app-context-name-here/"/> ... ... The BASE value can (should!) be set dynamically, of course - with a tag library, or whatever. Notice that the BASE reference has a trailing slash, whilst your relative paths must start without a leading slash. Harry Mantheakis > Is there any reason you can't just have the paths composed dynamically?: > > /> > > For the ROOT webapp, the expression will return an empty path, so it's > always correct. > > --David > > Vernon _ wrote: >> >> I have another new application deployed in a non-root directory. I >> need to have absolute paths for CSS and Javascript in order to import >> them properly with differenct level structure of JSP files. I can >> deploy it as the root application or add the application name in the >> absolute path. Neither solutions are very good. Any good practise to >> solve this issue? >> >> Thanks, >> >> Vernon >> >> _ >> Find a local pizza place, music store, museum and morethen map the >> best route! http://local.live.com?FORM=MGA001 >> >> >> - >> 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] _ Stay in touch with old friends and meet new ones with Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us - 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: Application Path
That can solve the problem. However, is it little silly to prefix ${pageContext.request.contextPath} into every single URLs in the JSP files? Vernon __ Your local community information service - news, blogs, classifieds http://www.vicina.info Is there any reason you can't just have the paths composed dynamically?: /> For the ROOT webapp, the expression will return an empty path, so it's always correct. --David Vernon _ wrote: I have another new application deployed in a non-root directory. I need to have absolute paths for CSS and Javascript in order to import them properly with differenct level structure of JSP files. I can deploy it as the root application or add the application name in the absolute path. Neither solutions are very good. Any good practise to solve this issue? Thanks, Vernon _ Find a local pizza place, music store, museum and more then map the best route! http://local.live.com?FORM=MGA001 - 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] _ Try the next generation of search with Windows Live Search today! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-us&source=hmtagline - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Application Path
I have another new application deployed in a non-root directory. I need to have absolute paths for CSS and Javascript in order to import them properly with differenct level structure of JSP files. I can deploy it as the root application or add the application name in the absolute path. Neither solutions are very good. Any good practise to solve this issue? Thanks, Vernon _ Find a local pizza place, music store, museum and more then map the best route! http://local.live.com?FORM=MGA001 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]