-
1. Re: to use display tag how to set portlet objects in JSP pag
scottdawson Apr 13, 2006 9:07 AM (in response to bomma001)See here:http://jboss.org/index.html?module=bb&op=viewtopic&t=80265
I think the defineObjects tag is what you are looking for.
Regards,
Scott -
2. Re: to use display tag how to set portlet objects in JSP pag
bomma001 Apr 13, 2006 6:19 PM (in response to bomma001)Hi Scott, I think the defineObjects helps to access the portlet objects directly in a JSP page. But coming to display tag, the tag handler file expecting the PortletRequest and RenderResponse objects in JSP PageContext. It uses a methods like portletRequest = (PortletRequest)pageContext.findAttribute("javax.portlet.request"); Display tag documentation also mentioned that the Pluto Portal implmenetaion makes those two objects avaialable in PageContext scope with "javax.portlet.request/response" names. Question again is: how to place PortletRequest and RenderResponse onjects in jSP page context. I'm using JBoss portal with webwork fraework. And webwork provies a JSR168Dispatcher class to work in portlet environment. I'm a newbi to portal stuff.:-) Thanks, ~Bhim
-
3. Re: to use display tag how to set portlet objects in JSP pag
bomma001 Apr 13, 2006 9:18 PM (in response to bomma001)Hi Scott, I tried below code without any luck :-) <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <portlet:defineObjects/> <c:set var="javax.portlet.request" value="$renderRequest" scope="page"/> <c:set var="javax.portlet.response" value="$renderResponse" scope="page"/> Thanks ~Bhim
-
4. Re: to use display tag how to set portlet objects in JSP pag
scottdawson Apr 14, 2006 9:34 AM (in response to bomma001)Bhim,
Ok, I understand the problem now. I'm sorry if I sent you down a wrong path initially.
In the Portlet Spec, section 16.3.2 lists 3 request attributes that must be provided by the portal environment when the PortletRequestDispatcher.include method is used to include a servlet or JSP. The 3 attributes are javax.portlet.config (the PortletConfig object), javax.portlet.request (the RenderRequest) and javax.portlet.response (the RenderResponse). So it seems that the 2 attributes you need are provided automatically by any JSR-168 compliant portal provided you are using the PortletRequestDispatcher to include the JSP.
Just to test this with JBoss Portal, I wrote a portlet that includes a JSP. Here is the entire JSP:<% Object req = pageContext.findAttribute("javax.portlet.request"); Object resp = pageContext.findAttribute("javax.portlet.response"); %> <p>Request: <%= req %></p> <p>Response: <%= resp %></p>
and here's the output I get:Request: org.jboss.portlet.JBossRenderRequest@6288ed Response: org.jboss.portlet.JBossRenderResponse@10b81da
So it appears to work correctly and you don't have to do anything. The defineObjects tag is not necessary.
Regards,
Scott -
5. Re: to use display tag how to set portlet objects in JSP pag
bomma001 Apr 14, 2006 6:37 PM (in response to bomma001)Thanks Scott.
Yes, You are right. JBoss was providing those portal objects. I actually observed issues with display tag attributes for URLs. I modified them for portal environment and it works.
Now I'm feeling better in Portal area.
~Bhim -
6. Re: to use display tag how to set portlet objects in JSP pag
baronnet Apr 18, 2007 7:47 AM (in response to bomma001)Hi,
I'm facing the same issue. The URL generated by displaytag is
http://localhost:18080/applicationTestPortlet/portal/auth/portal/dashboard/admin/default/11?action=2&action=formulaireVue2Controller&d-49653-o=2&d-49653-p=1&d-49653-s=1
The right one is : http://localhost:18080/portal/auth/portal/dashboard/admin/default/11?action=2&action=formulaireVue2Controller&d-49653-o=2&d-49653-p=1&d-49653-s=1
The requestURI is good, but displaytag adds applicationTestPortlet at the begining of the path. What can I do ?<portlet:renderURL var="urlCourante"> <portlet:param name="action" value="formulaireVue2Controller"/> </portlet:renderURL> urlCourante = <%=urlCourante%><br/> <display:table name="${liste.listeDeFormulaires}" requestURI="<%=urlCourante%>" > <display:column property="id" title="ID" sortable="true"/> <display:column property="uneChaine" title="Chaine" sortable="true"/> <display:column property="unEntier" title="Entier" /> <display:column property="unDouble" title="Double" /> <display:column property="unBooleen" title="Booleen" /> </display:table>
Best Regards,
FJB -
7. Re: to use display tag how to set portlet objects in JSP pag
theute Apr 18, 2007 8:00 AM (in response to bomma001)Which version of portal do you use ?
-
8. Re: to use display tag how to set portlet objects in JSP pag
baronnet Apr 18, 2007 8:05 AM (in response to bomma001)I'm using JBPortal 2.6.0-BETA 1.
I'm a bit puzzle as I'm not able to make displaytag running on JetSpeed 2 too.
And it's the same for eXtremeComponents. -
9. Re: to use display tag how to set portlet objects in JSP pag
baronnet Apr 18, 2007 8:32 AM (in response to bomma001)Hi again,
I found a workaround :<portlet:renderURL var="urlCourante"> <portlet:param name="action" value="formulaireVue2Controller"/> </portlet:renderURL>
then,requestURI="<%="http://"+request.getServerName()+":"+request.getServerPort()+urlCourante%>"
But I'm not sure it's very generic. -
10. Re: to use display tag how to set portlet objects in JSP pag
theute Apr 18, 2007 10:01 AM (in response to bomma001)They shouldn't add http://localhost:8080/portletCtxt to the requestURI.
Looks like a bug of displaytag.