I have a webapp using sitemesh3, here is the sitemesh3.xml:
<sitemesh>
<mapping>
<path>/mystuff/*</path>
<decorator>/WEB-INF/decorators/en-layouts/mystuff.jsp</decorator>
<decorator>/WEB-INF/decorators/en-layouts/header.jsp</decorator>
</mapping>
<mapping>
<path>/*</path>
<decorator>/WEB-INF/decorators/en-layouts/page.jsp</decorator>
<decorator>/WEB-INF/decorators/en-layouts/header.jsp</decorator>
</mapping>
<mapping path="/js/*" exclude="true"/>
<mapping path="/css/*" exclude="true"/>
<mapping path="/images/*" exclude="true"/>
<mapping path="/bootstrap/*" exclude="true"/>
</sitemesh>
I'm using spring security with this webapp. in the header.jsp, there is some code:
<%
Authentication a = SecurityContextHolder.getContext().getAuthentication();
UserAccount u = null;
if(a != null && a.getPrincipal() != null && a.getPrincipal() instanceof UserAccount){
u = (UserAccount)a.getPrincipal();
request.setAttribute("account", u);
}
%>
and some html:
<p class="navbar-text pull-right">Logged in as <a href="#">${account.nickname }</a></p>
I don't know if my question is clear for you, could you anybody please give me some tips help me out?
thank you in advance.
Regards,
Jason