Here is my controller code..
Code:
@RequestMapping("/login")
public ModelAndView login() {
LOGGER.info("Inside LOGIN");
Health health = null;
health = healthLogic.getHealthPasskey();
return new ModelAndView("/admin/login", "health",health);
Here is the code for getHealthPasskey() in HealthLogic Class
Code:
public Health getHealthPasskey(){
Health health = new Health();
health.setPasskey("abcd");
return health;
}
Here is the HTML
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" VALUE="${health.passkey}" />
<input type="submit" value="Login" name="submit" />
</div>
</div>
</fieldset>
</div>
</form>
</body>
</html>
When I am trying to get the value of health.passkey by request.getParameter("key"), it is still printing "${health.passkey}" ....
Any idea...