What is the equivalent "servlet code" for this:
<jsp:useBean id="user" class="beans.UserBean" scope="session"/>
<jsp:setProperty name="user" property="*"/>
Tomcat translates this to:
beans.UserBean user = null;
synchronized (session) {
user = (beans.UserBean) _jspx_page_context.getAttribute("user", PageContext.SESSION_SCOPE);
if (user == null) {
user = new beans.UserBean();
_jspx_page_context.setAttribute("user", user, PageContext.SESSION_SCOPE);
}
}
org.apache.jasper.runtime.JspRuntimeLibrary.introspect(_jspx_page_context.findAttribute("user"), request);
Is there no other way of easily doing this?