<%@ include file="/html/portlet/blogs/init.jsp" %>
<h6>Some Special Header</h6>
<liferay-util:buffer var="myJspPage">
<liferay-util:include page="/html/portlet/blogs/view.portal.jsp" />
</liferay-util:buffer>
<!-- The below code will help you in replacing all the String "hello" in o/p jsp to HI.-->
<%
String html = StringUtil.replace(myJspPage, "hello", "HI");
%>
<%= html %>
<h6>Some Special Header</h6>
<liferay-util:buffer var="myJspPage">
<liferay-util:include page="/html/portlet/blogs/view.portal.jsp" />
</liferay-util:buffer>
<!-- The below code will help you in replacing all the String "hello" in o/p jsp to HI.-->
<%
String html = StringUtil.replace(myJspPage, "hello", "HI");
%>
<%= html %>
- Using the <liferay-util:buffer /> tag, the entire contents of the original Liferay JSP are placed in a string called "myJspPage".
- Then there is logic which replaces any instance of the character string "hello" with another value. The result of this is then written out to the page.
- Obviously, this can get unwieldy if there are a lot of changes that you need to make, but it is a strategy that has been used successfully.
No comments:
Post a Comment