Unable to pass attribute from controller to view
- by MDS
I'm using Spring MVC 3 for a web app. In the app a URI template is supposed to be handled by a controller method, which then passes an attribute to a view. Currently, the controller does handle the request, and it even forwards to the correct view. However, it does NOT pass the attribute to the view. Below are the URI template, controller method and relevent jsp tags. Anyone see what is wrong?
URI:
/home/{status}
Controller:
@RequestMapping("/home")
@Controller
public class HomeController {
...
...
@RequestMapping(value="/{status}")
public String homeStatusView(@PathVariable("status") String status, ModelMap model) {
model.addAttribute("status", status);
return "home";
}
}
JSP:
...
<c:if test="${not empty status}">
<span class="status">Your status is available...</span>
</c:if>
...