[MutableURL] ist eine URL-Klasse, die verändert werden kann. Die Klasse ist Bestandteil der [Design-Utils].
!!!Anwendung
Der Einsatz erfolgt dann, wenn URLs analysiert oder aufgebaut werden. [MutableURL] bietet Zugriff auf eine Vielzahl von Komponenten, aus dem ein URL aufgebaut ist.
!!!Beispiele
!Path
{{{
MutableURL url = new MutableURL("/first/second/page.jsp");
String first = url.getPath().getParts()[0];
String second = url.getPath().getParts()[1];
String name = url.getPath().getParts()[2];
}}}
!Parameters
{{{
MutableURL url = new MutableURL("http://www.intersult.com/test.jsp");
url.getQuery().put("size", "20");
System.out.println(url);
}}}
!Base-URL und Append
{{{
MutableURL url = new MutableURL("http://localhost/app/test.xhtml");
MutableURL pageUrl = new MutableURL("/login.xhtml");
MutableURL newUrl = url.getBaseUrl().append(pageUrl);
}}}
!Cookies
{{{
MutableURL url = new MutableURL("http://localhost:8081/home.jsp;jsessionid=F6332CC7983061B4F894901139AF2902?param=value");
System.out.println(url.getCookies().get("jsessionid"));
}}}