开发者

sitemesh + spring security: show logged in user in main decorator page!

I want to show logged in user in main decorator page. i use :

<decorator:usePage id="myPage"/>
Logged in as:<%= myPage.ge开发者_如何学CtRequest().getUserPrincipal().getName()%>
<decorator:body/>

but not work!


You need to place the SiteMesh filter-mapping below the Spring Security filter mapping.

See: Spring security tags in sitemesh decorator


Haven't worked with SiteMesh for quite some time, but why aren't you using the implicit request object instead (I assume your pages are written in JSP, right?)

<%= request.getUserPrincipal().getName() %>

And what's exactly not working? Is an exception getting thrown?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜