Why main menu disappear from page in Crowd plugin?
Asked by Alexei Uvarov:

After clicking on my custom menu item I see this screen without main menu and messages:

![](http://dalmat.in/sc.jpg)

As you can see therre is no menu. Why? My atlassian-plugin.xml is:

```
&lt;atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"&gt;    &lt;plugin-info&gt;        &lt;description&gt;${project.description}&lt;/description&gt;        &lt;version&gt;${project.version}&lt;/version&gt;        &lt;vendor name="${project.organization.name}" url="${project.organization.url}" /&gt;    &lt;/plugin-info&gt;        &lt;component-import key="webResourceManager" interface="com.atlassian.plugin.webresource.WebResourceManager" /&gt;        &lt;!-- Header Items --&gt;    &lt;web-item key="tokens" name="Tokens Management" section="topnav" weight="10"&gt;        &lt;label key="Token management"/&gt;        &lt;link linkId="topnavTokensManagement"&gt;/console/secure/plugins/cargosoft/managetokens.action&lt;/link&gt;    &lt;/web-item&gt;        &lt;!-- Application Components - Left-Hand Side --&gt;    &lt;web-section key="tokensnav" name="Tokens Navigation" location="left" weight="90"&gt;        &lt;condition class="com.atlassian.crowd.plugin.web.conditions.SitemeshPropertiesCondition"&gt;            &lt;param name="propertyName"&gt;meta.section&lt;/param&gt;            &lt;param name="propertyValues"&gt;tokens&lt;/param&gt;        &lt;/condition&gt;    &lt;/web-section&gt;        &lt;xwork name="Tokens Action" key="managetokens"&gt;        &lt;package name="managetokens" extends="default" namespace="/console/secure/plugins/cargosoft"&gt;        	&lt;default-interceptor-ref name="defaultStack"/&gt;        	            &lt;action name="managetokens" class="com.cargosoft.crowd.plugin.TokensAction"&gt;                &lt;result name="success" type="freemarker"&gt;/templates/view.ftl&lt;/result&gt;                &lt;result name="error" type="freemarker"&gt;/templates/view.ftl&lt;/result&gt;            &lt;/action&gt;        &lt;/package&gt;    &lt;/xwork&gt;        &lt;resource type="i18n" name="i18n" location="messages.i18n" /&gt;    &lt;/atlassian-plugin&gt;
```

and view.ftl is:

```
&lt;html&gt;  &lt;head&gt;    &lt;title&gt;Hello&lt;/title&gt;   	&lt;meta name="decorator" content="atl.admin" /&gt;  &lt;/head&gt;  &lt;body&gt;    Hello ${action.firstName} ${action.lastName}  &lt;/body&gt;&lt;/html&gt;
```

How can I resolve this problem? and return main menu like at this picture???

![](http://dalmat.in/scr.jpg)


Answers:
author: daviderickson
body: I was able to get this to work by adding the following to my pom.xml:

```
&lt;dependency&gt;            &lt;groupId&gt;com.atlassian.crowd&lt;/groupId&gt;            &lt;artifactId&gt;crowd-server&lt;/artifactId&gt;            &lt;version&gt;2.3.4&lt;/version&gt;            &lt;scope&gt;provided&lt;/scope&gt;        &lt;/dependency&gt;
```

And then making my Action extend com.atlassian.crowd.console.action.BaseAction and set my view.ftl to look like:

```
&lt;html&gt;  &lt;head&gt;    &lt;title&gt;&lt;/title&gt;    &lt;meta name="section" content="administration" /&gt;    &lt;meta name="pagename" content="systeminfo" /&gt;  &lt;/head&gt;  &lt;body&gt;    &lt;div class="crowdForm"&gt;            &lt;div class="formTitle"&gt;            &lt;h3&gt;Title&lt;/h3&gt;        &lt;/div&gt;           &lt;/div&gt;      Hello ${action.firstName} ${action.lastName}  &lt;/body&gt;&lt;/html&gt;
```

Note I ripped some data from the systeminfo page, replace it with whatever you would normally use. I also changed the package I extended in atlassian-plugin.xml from default to admin to pick up on any customizations.

I still would like to know if there is any way to use JSP, it seems like there would have to be a special mechanism in place that takes the file out of the JAR and makes it appear like its on the file path for the webapp and I'm not sure if there is any existing support for that, although something of this nature is working for this FTL we are using.

I also couldn't manage to get the @ww.component tag to import a template I've created, I think it too is looking on the file path and not inside the classpath, which I also find weird considering the main template for the action works fine. I also couldn't get it to import the existing JSP templates, I get a NPE when it tries to retrieve the JSP PageContext object, I'm guessing JSP templates aren't intended to be rendered inside Freemarker templates?

Edit: Turns out you don't want to put Freemarker tags into your answers here as it will actually render their result...


author: NielsJ
body: I haven't developed for Crowd yet, but in other Atlassian Tools you need to call the right decorators for that. Just have a look at some built-in actions.

comments: author: Alexei Uvarov
body: I've found in folder webapp/WEB-IF/decorators.xml this code:

```
&lt;decorators&gt;    &lt;decorator name="error" page="/console/decorator/simple.jsp"&gt;        &lt;pattern&gt;/console/error/*&lt;/pattern&gt;    &lt;/decorator&gt;    &lt;decorator name="license" page="/console/decorator/simple.jsp"&gt;        &lt;pattern&gt;/console/license*&lt;/pattern&gt;    &lt;/decorator&gt;    &lt;decorator name="none" page="/console/decorator/none.jsp"&gt;        &lt;pattern&gt;/console/plugin/secure/saml/*&lt;/pattern&gt;        &lt;pattern&gt;/console/secure/pickers/*&lt;/pattern&gt;    &lt;/decorator&gt;    &lt;decorator name="main" page="/console/decorator/default.jsp"&gt;        &lt;pattern&gt;/*&lt;/pattern&gt;    &lt;/decorator&gt;    &lt;!-- cross-product decorators provided for plugins --&gt;    &lt;decorator name="atl.general" page="default.jsp"/&gt;    &lt;decorator name="atl.admin" page="default.jsp"/&gt;    &lt;decorator name="atl.userprofile" page="default.jsp"/&gt;    &lt;decorator name="atl.popup" page="popup.jsp"/&gt;&lt;/decorators&gt;
```

In my template I use meta-tag \<meta name="decorator" content="main" /\> but main menu doesn't appear. What is a problem it can be??? Have I missed something? And as you can see on the picture all messages i18n are disappear too. May be it is a probleme of crowd?