0

I am having a problem getting some of my model attributes to display.

Here is part of the data I am setting

            spd.email = "[email protected]";
    spd.birthMonth = "11";
    spd.birthDay = "12";
    spd.birthYear = "2013";

Here is where I add things to the view. sessionID & email are simple Strings. spd is defined above;

           ModelAndView mav = new ModelAndView("signup");
             mav.addObject("sessionID",sessionID);
             mav.addObject("email", email);              
             mav.addObject("SignupPageData",spd); 

Here are the lines in the jsp

            <p>email from spd  ${signuppagedata.email}  </p>
                <p>email ${email} ></p>
                  <p>sessionID ${sessionID} ></p>

both of the simple Strings email & sessionID print fine. signuppagedata.email does not display. What am I doing incorrectly ?

1 Answer 1

1

I think the model attribute names are case sensitive. Change this

mav.addObject("SignupPageData",spd); 

to

mav.addObject("signupPageData",spd); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.