开发者

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

开发者 https://www.devze.com 2023-01-11 19:44 出处:网络
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()%>

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

精彩评论

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