<?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>JSP customization error when using 'OSGi fragment' approach</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121988757" />
  <subtitle>JSP customization error when using 'OSGi fragment' approach</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121988757</id>
  <updated>2026-04-03T21:34:49Z</updated>
  <dc:date>2026-04-03T21:34:49Z</dc:date>
  <entry>
    <title>RE: JSP customization error when using 'OSGi fragment' approach</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121989464" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121989464</id>
    <updated>2023-08-29T12:19:36Z</updated>
    <published>2023-08-22T13:44:40Z</published>
    <summary type="html">&lt;p&gt;With JSP fragment bundles, they only have visibility on what you put
  in the fragment. Any errors, any unknown references, the IDE is going
  to report them all as errors.&lt;/p&gt;
&lt;p&gt;It's up to you, the developer, to know that, for example,
  &lt;code&gt;dlAdminDisplayContextProvider&lt;/code&gt; will be available when it
  is merged into the host bundle.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2023-08-22T13:44:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: JSP customization error when using 'OSGi fragment' approach</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121989032" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121989032</id>
    <updated>2023-08-21T14:29:02Z</updated>
    <published>2023-08-21T14:20:28Z</published>
    <summary type="html">&lt;p&gt;You might need to exclude the internal packages (all those display
  context classes are internal) in your bnd file: It's mentioned in the
  article you linked, &lt;a href="https://help.liferay.com/hc/en-us/articles/360029122451-JSP-Overrides-Using-OSGi-Fragments#using-fragment-host-internal-packages"&gt;here&lt;/a&gt;. &lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2023-08-21T14:20:28Z</dc:date>
  </entry>
  <entry>
    <title>JSP customization error when using 'OSGi fragment' approach</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121988756" />
    <author>
      <name>txapeldot .</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121988756</id>
    <updated>2023-08-21T13:32:26Z</updated>
    <published>2023-08-21T13:32:25Z</published>
    <summary type="html">&lt;p&gt;I'm attempting to customize the UI of the 'Documents &amp;amp; Media'
  Liferay portlet on an 'OSGi Fragment' &lt;a
  href="https://help.liferay.com/hc/en-us/articles/360029122451-JSP-Overrides-Using-OSGi-Fragments"&gt;approach&lt;/a&gt;,
  but a compilation error has arisen in one of the .jsp files I have to customize.&lt;/p&gt;
&lt;p&gt;To tackle the intended task, I've created a Liferay Module Fragment
  project, and I've copied the original
  &lt;em&gt;/document_library/view.jsp&lt;/em&gt; file from Liferay Portal source.
  This file contain an 'include' directive to include the file
  &lt;em&gt;document_library/init.jsp&lt;/em&gt;. This file contains the following code:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;%
	...
	DLAdminDisplayContext dlAdminDisplayContext = dlAdminDisplayContextProvider.getDLAdminDisplayContext(request, response);
	DLAdminManagementToolbarDisplayContext dlAdminManagementToolbarDisplayContext = dlAdminDisplayContextProvider.getDLAdminManagementToolbarDisplayContext(request, response);
	...
%&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this code displays the following error message:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;dlAdminDisplayContextProvider cannot be resolved&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which makes sense as the
  &lt;em&gt;dlAdminDisplayContextProvider&lt;/em&gt; object is not declared in this
  file but within the file &lt;em&gt;/init.jsp&lt;/em&gt; file, included by means of
  a 'include' directive:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;%
	...
	DLAdminDisplayContextProvider dlAdminDisplayContextProvider = dlWebComponentProvider.getDLAdminDisplayContextProvider();
	...
%&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;My question is why this error message occurs if I'm using some .jsp
  files belonging to a functional Liferay portlet. Can anyone explain to
  me why the &lt;em&gt;dlAdminDisplayContextProvider&lt;/em&gt; object is not
  accesible from the &lt;em&gt;document_library/init.jsp&lt;/em&gt; file? Any
  clarification would really be appreciate.&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;</summary>
    <dc:creator>txapeldot .</dc:creator>
    <dc:date>2023-08-21T13:32:25Z</dc:date>
  </entry>
</feed>
