Stephen on Software aka SOS

July 30, 2009

JAX-WS and Http Proxy

Filed under: Programming — Tags: , — sljm @ 11:19 am

With Java 1.5, Sun provides a new way of setting the http proxy using ProxySelectors.

In essence, you will need to provide your own custom ProxySelector to replace the default. So anything using a URLConnection will automatically use the proxy that is set using the ProxySelector. That means JAX-WS based stubs/proxies will also be able to use ProxySelector for passing traffic through the http proxy.

Sample code for writing your own ProxySelector can be found in the first 1st link. Authentication can be found in the second link.

Links

  1. Java Networking and Proxies
  2. JAX-WS and Http Proxy Authentication

June 3, 2009

Hashmaps and JSTL

Filed under: Programming — Tags: , — sljm @ 2:43 pm

Learnt a few things about how to use HashMaps in JSTL.

To access a hashmap with a key in JSTL.

${map.key} or ${map[key]}

If your key is from some other variable or you need to set the key dynamically

//Create a variable call keyName and set the value to something
<c:set var="keyName" value="${someObject.id}"/>
<c:out value="${map[keyName].id}/>

March 26, 2009

Visual VM –

Filed under: Uncategorized — Tags: — sljm @ 2:17 pm

Found an interesting video on how to use Visual VM that comes with JDK 6 update 7 to see what’s happening in Glassfish. Looks like an interesting tool to find out whether your app servers are leaking memory.

Java VisualVM User Guide:
http://java.sun.com/javase/6/docs/technotes/guides/visualvm/index.html
VisualVM project page:
https://visualvm.dev.java.net/gettingstarted.html

Blog at WordPress.com.