compassman
12-24-2006, 10:22 PM
I have been trying to learn how to add javabeans to my JSP website. I have some, probably, stupid questions. Any help will be appreciated.
Where, exactly, does one put the javabeans? Is it under WEB-INF in itsown folder? Can it be under a common folder?
When calling a bean, is the syntax [foldername].[javabeancompiledclass] or is the header something else?
I have an example bean I have tried to compile without success. Can anyone tell me what is wrong?
* mybeans.java <- this is not part of the file
package mybeans;
public class lineBean
{
public String stars(int x)
{
String text="<br>";
for (int i=0;i<x ; i++)
{
text=text+"*";
}
return text+"<br>";
}
public String doubleLine(int x)
{
String text="<br>";
for (int i=0;i<x ; i++)
{
text=text+"=";
}
return text+"<br>";
}
}
I am using javac to compile it. Is this the right tool or is something more appropriate?
Thanks for any help I can get.
Where, exactly, does one put the javabeans? Is it under WEB-INF in itsown folder? Can it be under a common folder?
When calling a bean, is the syntax [foldername].[javabeancompiledclass] or is the header something else?
I have an example bean I have tried to compile without success. Can anyone tell me what is wrong?
* mybeans.java <- this is not part of the file
package mybeans;
public class lineBean
{
public String stars(int x)
{
String text="<br>";
for (int i=0;i<x ; i++)
{
text=text+"*";
}
return text+"<br>";
}
public String doubleLine(int x)
{
String text="<br>";
for (int i=0;i<x ; i++)
{
text=text+"=";
}
return text+"<br>";
}
}
I am using javac to compile it. Is this the right tool or is something more appropriate?
Thanks for any help I can get.