I am developing an application where I am using a servlet as a controller. From the servlet I forward to a jsp page. But I would like to pass a few variables from the servlet to the jsp. In the servlet, I appended the variables to the request by doing the following: request.setAttribute("var1", var1) then use the dispatcher to forward the page to the jsp. But how can I access the variables (i.e. var1) in the JSP?
Simple, Lets say you set a String in the servlet, in your jsp you place the code: String fromServlet = (String)getAttribute("keyNameUsedInServlet); You can set any object in the attributes and as long as you use of reference of the right type and cast it properly, it is now available in your JSP page. ------------------ Hope This Helps Carl Trusiak, SCJP2