Rachel McNamara

Greenhorn
+ Follow
since May 14, 2004
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 Rachel McNamara

Hello,

Upon init of my servlet, I initialize a static class that caches some
data from a database - the data is a set of objects stored in a HashMap. The data does not change very frequently so I am going to update it once a day. So here is my question...given that most of the time (23 hours a day) the data does not change, I dont want to have the overhead and serialzed nature of a synchronized method. I only want to lock the object when I am updating from the database. What is the best way to implement this?

thanks

P.S. I just read a series of articles explaining why using double checked locking on a singleton pattern wont work reliably, especially in a multi-processor environment - is there another solution?
thanks again for your reply - sorry i have been MIA and I hope you might still have an answer for me! I am using the c.tld....
19 years ago
JSP
the c.tld is contained in the standar.jar
19 years ago
JSP
Thanks for your reply! I am using JSTL 1.0 core library with Oracle's oc4j version 10g, which uses standard.jar. I dont think i need to add a taglib in my web.xml but I tried it anyway (mapping to standard.jar and then to c.tld) and got a different error message that said foreach was not in the namespace...;-(
19 years ago
JSP
Hello,

I am trying to use JSTL foreach tag to iterate over a collection stored in a java bean with application scope. I am getting a jsp parse exception with the following error string: Expression Language not supported in compile time attribute items on line
<c:forEach var="category" items="${reportMgr.reportCategories}" varStatus="status">

My understanding is that I can still use the jsp:useBean tag, set the object id in this tag and then refer to object id in the jstl tags via EL.
What am I missing?

thanks!


Here is the code snippet:

<jsp:useBean id="reportMgr" scope="session" class="oracle.emarket.dashboard.data.ReportManager">
<table width="100%" height="34" border="0" cellpadding="0" cellspacing="0">
<tbody>
<c:forEach var="category" items="${reportMgr.reportCategories}" varStatus="status">
<tr valign="top">
<td width="11" height="34" rowspan="2"><img height="34" alt="" src="imgs/hp_bar_leftside.gif" width="11" border="0"></td>
<td height="23" valign="middle" nowrap class="textB" background="imgs/hp_button_middle1.gif">
<a href="#" class="textB">
<span class="textB">  <c ut value="${category}"/>  </span>
</a>
</td>
<c:choose>
<c:when test="${fn:length(category) = status.count}">
<td width="21" rowspan="2"><img height="34" alt="" src="imgs/hp_button_side-right.gif" width="21" border="0"></td>
</c:when>
<c therwise>
<td width="21" rowspan="2"><img height="34" alt="" src="imgs/hp_button_middle2.gif" width="21" border="0"></td>
</c therwise>
</c:choose>
<td width="100%" rowspan="2" background="imgs/hp_test.gif"> </td>
<td width="1" rowspan="2" align="right" background="imgs/hp_bar_rightside.gif"><img src="imgs/hp_spacer.gif"></td>
</tr>
<tr>
<td background="imgs/hp_button_middle2.gif" width="125" height=11><img height=1 alt="" src="imgs/hp_spacer.gif" width=1 border=0></td>
</tr>
</c:forEach>
</tbody>
</table>
19 years ago
JSP