Hello All,
I am having difficulties with populating a bean referenced within a JSP.
Basically I am trying to set a property of a bean from the input of a simple
HTML form. The following comes from 'hellobean.jsp'
<%@ import = "HelloBean" %>
<BEAN NAME="hello" TYPE="HelloBean"
INTROSPECT="yes" CREATE="yes" SCOPE="request">
</BEAN>
<HTML>
<HEAD><TITLE>Hello</TITLE></HEAD>
<BODY>
<H1>
Hello, <%= hello.getName() %>
</H1>
</BODY>
</HTML>
Here is the source code for the bean;
public class HelloBean {
private String name = "World";
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
This JSP page comes from an example from a book and conforms to 0.9x
release. I am using JavaWebServer 2.0, JSWDK 1.0.1 ( which is based on
the 1.0 release of JSP I believe ) and JDK 1.2.2. I can't find any reference
to
the <bean>...</bean> tags and I am wondering if they are deprecated from
an earlier version of JSP.
Whenever I enter the URL "localhost:8080/hellobean?name=fred" the server
cannot successfully create the servlet based on the JSP file. I have placed
the bean source file in the 'classes' directory of the webserver.
Any ideas? Example JSP would be much appreciated.
Thanks and regards,
AT
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html