Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import package problems?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi all
i have the foloowing jsp and bean files.
when i use
<jsp:useBean id=&quot;mybean&quot; class=&quot;beans.StringBean&quot; />
it works fine,because my bean it is in beans directory under
classes directory.
but when i use
<%@ page import=&quot;beans.*&quot; %>
<jsp:useBean id=&quot;myBean&quot; class=&quot;StringBean&quot; />
i got an error message that says casnnot load stringBean class.
Here are both files
package beans;

public class StringBean
{
private String message=&quot;No message specified &quot;;

public void setMessage(String message)
{
this.message=message;

}
public String getMessage()
{
return this.message;

}
}

//============================
jsp file :
<jsp:useBean id=&quot;MyBean&quot; class=&quot;beans.StringBean&quot; />
<jsp:setProperty name=&quot;MyBean&quot; property=&quot;message&quot; value=&quot;hello world&quot; />
<b><jsp:getProperty name=&quot;MyBean&quot; property=&quot;message&quot; /></b>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top