Saturday, August 3, 2013

How can you modify each actionURL, renderURL & resourceURL in portlet appllication?

We can use  PortletURLGenerationListener  to modify each action , resource and render URLs


public class MyUrlGenerationListener
implements PortletURLGenerationListener
{
public void filterActionURL(PortletURL actionUrl) {
try {
            actionUrl.setWindowState(WindowState.MAXIMIZED);
            actionUrl.setSecure(true);

} catch (Exception e) {
...
}
}
public void filterRenderURL(PortletURL renderUrl) {
try {
                    renderUrl.setWindowState(WindowState.MAXIMIZED);
                    renderUrl.setSecure(true);
} catch (Exception e) {
...
}
}
public void filterResourceURL
➥(ResourceURL resourceURL) {
...


If you want to add a property to all portlet URLs, you should consider using the PortletURLGenerationListener



No comments:

Post a Comment