Okay, here we go. I am trying to learn how to use javabeans properly and so I've created a small bean which just writes text to the screen. I keep getting the error:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 6 in the generated java file
Only a type can be imported. mybeans.processFormBean resolves to a package
and can't figure out what to do. Here is my code:
nob.jsp
<%@ page import="mybeans.processFormBean" %>
<jsp:useBean id="example" class="beans.example" />
<form name="example" action="nob.jsp" method="get">
<input type="text" name="value">
<input type="submit" value="submit">
</form>
<jsp:getProperty name="value" property="value" />
<%= example.getValue() %>
example.java (but I have obviously compiled it)
package beans;
import java.sql.*;
public class example
{
private String value = "cheese";
public void setValue(String value) { this.value = value; }
public String getValue() { return value; }
public void test()
{
System.out.println("The bean worked");
}
}
I have checked the package names and the folders they are in etc, here is my classpath: .;C:\Program Files\Java\jre1.6.0_04\lib\ext\QTJava.zip
Thanks for your help!