Problem sending bean from servlet to jsp
I have a html page that submits imformation from a form to a servlet. The servlet then creates a bean and uses the sendRedirect to send it to a jsp page. I read somewhere that tomcat sometimes loses the session so I added the following code:
<% if(session.isNew()) { %>
Session is new
<% } %>
but the message never appeared so I am guessing that is not the problem. Here is the code that I use in the servlet:
guestBean = new GuestBean();
guestBean.setName("Chris");
HttpSession session = request.getSession(true);
session.putValue("guestBean", guestBean);
response.sendRedirect("/cbweb/GuestThank.jsp");
and here is the code I have in the jsp to display the name:
<jsp:useBean id="guestBean" class="Guest.GuestBean" scope="session" />
<%= guestBean.getName() %>
All I get is "null", I even considered there might be something wrong with the bean so I coded the following to test the bean:
<jsp:setProperty name="guestBean" property="name" value="Test name" />
and the name came out ok, so I am pretty sure the problem is that the bean isn't getting passed from the servlet to the jsp. If anyone has any suggestions I am willing to try anything.
Thanks

