Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Gary Blomquist

Greenhorn
+ Follow
since Dec 07, 2001
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 Gary Blomquist

Is it possible for offerFirst(E e) of LinkedBlockingDeque to block? The javadoc says:

"Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available."

The verbiage "if it is possible to do so immediately" seems to indicate that it can NOT block but I have a Thread that is calling this method that either dies or blocks indefinitely. The run loop is inside a try/catch block so the thread should not die. I am wondering if the thread might be seizing up on the call to offerFirst.
The combo box has no border and the arrow is kind of faded. I know I can invoke setBorder() on the combo box. Is there some way set to the look and feel so that the arrow look correct?
14 years ago
What is the correct syntax to delimit source code on this forum?
14 years ago
Thanks, Michael.

I tried to combine the two approaches so that I can display a message to the user when he/she clicks the arrow and the combo box is empty:




However, the arrow stays depressed until I click it. Shouldn't the popupMenuWillBecomeInvisible() method already be executing in the Event Dispatch Thread?
[ June 19, 2006: Message edited by: Gary Blomquist ]
14 years ago
When the user clicks the arrow to display the drop list of a JComboBox, I would like to check a condition and if true, prevent the drop list from displaying. I am aware of the PopupMenuListener interface. I would like to do something like the following:

public class ComboPopupMenuListener
implements PopupMenuListener {

public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
if ( combo.getItemCount() == 0 ) {
showMsg("Please create your phone book to populate combo box");

// Prevent Drop list from displaying !
}
}

// other interface methods omitted
}
14 years ago
I thought about writing a getter method but I was hoping there might be something defined in the EL so I wouldn't have to.

Adding a feature to make public constants accessble using the EL would be a nice enhancement.
14 years ago
JSP
Is it possible to access a public static constant using the JSP expression language?

Assuming VmOffer.PHONE_NOTIFICIATION_PRIORITY is defined as a public static final string, what is the correct syntax for

<c:if test="${offer.phoneNotificationScheme == VmOffer.PHONE_NOTIFICIATION_PRIORITY}" >
Notification scheme is: PRIORITY
</c:if>

Thanks
14 years ago
JSP
I mistakenly thought "${mapItem.value}" was returning a Collection of values in the map (similar to the values method of HashMap) that needed to be iterated over to get the ArrayLists rather than a single value. I guess thats why they named it .value instead of .values : ) Thanks, for pointing out my error. I moved the Node to a top level class rather than leaving it nested.

And, thanks for the pointer on the UBB codes.
15 years ago
JSP
I am attempting to iterate over a TreeMap of ArrayLists using JSTL. If the ArrayLists contain Strings it works. However, if the ArrayLists contain simple javabeans I get the following error:

javax.servlet.ServletException: Don't know how to iterate over supplied "items" in <forEach>

Here is sample code:

<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"; %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.TreeMap" %>

<%
class Node {
private String name;
private boolean checked = false;

public Node(String name) {
this.name = name;
}

public String getName() {
return this.name;
}

public boolean getChecked() {
return this.checked;
}
}
ArrayList list1 = new ArrayList();
list1.add(new Node("1-1"));
list1.add(new Node("1-2"));
list1.add(new Node("1-3"));
ArrayList list2 = new ArrayList();
list2.add(new Node("2-1"));
list2.add(new Node("2-2"));
list2.add(new Node("2-3"));
TreeMap map = new TreeMap();
map.put("list1", list1);
map.put("list2", list2);
pageContext.setAttribute("map", map);
%>

<c:forEach var="mapItem" items="${map}">
<c:forEach var="list" items="${mapItem.value}">
<c:forEach var="listItem" items="${list}">
${listItem.name}<br />
${listItem.checked}<br />
</c:forEach>
</c:forEach>
</c:forEach>

Any idea what wrong?

Thanks,

Gary Blomquist
15 years ago
JSP
I have a couple of questions re: url rewriting.

1. When url rewriting occurs it is not occurring consistently in my application - some pages have the jsessionid and some do not. I am using the JSTL <c:url> tag to generate all of my urls. Does anyone know what might cause this inconsistency?

2. Is it possible to force url rewriting using the <c:url> tag even if the client's browser accepts cookies? My application allows the user to download an mp3. I am trying to use the audio/m3u mime type. When the client's browser receives the url sent back as an m3u mime type it hands the url off to the mp3 player which requests the mp3 with this url. However, the client's cookie does not seem to be sent back by the mp3 player. So, if possible I would like to use url rewriting regardless of whether the client accepts cookies or not so the I can maintain the session information.

Thanks for your help,

Gary Blomquist
16 years ago
JSP
I am developing an client/server application using SSL sockets and a trial certificate from Thawte. The client is a Java applet. The server is an inhouse developed program running on the host the applet is downloaded from - the originating host.

I have performed the following steps:

1. Generate a key pair and keystore using Sun's keytool
1. Generate a CSR.
2. Obtain a 20 day PKCS#7 test certificate from Thawte.
3. Import the test certificate into the original keystore.
4. Sign the jar file with the test certificate (otherwise step 6 is not permitted.)
5. Include the keystore in the applets jar file as a truststore and as a keystore on the host the server runs on.
6. Programatically, read the truststore when creating the SSL socket in the applet.

This process works.

However, I thought that it would be unsecure to include the keystore in the applet. I thought the keystore contained the server's public/private key pair. However, I now realize that when the Thawte signed certificate is imported into the keystore it replaces the original public/private key pair.

What I don't understand is how the encryption takes place. The client is using the keystore containing the signed certificate as its truststore and the server has the same keystore containing the signed certificate. But where is the private key used for encryption? Is this process I have described secure? In other words, if someone retrieved the keystore/truststore from the applet would that be a security hazard? Would it be better to have the applet download the truststore from the server?

I thought I would need two different keystores. The original keystore containing the public/private key pair on the server and a trust store on the client containing the signed certificate. I tried this; however, I was unable to import the signed certificate into a new keystore. I could only import it into the keystore containing the original public/private key pair.

Thanks for your assistance,

Gary Blomquist
16 years ago
What about using sockets for a low cost java .NET interoperability solution? Are there any cross platform issues i.e. big endian/little endian, etc.? I think sending strings over sockets might work without issues.
16 years ago
I changed my computer name/ip address after installing Oracle 8i on my Windows machine. Now I can not connect to the database. If I remember correctly, Oracle on Unix stores host info in the init.ora file. But I can't find init.ora on a Windows Oracle installation. How do I update my host info on so that I can connect to Oracle installed on a Windows machine?
Thanks for you help,
Gary Blomquist
18 years ago