Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
sitemesh 3 can't get session information when decorating the root context path of my webapp
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
sirj  
View profile  
 More options Jul 3 2012, 1:59 am
From: sirj <wang...@gmail.com>
Date: Mon, 2 Jul 2012 22:59:55 -0700 (PDT)
Local: Tues, Jul 3 2012 1:59 am
Subject: sitemesh 3 can't get session information when decorating the root context path of my webapp

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>

for above JSP code, all pages except http://www.mysite.com/ work very well.
when accessing the context root url (/) of the app, variable a is null, i
can't get it. when accessing any other pages like
http://www.mysite.com/offer/39 or http://www.mysite/mystuff/, all pages are
good.

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe Walnes  
View profile  
 More options Jul 5 2012, 8:08 pm
From: Joe Walnes <j...@walnes.com>
Date: Thu, 5 Jul 2012 19:08:19 -0500
Local: Thurs, Jul 5 2012 8:08 pm
Subject: Re: sitemesh 3 can't get session information when decorating the root context path of my webapp

Hi Jason

I suspect this is an issue with how the security Filter is configured. If
you post your web.xml it may give us more insight.

thanks
-Joe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »