junwei's profileRichard's footprint on ....PhotosBlogListsMore ![]() | Help |
|
August 26 GlobalizationThe day before yesterday, Customers report that our app throw exception with a message saying that string was not recongnized as a valid datetime string when excecuting a search by specifying a datetime filter. After checking the app log, I found that on our server output culture info name "zh-CN", but on custom server output "en-GB". That made me delve into the DateTime type API, in turn, found that its ToString overloaded methods and Parse method are all associated with a specific culture. and this culture determined such as number format, date format, time format and currency format. If according a culture, a datetime string is valid, when trying to call parse method, the FormatException will be thrown.
It is said in MSDN that you have several ways to resolve this problem:
If you don't designate in any of the above loction, asp.net will provide you a default setting which set culture to "" and set autouserbase to false. Since the invariant culture associates with English language but none of any country/region and has its culture name a empty string. It seems that it should associate with english language. But the fact is on my own machine under IIS it always output "zh-CN" even though I changed it on region options via control panel but under asp.net built in development server, each time I change the region setting, it will reflect what I made. So confused! August 01 According to TLD or attribute directive in tag file, attribute value does not accept any expressionsThis afternoon, I was plan to integrate struts with hibernate using MyEclipse. I encountered this exception thrown:
According to TLD or attribute directive in tag file, attribute value does not accept any expressions
It seemed that my c:out tag couldn't take effect, but I checked the dependent jstl.jar and standard.jar, they were ok and when I run other web app within my tomcat5.5.20, the c:out tag worked fine.
After several hours, I found out finally the originate of the problem. The web.xml configuration file is generated by MyEclipse. when viewing the content of this generated file, you will find that the root element web-app contains several attributes which are different from the ones which are included in the other working configuration file. I copied one from my other app and overwrote the MyEclipse generated one. The problem disappeared immediately. |
|
|