In this article I am going customize Liferay sign in Portlet to demonstrate Liferay JSP Hook
Step1-:
Consider that we have created Liferay Plugin Project of type hook and the name of the project is loginIn-hook. Inside of this project open liferay-hook.xml and add the below contents
<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook>
<portal-properties>portal.properties</portal-properties>
<custom-jsp-dir>/custom_jsps</custom-jsp-dir>
</hook>
Step2-:
We need to customize liferay original jsp file in the path {TOMCAT_HOME}\docroot\html\portlet\login\login.jsp.
Step3-:
Open the login.jsp file and add this line before aui button row just as shown below
Your IP:<%=com.liferay.portal.util.PortalUtil.getHttpServletRequest(renderRequest).getRemoteAddr()%>
<aui:button-row>
<aui:button type="submit" value="sign-in" />
</aui:button-row>
Run you portlet your output will be like this-:
Step1-:
Consider that we have created Liferay Plugin Project of type hook and the name of the project is loginIn-hook. Inside of this project open liferay-hook.xml and add the below contents
<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook>
<portal-properties>portal.properties</portal-properties>
<custom-jsp-dir>/custom_jsps</custom-jsp-dir>
</hook>
Step2-:
We need to customize liferay original jsp file in the path {TOMCAT_HOME}\docroot\html\portlet\login\login.jsp.
Step3-:
Open the login.jsp file and add this line before aui button row just as shown below
Your IP:<%=com.liferay.portal.util.PortalUtil.getHttpServletRequest(renderRequest).getRemoteAddr()%>
<aui:button-row>
<aui:button type="submit" value="sign-in" />
</aui:button-row>
Run you portlet your output will be like this-:
Comments
Post a Comment