Hi,
I am new to spring and trying to pass the ModelAndView object from the controller to the JSP page.
Here is my controller code.
Here is my HTML/JSP codeCode:@RequestMapping("/login") public ModelAndView login() { LOGGER.info("Inside LOGIN"); Health health = null; health.setPasskey("abcd"); return new ModelAndView("/admin/login", "health",health); / }
on the mediareport page...when I am trying to get the value of variable ${health.getPasskey} via request.getParameter("key"); it displays ${passkey} instead of "abcd". Please help me regarding this....HTML Code:<html> <head> <title> Health Page Login </title> </head> <body style="overflow: auto; padding:10px;"> <div class="sectionheader"> <div class="sectionheader-left"><h1>Health Page Login</h1></div> </div> <form id="command" action="mediareport" method="post"> <div class="formlayout"> <fieldset title="Search" > <div class="formelements"> <div class="floatleft" style="clear:both;"> <label style="width:200px;">Please enter password:</label> <input type="Password" name="Password" size="10"></input> <INPUT TYPE="HIDDEN" NAME="key" <c:out VALUE="${health.getPasskey}" /> </INPUT> <input type="submit" value="Login" name="submit" /> </div> </div> </fieldset> </div> </form> </body> </html>


Reply With Quote
