Building a URI - Finally Getting Easier!

W3C Logo

URIs are at the core of the Web but building them is surprisingly hard to do in the Java platform and it is very good that the JSR 311 folks are tackling the issue.

The proposed APIs can safely build a new URI from a base one:

UriBuilder.fromUri(baseUri). path("a:b;param=matrix/hello world").build();

and easily create a URI Template:

UriBuilder.fromUri(baseUri). path("a:{p1}"). matrixParam("param", "{p2}"). path("hello {p3}").build("b", "matrix", "world");

Check out Paul's report where he gives more details and provides links to the latest Build from Jersey.


Post a Comment:
Comments are closed for this entry.