?? bsbrowser.jsp
字號:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="javax.naming.Context"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import="bsejb.*"%>
<%@ page import="javax.rmi.PortableRemoteObject"%>
<%@ page import="java.util.Properties"%>
<html>
<head>
<title>
BSBrowser
</title>
</head>
<body>
<h1>
<%="This is BS EJB example!"%><br>
<%
try{
//為初始化上下文獲得一個系統屬性對象
Properties pro=System.getProperties();
//初始化并得到一個上下文
Context ctx = new InitialContext(pro);
//查詢jndi名,通過強制轉型得到Home接口
theServerHome home = (theServerHome)javax.rmi.PortableRemoteObject.narrow(ctx.lookup("theServer"), theServer.class);
//得到遠程接口的引用
theServer theServer=home.create();
out.write(theServer.BServer());
}
catch(Exception e)
{
out.println(e.toString());
}
%>
<%="This is Browser speaking."%><br>
<%="The example is over!"%><br>
</h1>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -