javabean代码
jsp代码
package test;
public class HelloWorld
{
public String name="hello world javabean";
public String getHi(){
return name;
}
}
jsp代码
<%@ page contentType="text/html;charset=GB2312"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>hello world javabean</title>
</head>
<body>
<jsp:useBean id="hello" scope="application" class="test.HelloWorld" />
<%= hello.getHi() %>
</body>
</html>