Portlet: renderURL not working

I am working on developing portrait 6. I am new to this. I need to store a hyperlink to another jsp in the way 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 that doesn't work (means when I click on the hyperlink aain only displays the first JSP

But it doesn't work

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>

      

+3


source to share


2 answers


Can you try the following code on 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 so, as it may be, it is a quotation mark ("") problem.

If not, you can provide more details about which portlet you are using MVCPortlet, etc.

+4


source


I believe the problem is with the tag.

In MVCPortlet, if you want to call a JSP page directly from another JSP page, you must name the portlet: parameter name as "mvcPath", say:

<portlet:renderURL var="varA">
    <portlet:param name="mvcPath" value="/a.jsp"/>
</portlet:renderURL>

<portlet:renderURL var="varB">
    <portlet:param name="mvcPath" value="/b.jsp"/>
</portlet:renderURL>

<a href="<%=varA %>">Link to A</a>
<a href="<%=varB %>">Link to B</a>

      



This will work fine.

Hope this helps you.

0


source







All Articles