Edna Earhart

Greenhorn
+ Follow
since Aug 18, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Edna Earhart

What I am trying to do seems pretty simple though am having trouble - I want to create a calendar object (or whatever else that might work) and set it to a specific
timezone though I don't want it to convert the time that is already in there to the new time zone if that make sense.

Ie:

Calendar firstDate = GregorianCalendar.getInstance();
firstDate.setTimeInMillis(1261173600000);
//equates to 5 PM EST which is my default timezone

firstDate.setTimeZone(TimeZone.getTimeZone("PST"));
//now equates to 2PM - I don't want this-- I want to create a calendar object or whatever that equates to 5PM PST (as I need to compare it to another calendar in PST). I've tried messing with the order of things and passing in timezone in constructor but it doesn't seem to make a difference.
Also, is there a straight forward way to get the difference between timezones - if I had that information I could perhaps approach my what I am trying to do in a different way -- ie. some call or etc. that I could determine that there are 3 hours between a calendar object that is in EST and one that is PST?

Many Thanks!!!

14 years ago
I have the below code in a jsp page -- what I am trying to do is very common in that based on what a user previous selected in a menu(select) widget I need to then show that selected value in the menu again if the user submits the page and then is returned to the same page if there is an error condition(save the state) - my problem is I do not know how to achieve this as essentially I think I need to nest user.id within the test"${} condition - the below code does not work as user.id is not evaluating correctly? I am sure you must be able to do this somehow in jstl - I am just not familiar enough with jstl syntax -- I am using <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> tablib.

<select name="objectName" id="objectId>
<c:forEach var="user"items="${users}">

<option value="${user.id}"
<c:if test="${formBean.userId == user.id }">selected</c:if> > ${user.name}
</option>

</c:forEach>
</select>

Thanks very much
15 years ago
JSP
Hi,

I have a given date object and what I need to do is to determine a new date which is the previous day of the original and set the time to 11:00 pm (on the previous day/date). (The hours, minutes and seconds of original date can be anything) I am wondering what is the most straight-forward way to do this.

Thanks very much!
15 years ago
I am trying to get a better understanding of how static methods (common in util classes) and Singleton classes work in web applications. I understand that a Singleton class would only have one instance per jvm similarly with static methods, but how do these not become a bottleneck in web applications - as the way I am( maybe erroneously) thinking about it is for every client accessing they are bottlenecking on these static methods - I guess also I don't understand how the application server (JBoss in my case) handles threading and the like(when load becomes heavy for instance). Know what I mean? Any articles etc. explaining these concepts would be much appreciated? Thanks
15 years ago