Hi all,
I have a little problem that I'd like to resolve just for my own gratification.
A have a simple class as follows:
package beans;
public class hellobean
{
private
String name = "world";
public void setName (String name)
{
this.name = name;
}
public String getName()
{
return name;
}
}
As you can see it's a no big deal class. When I call the class with the following
JSP page everything works just fine.
<html>
<jsp:useBean id="hello" class="beans.hellobean" />
<jsp:setProperty name="hello" property="name" value="dave" />
<jsp:getProperty name="hello" property="name" />
</html>
But the following page:
<%@ page language="java" import="beans.hellobean"%>
<bean name="hello" type="hellobean" introspect="yes" create="yes" scope="request"></bean>
<html>
<%=hello.getName()%> //line 5
</html>
gives me a complie error on line 5, "hello cannot be resolved", which to me implies that the bean has not been created. Yet if I remove line 5 the page compiles without any issues. Can anyone see something that I don't see? This is not critical... I just hate it when something doesn't work and I can't see why.
Thanks
Dave B.