Hi Bert,

Thanks for the response. I've managed to fix the problem by adding
some logging to my application and looking to see what came out using
the admin panel. The problem was something in my code. The object I
was placing into the request was in fact null! Silly error.

Thanks for you help.

On Dec 26, 8:44 am, Bert Peters <[email protected]> wrote:
> What you could do, is check the logs, in your admin panel. They show
> which error is generated, and at which line. I had a similar problem
> once, and that helped.
>
> On Dec 24, 9:46 pm, "[email protected]"
>
> <[email protected]> wrote:
> > Hi,
>
> > I've created a GAE web application using Spring 3.0 and Spring
> > Security 2.0.5.
>
> > After a little heartache and help from reading the posts on the forum,
> > I managed to get it all working locally, with users able to register,
> > validate their accounts via email and login in securely.
>
> > When a user logs in, I wanted to make their details available across
> > the site. I did this by creating an Interceptor, responsible for
> > pulling the prinicipal from the Spring Security Authentication class
> > (retrieved from the SecurityContextHolder) and then placing the object
> > in the HttpServletRequest object. Below is a snippet of code from the
> > interceptor.
>
> >      public void postHandle(
> >                         HttpServletRequest request,
> >                         HttpServletResponse response,
> >                         Object handler,
> >                         ModelAndView modelAndView) {
>
> >                 try {
> >                         Member member = securityContext.getMember();
> >                         request.setAttribute("user", member);
>
> >                         log.info("injecting user into request");
>
> >                 } catch(SecurityRuntimeException e) {
> >                         // do nothing - will be thrown if no user is logged 
> > in
> >                 }
> >         }
>
> > The user's information is wrapped in a 'Member' object, with the
> > securityContext responsible for retrieving it from the
> > SecurityContextHolder.
>
> > Locally, on the GAE development environment, everything works fine!
> > The interceptor correctly places the principal in the request and my
> > JSP's can readily access it. However, when I deploy the application to
> > the app engine, it does not appear to work. The logs have not provided
> > any clue as to why the request does not appear to have the principal
> > in it.
>
> > Is there any reason why the interceptor would not work on the app
> > engine? Or, is it ill-advised to add objects into the
> > HttpServletRequest?
>
> > I'm tearing my hair out with why it's not working, and it's the only
> > thing within my application that isn't! So any help or advice offered
> > is much appreciated. I'm hoping to have my code up in the Google Code
> > repository so if anyone wants to have a look, they're more than
> > welcome.
>
> > Thanks!
> > Sully

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.


Reply via email to