<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to set Page template to Page Programmatically</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120841776" />
  <subtitle>How to set Page template to Page Programmatically</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120841776</id>
  <updated>2026-04-03T19:08:24Z</updated>
  <dc:date>2026-04-03T19:08:24Z</dc:date>
  <entry>
    <title>RE: How to set Page template to Page Programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120849245" />
    <author>
      <name>Aravinth Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120849245</id>
    <updated>2021-06-25T08:43:02Z</updated>
    <published>2021-06-25T08:43:02Z</published>
    <summary type="html">&lt;p&gt;What type of page you are trying to create? Is it a content page or
  widget page, Hope you have created the respective Page Template.&lt;/p&gt;
&lt;p&gt;Share the API you have used to create the page and assign template to
  have a check.&lt;/p&gt;</summary>
    <dc:creator>Aravinth Kumar</dc:creator>
    <dc:date>2021-06-25T08:43:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set Page template to Page Programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120842525" />
    <author>
      <name>Rushikesh Gawade</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120842525</id>
    <updated>2021-06-24T09:41:10Z</updated>
    <published>2021-06-24T09:41:10Z</published>
    <summary type="html">&lt;p&gt;Hi Mohammed,&lt;/p&gt;
&lt;p&gt;Thanks for comment. i just try your method. i am getting the Plid but
  after when i visit the page its giving the exception.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;2021-06-24 09:38:03.681 ERROR
  [http-nio-8080-exec-1][RenderFragmentLayoutTag:183] Unable to get
  layout structure&lt;br /&gt;java.lang.NullPointerException&lt;br /&gt;    at
  com.liferay.layout.taglib.servlet.taglib.RenderFragmentLayoutTag._mergeLayoutStructure(RenderFragmentLayoutTag.java:249)&lt;br /&gt;  
   at
  com.liferay.layout.taglib.servlet.taglib.RenderFragmentLayoutTag._getLayoutStructure(RenderFragmentLayoutTag.java:178)&lt;br /&gt;  
   at
  com.liferay.layout.taglib.servlet.taglib.RenderFragmentLayoutTag.setAttributes(RenderFragmentLayoutTag.java:130)&lt;br /&gt;  
   at
  com.liferay.taglib.util.IncludeTag.callSetAttributes(IncludeTag.java:181)&lt;br /&gt;  
   at
  com.liferay.taglib.util.IncludeTag.doStartTag(IncludeTag.java:105)&lt;br /&gt;  
   at
  org.apache.jsp.layout.view.content_jsp._jspService(content_jsp:209)&lt;br /&gt;  
   at
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)&lt;br /&gt;  
   at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:733)&lt;br /&gt;  
   at
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)&lt;br /&gt;  
   at
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)&lt;br /&gt;  
   at
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)&lt;br /&gt;  
   at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:733)&lt;br /&gt;  
   at
  com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:368)&lt;br /&gt;  
   at
  com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:380)&lt;br /&gt;  
   at
  org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)&lt;br /&gt;  
   at
  org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)&lt;br /&gt;  
   at
  org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)&lt;br /&gt;  
   at
  org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.TransferHeadersHelperImpl$TransferHeadersRequestDispatcher.include(TransferHeadersHelperImpl.java:162)&lt;br /&gt;  
   at
  com.liferay.layout.type.controller.content.internal.layout.type.controller.ContentLayoutTypeController.includeLayoutContent(ContentLayoutTypeController.java:193)&lt;br /&gt;  
   at
  com.liferay.portal.model.impl.LayoutImpl.includeLayoutContent(LayoutImpl.java:901)&lt;br /&gt;  
   at
  com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:433)&lt;br /&gt;  
   at
  com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:173)&lt;br /&gt;  
   at
  com.liferay.portal.struts.PortalRequestProcessor._process(PortalRequestProcessor.java:408)&lt;br /&gt;  
   at
  com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:154)&lt;br /&gt;  
   at
  com.liferay.portal.internal.servlet.MainServlet.doGet(MainServlet.java:206)&lt;br /&gt;  
   at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:626)&lt;br /&gt;  
   at
  com.liferay.portal.internal.servlet.MainServlet.service(MainServlet.java:631)&lt;br /&gt;  
   at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:733)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)&lt;br /&gt;  
   at
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:124)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:62)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.lockout.LockoutFilter.processFilter(LockoutFilter.java:58)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:340)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:183)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:104)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)&lt;br /&gt;  
   at
  com.liferay.friendly.url.internal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:450)&lt;br /&gt;  
   at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:733)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.ServletAdapter.service(ServletAdapter.java:99)&lt;br /&gt;  
   at
  javax.servlet.http.HttpServlet.service(HttpServlet.java:733)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)&lt;br /&gt;  
   at
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:124)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:368)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:62)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.lockout.LockoutFilter.processFilter(LockoutFilter.java:58)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:340)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:265)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:248)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)&lt;br /&gt;  
   at
  com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:183)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)&lt;br /&gt;  
   at
  org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)&lt;br /&gt;  
   at
  org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)&lt;br /&gt;  
   at
  org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)&lt;br /&gt;  
   at
  org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)&lt;br /&gt;  
   at
  com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:175)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:175)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)&lt;br /&gt;  
   at
  com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:104)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)&lt;br /&gt;  
   at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)&lt;br /&gt;  
   at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)&lt;br /&gt;  
   at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)&lt;br /&gt;  
   at
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)&lt;br /&gt;  
   at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)&lt;br /&gt;  
   at
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)&lt;br /&gt;  
   at
  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)&lt;br /&gt;  
   at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)&lt;br /&gt;  
   at
  org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)&lt;br /&gt;  
   at
  org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)&lt;br /&gt;  
   at
  org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:880)&lt;br /&gt;  
   at
  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1601)&lt;br /&gt;  
   at
  org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)&lt;br /&gt;  
   at
  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)&lt;br /&gt;  
   at
  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)&lt;br /&gt;  
   at
  org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)&lt;br /&gt;  
   at java.lang.Thread.run(Thread.java:748)&lt;/p&gt;</summary>
    <dc:creator>Rushikesh Gawade</dc:creator>
    <dc:date>2021-06-24T09:41:10Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set Page template to Page Programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120844166" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120844166</id>
    <updated>2021-06-24T06:22:25Z</updated>
    <published>2021-06-24T06:22:24Z</published>
    <summary type="html">&lt;p&gt; Hi,&lt;/p&gt;
&lt;p&gt;You can use below api for updating page template to page&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;_layoutLocalService.updateMasterLayoutPlid(groupId, privateLayout, layoutId, masterLayoutPlid)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;masterLayoutPlid will be Page template Plid&lt;/p&gt;
&lt;p&gt;You can use below api for fetching the Page Template with name&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;LayoutPageTemplateEntry layoutPageTemplateEntry =  _layoutPageTemplateEntryLocalServcie.fetchLayoutPageTemplateEntry(groupId, layoutPageTemplateEntryKey);
masterLayoutPlid = layoutPageTemplateEntry.getPlid()&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2021-06-24T06:22:24Z</dc:date>
  </entry>
  <entry>
    <title>How to set Page template to Page Programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120841775" />
    <author>
      <name>Rushikesh Gawade</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120841775</id>
    <updated>2021-08-17T16:15:54Z</updated>
    <published>2021-06-23T08:26:23Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am using liferay DXP 7.3, here i have created one page template but
  i am not getting how to provide that page template to page programmatically.&lt;/p&gt;</summary>
    <dc:creator>Rushikesh Gawade</dc:creator>
    <dc:date>2021-06-23T08:26:23Z</dc:date>
  </entry>
</feed>
