F
focode
hello i am learning JSP , ia m using tomcat apache web server , i am
trying a javabean example , but i am confused where to place the
compiled class file , i am putting the jsp and the bean class in
webapps folder . the example is listed below
<%@ page import="beans.MessageBean" %>
<HTML>
<HEAD>
<TITLE>Using a JavaBean</TITLE>
</HEAD>
<BODY>
<h1>Using a JavaBean</h1>
<% MessageBean m = new MessageBean(); %>
The message is: <%= m.msg() %>
</BODY>
</HTML>
and the bean is as follows...
package beans;
public class MessageBean
{
public MessageBean()
{
}
public String msg()
{
return "Hello from JSP!";
}
}
trying a javabean example , but i am confused where to place the
compiled class file , i am putting the jsp and the bean class in
webapps folder . the example is listed below
<%@ page import="beans.MessageBean" %>
<HTML>
<HEAD>
<TITLE>Using a JavaBean</TITLE>
</HEAD>
<BODY>
<h1>Using a JavaBean</h1>
<% MessageBean m = new MessageBean(); %>
The message is: <%= m.msg() %>
</BODY>
</HTML>
and the bean is as follows...
package beans;
public class MessageBean
{
public MessageBean()
{
}
public String msg()
{
return "Hello from JSP!";
}
}