JSP代码<html><title>MY FIRST JSP</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<jsp:useBean id="asd" scope="erquest" class="hel.helloworld"/>
<%@ page language="java"%><% ads.getString();%>
</body>
</html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<jsp:useBean id="asd" scope="erquest" class="hel.helloworld"/>
<%@ page language="java"%><% ads.getString();%>
</body>
</html>
变成:
out.print(asd.getString());
<html>
<head>
<title>MY FIRST JSP</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<jsp:useBean id="asd" scope="request" class="hel.helloworld"/>
<%=ads.getString()%>
</body>
</html>
package helloworld;import java.io.*;
public class helloworld
{
public String getString()
{
return "helloword";
}
}JSP代码改成<html><title>MY FIRST JSP</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<jsp:useBean id="asd" scope="erquest" class="hel.helloworld"/>
<%@ page language="java"%><%=ads.getString()%>
</body>
</html>