I'm trying to create a bean in my servlet, store it in a request variable,
then have a JSP page access it by using request.getAttribute. However, it
doesn't seem to work. Can anyone tell me why. I just want to pass a bean
from a servlet to a JSP.

Here's the bulk of the code...

In the servlet I'm stating -
GreetingBean msg = new GreetingBean();
msg.setMsg("Hello World!");
req.setAttribute("message",msg);

Then in the JSP page -
GreetingBean msg = (GreetingBean)request.getAttribute("message");
msg.getMsge();

Problem is msg.getMsg() is ALWAYS returning NULL. WHy would this be happening?

I've also tried in the JSP page:
<jsp:useBean scope="request" id="greeting" class="GreetingBean">
<%=greeting.getMsg()%>

This also returns NULL, i.e. resets the value I put in the bean on the previous
page (servlet) which then forwards to the JSP page.

Any ideas or tips?

Thanks again,
Dylan