controller:
@RequestMapping(value = "/auto", method = RequestMethod.GET)
public @ResponseBody
AvailabilityStatus getAvailability(@RequestParam String name,Locale locale, HttpSession httpSession) {
logger.info("Welcome auto! the client locale is " + locale.toString());
ResourceBundle myResources =
ResourceBundle.getBundle("messages", locale);
String aha = myResources.getString("label.lastname");
System.out.println( name );
httpSession.setAttribute("accountBean", this );
return AvailabilityStatus.notAvailable(aha);
}
jsp:
<c:if test="${sessionScope.accountBean111 != null}">
<p>aaa</p>
</c:if>
注意在jsp页面中不能有<%@ page session="false" %>