Encode URL with <h:outputLink> in WSRP Portlets
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Encode URL with <h:outputLink> in WSRP Portlets




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Encode URL with <h:outputLink> in WSRP Portlets  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-16-07 12:21 PM

Hi All,

Our project uses WSRP Portlets for development.
At a plain jsf level this does not pose a problem at all for me.
But in our project we use WSRP Portlets.Which has a producer and consumer fr
amework.
Its a very simple requirement there is a pdf icon onclick of that i need to 
download the report from the database.

I used <h:outputLink> in the following manner to hit the download servlet.
But i need to encode the URL we do in our javascript.
String encodedURL_dtd = response.encodeURL(request.getContextPath()+ "/Downl
oadServlet");


<h:datatable var="item" value="databean.list" >
..............
<h:outputLink rendered="#{(item.strreportFormat == 'P') value="#{f
acesContext.externalContext.requestContextPath}/DownloadServlet">

<h:graphicImage value="/images/icon/icon_small_pdf.gif" alt="View Reports"><
/h:graphicImage>
<f:param id="id1" value="item.id" />
<f:param id="sys1" value="item.sysName" />
</h:outputLink>
......
</h:datatable>


Any suggestions are welcome....





[ Post a follow-up to this message ]



    Re: Encode URL with <h:outputLink> in WSRP Portlets  
yurykats


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-16-07 06:25 PM

You can use the same EL expression in the JS code if it's in the tag's attri
bute.





[ Post a follow-up to this message ]



    Re: Encode URL with <h:outputLink> in WSRP Portlets  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-07 06:23 PM

I hope i understood you correctly but i tried to do something like this and 
it gave me the following error.
JSPG0124E: Custom tag attribute value cannot be runtime expression. value: "
[%= renderResponse.encodeURL(renderRequest.getContextPath() + "/ReconPro
cessorServlet") %]"

When i tried replacing this.
value="#{facesContext.externalContext.requestContextPath}/ReconProcesso
rServlet"> with
value="<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/Recon
ProcessorServlet") %>" >

I couldn't find any corresponding EL for renderResponse.encodeURL.






[ Post a follow-up to this message ]



    Re: Encode URL with <h:outputLink> in WSRP Portlets  
yurykats


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-07 06:23 PM

You can't use JSP expressions, only EL expressions on JSF tags, so <%= isn't
 goping to work.

Maybe I didn't quite understand what you are trying to do. You mentioned Jav
aScript, so I thought you were trying to move the same EL expression you had
 for 'value' into some JavaScript code.

If you are just trying to replace the expression for value, then what you ca
n do is use a method of a managed bean (pagecode bean, for example) that doe
s what you need and use that method for the expression on the value attribut
e.

For example:
value="#{pc_MyPage.servletUrl}"
and
public String getServletUrl() {
return ((RenderRequest)getFacesContext().getExternalContext().getRequest()).
encodeURL(... and so on
}





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:47 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register