Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

portlet:renderURL not working

I am working on liferay 6 Portlet development. I am new to it. I need to keep a Hyperlink to another jsp this way as shown.

<a href="<portlet:renderURL>
    <portlet:param name="jspPage" value="/WEB-INF/view/page2.jsp" />
    </portlet:renderURL>">
</a>

I have another JSP called page2.jsp , but this isn't working (Means when i click on the hyper link , it aain displays the First JSP only

But this isn't working

This is my page1.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>

<s:form action="helloForm" method="POST" theme="simple">
    Enter Your Name:<s:textfield name="namer" value="%{name}" required="true"/>
    <s:submit/>
</s:form>


<a href="<portlet:renderURL>
<portlet:param name="jspPage" value="/WEB-INF/view/page2.jsp" />
</portlet:renderURL>">
</a>

=========

This is pag2.jsp

<html>
<head>
</head>
<body>
    <h1>Hi </h1>
</body>
</html>
like image 742
Gajjini Avatar asked Aug 04 '26 06:08

Gajjini


1 Answers

Can you try the following code in your page1.jsp and see if it works:

<portlet:renderURL var="clickRenderURL">
    <portlet:param name="jspPage" value="/WEB-INF/view/page2.jsp" />
</portlet:renderURL>

<a href="<%=clickRenderURL %>">Click here</a>

If it does than may be this is the issue with quotes ("").

If it does not then can you provide more details like which portlet are you extending MVCPortlet, etc.

like image 150
Prakash K Avatar answered Aug 08 '26 19:08

Prakash K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!