Kate Xu

+ Follow
since Jul 28, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kate Xu

I got an output, but it was not what I expected:

dateString is: 9/1/2005
resultDate2 is: Wed Aug 31 20:00:00 EDT 2005

I expected resultDate2 to be: Thu Sep 1 04:00:00 GMT 2005
15 years ago
I am in U.S. Eastern Standard Time Zone (4 hours behind GMT during daylight savings time, or 5 hours behind GMT during eastern standard time).

My web application is running on Weblogic server, the server is using GMT system time zone.

I need to convert input from UI, which is in EST String format ( "9/1/2005 00:00"), to GMT Timestamp object (9/1/2005 04:00).

How can I do it? I tried this and it did not work:

import java.util.*;
import java.text.SimpleDateFormat;

public class TZ1 {
public static void main(String[] args) {

TimeZone tz = TimeZone.getTimeZone("US/Eastern");
TimeZone GMT_TIME_ZONE = TimeZone.getTimeZone("GMT");

Calendar estCalendar = Calendar.getInstance(tz);
Calendar gmtCalendar = Calendar.getInstance(GMT_TIME_ZONE);

String dateString = "9/1/2005";
String formatString = "MM/dd/yyyy";

SimpleDateFormat eptDateFormat = new SimpleDateFormat(formatString);

SimpleDateFormat gmtDateFormat = new SimpleDateFormat(formatString);

try {
System.out.println("dateString is: " + dateString);

//Date resultDate1 = eptDateFormat.parse(dateString);
//System.out.println("resultDate1 is: " + resultDate1);

Date resultDate2 = gmtDateFormat.parse(dateString);
System.out.println("resultDate2 is: " + resultDate2);

} catch (Exception e) {


15 years ago
Let me add more details to this.. After the "File Download" IE popup is displayed, a user clicks "Save" button. Then instead of displaying the file brower, Internet Explorer will display "File Download" IE popup again. Then the user clicks "Save" button again, then file brower is displayed.

I am using IE 6.0.28.

A coworker got the same result on a different PC.

Any help is greatly appreciated.
16 years ago
I have a problem with implementing functionality that allow user to download a file. The file itself is created correctly and users can choose the "Save" option to save it on the hard disk to view it later. Those parts work fine.

The problem is that the user needs to click "Save" button TWICE on the "File Download" pop up window where you can choose "Would you like to open the file or save it to your computer?"

Here is the source code I use:

public void doPost(HttpServletRequest request, HttpServletResponse response)
String fileName="ABC.csv";
String line="test";

PrintWriter writer = response.getWriter();

"attachment; filename=" + fileName);


catch (Throwable t)
finally {
//to do
16 years ago
Hello all,

I have a problem using Struts <html:text> tag.

How do I set maxlength property dynamically?

For example:

<html:text name="myForm" property="firstName" size="25" maxlength="30" />

I tried the following three ways:
(1) use <%= %>, it won't work.

import MyClass;
<html:text name="myForm" property="firstName" size="25" maxlength="<%=MyClass.FIRSTNAME_MAX_LENGTH%>" />

(2) Use <bean:message> tags, it won't work.
<html:text name="myForm" property="firstName" size="25" maxlength="<bean:message key="myPage.maxlength.firstnameMaxlength"/>" />

(3) Use <bean:write> tag, it also won't work.
<html:text name="myForm" property="firstName" size="25" maxlength="<bean:write name=\"myForm\" property="firstnameMaxLength"/>"/>

Any ideas?

Thank you!

16 years ago
Hi guys,

I have very little experience with web services. Could any one recommend a good book for the exam? or study materials?

With EJB-QL, can I use ORDER BY clause? How to write the query?
Thank you all!
Can vitual getter/setter method be private in CMP entity bean class?
Kathy says it's a bad idea to expose them... why just make them private?
AM I missing something here?