Search code examples
jspmoduleliferay-7

How to override update_password.jsp in Liferay DXP 7.3.10 GA1


I am trying to override the portal-web page update_password.jsp following these examples:

I also set the property service.ranking:Integer=112 in my CustomJspBag subclass. My module deploys and starts without errors and the page in portal-web/docroot/html/portal/update_password.jsp is replaced by the new one and the old page becomes update_password.portal.jsp. The class gets activated and the getCustomJsps() returns the page name.

But the changes are not visible in the browser. The old page keeps showing. How can I make it work?


Solution

  • Thank you for adding the portal version @Luke, I reproduced this issue using the same version now.
    Then, after using the following resources, I managed to create a working app that overrides the update_password.jsp:
    https://git.fortiss.org/civitas-digitalis/platform/-/tree/master/modules/UpdatePasswordOverride
    https://www.softwaresavvyblog.com/post/liferay-overriding-core-jsps
    I have created a repository with my working app, to show you how the code exactly looks like, it will print an "OVERRIDDEN" message to the top of the page when you visit:
    http://localhost:8080/c/portal/update_password
    My repository is located here:
    https://github.com/peterpetrekanics/UpdatePwOverride7310

    Here are my detailed steps I took:

    1. Create a new Liferay workspace on your computer
      use blade init command from the terminal
      select dxp-7.3-sp1
    2. Create an MVC Portlet project and remove the unnecessary files
    3. Ensure that your build.gradle file contains this line:
      compileOnly group: "com.liferay.portal", name: "release.portal.api"
      otherwise your class will not detect the import: com.liferay.portal.deploy.hot.CustomJspBag;
    4. Modify your class:
      add "implements CustomJspBag" after your class' name
    5. Implement unimplemented methods (this is the part where using Liferay Developer Studio may come handy)
      I used the earlier mentioned blog resources for that.
    6. Build the project and deploy it to a running 7.3 GA1 server
    7. Visit this page, and the overridden message should appear:
      http://localhost:8080/c/portal/update_password

      I hope this helped, please let me know if you get other results