<?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>Liferay 7 MVC Portlet only showing view.jsp for Administrator</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119039788" />
  <subtitle>Liferay 7 MVC Portlet only showing view.jsp for Administrator</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119039788</id>
  <updated>2026-04-06T01:52:23Z</updated>
  <dc:date>2026-04-06T01:52:23Z</dc:date>
  <entry>
    <title>RE: Liferay 7 MVC Portlet only showing view.jsp for Administrator</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119146814" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119146814</id>
    <updated>2020-05-13T10:49:05Z</updated>
    <published>2020-05-13T10:49:05Z</published>
    <summary type="html">If I had to bet, I would put my money on  &amp;#34;com.liferay.portlet.add-default-resource=true&amp;#34;.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-05-13T10:49:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 MVC Portlet only showing view.jsp for Administrator</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119146458" />
    <author>
      <name>Robert Schrepfer</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119146458</id>
    <updated>2020-05-13T09:55:02Z</updated>
    <published>2020-05-13T09:55:02Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I have fixed the issue by replacing the annotation property as follows. I don't know which exact setting made it fail for me, nor do I care to be honest, as this has taken way too much time for such a simple problem. But for anyone who stumbles upon this issue:&lt;br&gt;&lt;pre&gt;&lt;code&gt;@Component(immediate = true,
property = {
      "com.liferay.portlet.add-default-resource=true",
"com.liferay.portlet.display-category=category.hidden",
"com.liferay.portlet.icon=/icons/site_admin.png",
"com.liferay.portlet.preferences-owned-by-group=true",
"com.liferay.portlet.private-request-attributes=false",
"com.liferay.portlet.private-session-attributes=false",
"com.liferay.portlet.render-weight=50",
"com.liferay.portlet.use-default-template=true",
"javax.portlet.display-name=My Portlet",
"javax.portlet.expiration-cache=0",
"javax.portlet.init-param.template-path=/META-INF/resources/",
"javax.portlet.init-param.view-template=/html/view.jsp",
"javax.portlet.name=my-portlet",
"javax.portlet.resource-bundle=content.Language",
"javax.portlet.security-role-ref=administrator,user,guest"
    },
service = Portlet.class
)&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Note: it was NOT the&amp;nbsp;&lt;strong&gt; &lt;/strong&gt;"javax.portlet.security-role-ref=administrator,user,guest" setting as I have tried changing it the old annotation and it did not have an impact.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Robert Schrepfer</dc:creator>
    <dc:date>2020-05-13T09:55:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 MVC Portlet only showing view.jsp for Administrator</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119055123" />
    <author>
      <name>Robert Schrepfer</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119055123</id>
    <updated>2020-04-28T07:57:56Z</updated>
    <published>2020-04-28T07:57:56Z</published>
    <summary type="html">Well at least it seems like this is not a trivial problem, so I am not completely stupid &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;</summary>
    <dc:creator>Robert Schrepfer</dc:creator>
    <dc:date>2020-04-28T07:57:56Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7 MVC Portlet only showing view.jsp for Administrator</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119039787" />
    <author>
      <name>Robert Schrepfer</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119039787</id>
    <updated>2020-04-25T13:33:55Z</updated>
    <published>2020-04-25T13:33:55Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello everyone,&lt;br&gt;I am desperate. I feel like I have tried everything and the answer to the problem is probably 1 line of code.I have created an osgi-module mvc portlet with a control panel entry.When I deploy the module everything works as expected. The module shows in control panel, the view.jsp gets rendered with my content...&lt;br&gt;But only when I have given my user the administrator role. Any other role and the control panel entry shows, but when I click on it the content is not rendered.I tried removing&amp;nbsp;&amp;nbsp;"javax.portlet.security-role-ref=user,guest,power-user,administrator", no change. I tried adding other roles, no change. I tried giving other roles view permissions in control panel via website (Control Panel -&amp;gt; User -&amp;gt;&amp;nbsp;Roles), no change.&lt;br&gt;And the worst part? I dont even want it to be seen by these roles, I handle control panel viewing separately anyways so my requirement is to just show the content always when anyone clicks on the panel entry for "my portlet".&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;@Component(immediate = true, property = {
   "panel.app.order:Integer=10000",
   "panel.category.key="+PanelCategoryKeys.SITE_ADMINISTRATION_MEMBERS
,
service = PanelApp.class
)&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;@Component(immediate = true,&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;property = {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.init-param.view-template=/html/view.jsp",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.init-param.config-template=/html/myportlet/config.jsp",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.mime-type=text/html",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.portlet-mode=text/html;view",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.expiration-cache=0",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.security-role-ref=user,guest,power-user,administrator",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"com.liferay.portlet.icon=/icon.png",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"com.liferay.portlet.instanceable=false",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.display-name=My Portlet",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"javax.portlet.name=my-portlet",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"com.liferay.portlet.preferences-owned-by-group=true",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"com.liferay.portlet.preferences-unique-per-layout=false",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"com.liferay.portlet.scopeable=true",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"com.liferay.portlet.private-request-attributes=false",&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"com.liferay.portlet.private-session-attributes=false"&lt;br&gt;},&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;service = Portlet.class&lt;br&gt;)&lt;br&gt;public class MyPortlet extends MVCPortlet {&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Robert Schrepfer</dc:creator>
    <dc:date>2020-04-25T13:33:55Z</dc:date>
  </entry>
</feed>
