Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: HttpSession returned null object for SPRING_SECURITY_CONTEXT

  1. #11
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Why not start from the tutorial sample application (which does what you want)? Then you have a working configuration to build on.
    Spring - by Pivotal
    twitter @tekul

  2. #12
    Join Date
    Mar 2009
    Location
    PHP
    Posts
    56

    Default

    Quote Originally Posted by TasosCeid View Post
    Firstly, I want to make clear that I am not a spring expert, but it happened to put spring security on my application at this certain time and I saw your post.

    If I were in your position I would try a couple of things.After looking at your xml file I have two suggestions.

    1) The spring security reference (http://static.springsource.org/sprin...form-and-basic) suggests that login page should have any filter intecepted. So try this

    Code:
    <intercept-url pattern='/index.jsp*' filters='none'/>
    .

    2)Try to use different tag lib for example:

    Code:
    <%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
    (But if the taglib was the problem, the header image would not had been displayed)

    For the same reason try to show the error parameter to see what is sent..
    Code:
    <c:out value="${param.error}"/>
    I don't think that any of the above may be the solution, but you don't have anything to lose by trying.
    Hello, I tried everything uv given me above, but it still didnt work. weird though, when i tried to put <c:out value="param.error" /> and <c:out value="params.error" /> what i get are "param.error" and "params.error" printed on the screen, not the value of parameter error which is "true".

    -marckun

  3. #13
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    12

    Default

    I hope that you mean
    Code:
    <c:out value="${param.error}/>
    and not

    Code:
    <c:out value="param.error/>
    If you wrote right the command then the problem is not on spring security but on the jsp and the GET variables.

  4. #14
    Join Date
    Mar 2009
    Location
    PHP
    Posts
    56

    Default

    Quote Originally Posted by TasosCeid View Post
    I hope that you mean
    Code:
    <c:out value="${param.error}/>
    and not

    Code:
    <c:out value="param.error/>
    If you wrote right the command then the problem is not on spring security but on the jsp and the GET variables.

    Hello,

    Thanks for that very sound comment. Hmmm, probably you are most definitely correct.. Have I missed something then? What I did is I placed jstl.jar and standard.jar on my WEB-INF/lib folder (and MyEclipse automatically adds in the build path). and I tried both these URL's on my jsp pages:

    PHP Code:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
    PHP Code:
    <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> 
    That's all i did. I didn't put anything in my web.xml etc..

    (*Sorry if I sound stupid above, this is my first time really setting up a complete project ground-up so I might really be annoying.. )

    -marckun

  5. #15
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    12

    Default

    Quote Originally Posted by marcKun View Post
    Hello, I tried everything uv given me above, but it still didnt work. weird though, when i tried to put <c:out value="param.error" /> and <c:out value="params.error" /> what i get are "param.error" and "params.error" printed on the screen, not the value of parameter error which is "true".

    -marckun
    From your quoted post it seams that you have set right the jstl and standar lib. It prints the the value you want. But, when you write:

    Code:
    <c:out value="param.error" />
    you tell to print the string "param.error". In order to print the value of the variable param.error you have to write ${param.error}. Generally, when you want to use a parameter in jsp you put it in ${....}.

    Did you try this?

  6. #16
    Join Date
    Mar 2009
    Location
    PHP
    Posts
    56

    Default

    Quote Originally Posted by TasosCeid View Post
    From your quoted post it seams that you have set right the jstl and standar lib. It prints the the value you want. But, when you write:

    Code:
    <c:out value="param.error" />
    you tell to print the string "param.error". In order to print the value of the variable param.error you have to write ${param.error}. Generally, when you want to use a parameter in jsp you put it in ${....}.

    Did you try this?
    Yes i tried that one. actually i did not try <c:out value="param.error" />, it was typo error here, what i meant is i tried this <c:out value="${param.error}" />. but still the same thing happens..

    -marckun

  7. #17
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    12

    Default

    What IDE do you use?

  8. #18
    Join Date
    Mar 2009
    Location
    PHP
    Posts
    56

    Default

    Quote Originally Posted by TasosCeid View Post
    What IDE do you use?
    I am using MyEclipse (7.1 i think).

    -marckun

  9. #19
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    12

    Default

    I don't know how in eclipse, but there is a slight possibility that you have to define it to your IDE. Import libraries or something like this, from project settings. It seems that, although you put the jar files, the classes are not included at the build of your application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •