Thursday, 11 July 2013

How to create render or action url in IBM Websphere Portal Portlets


How to create render or action url


There are two ways by using that you can create rebder or action url .

  1. First way of doing it by using tag library .
    1. Add the tag library I your JSP Page

<%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
    1. the above url is change for 168 portlet
    2. Add
Here I am creating renderURL only.Other URL's can be created in the similar way

 In JSP :

<portlet:renderURL var="renderURL " windowState="maximized" portletMode="edit">
    <portlet:param name="param-name" value="param-value" />
    <portlet:param name="param-name" value="param-value" />
</portlet:renderURL>


      <portlet:actionURL/>: The portlet actionURL tag creates a URL that must point to the current portlet and must trigger an action request with the supplied parameter. The parameters may be added to the URL by including the param tag between theactionURL start and end tags:



  1. By Using PortletURL class

 <%
           PortletURL renderURL = renderResponse.createRenderURL();
           renderURL.setParameter("param-name", "param-value");
           renderURL.setParameter("param-name", "param-value");
%>
<a href=”<%=renderURL%>” > URL to Hit </a>


In the above example param-name could be "jspPage" and param-value could be "/html/edit.jsp" if you want to navigate from current jsp page to some other jsp page (in this case edit.jsp) . We can set other parameters also as per our requirements.


Notepoint :-replace renderURL → actionURL for action





No comments:

Post a Comment

Very Impotent Links for Java and Portal development development

Jar Download for Spring  Maven Or Gradel Dependency for Spring