Guest_imported
New member
- Jan 1, 1970
- 0
Hi all
i have the foloowing jsp and bean files.
when i use
<jsp:useBean id="mybean" class="beans.StringBean" />
it works fine,because my bean it is in beans directory under
classes directory.
but when i use
<%@ page import="beans.*" %>
<jsp:useBean id="myBean" class="StringBean" />
i got an error message that says casnnot load stringBean class.
Here are both files
package beans;
public class StringBean
{
private String message="No message specified ";
public void setMessage(String message)
{
this.message=message;
}
public String getMessage()
{
return this.message;
}
}
//============================
jsp file :
<jsp:useBean id="MyBean" class="beans.StringBean" />
<jsp:setProperty name="MyBean" property="message" value="hello world" />
<b><jsp:getProperty name="MyBean" property="message" /></b>
i have the foloowing jsp and bean files.
when i use
<jsp:useBean id="mybean" class="beans.StringBean" />
it works fine,because my bean it is in beans directory under
classes directory.
but when i use
<%@ page import="beans.*" %>
<jsp:useBean id="myBean" class="StringBean" />
i got an error message that says casnnot load stringBean class.
Here are both files
package beans;
public class StringBean
{
private String message="No message specified ";
public void setMessage(String message)
{
this.message=message;
}
public String getMessage()
{
return this.message;
}
}
//============================
jsp file :
<jsp:useBean id="MyBean" class="beans.StringBean" />
<jsp:setProperty name="MyBean" property="message" value="hello world" />
<b><jsp:getProperty name="MyBean" property="message" /></b>