当前位置: 技术问答>java相关
综合性、难度较大的问题:如何在servlet中,用javascript增加、更新Table记录?
来源: 互联网 发布时间:2015-07-01
本文导语: 如何在servlet中,用javascript增加、更新Table记录? 我写了段程序,代码如下: /* $Id: servletTest.java,v 1.2.4.1 2000/07/05 17:45:01 nacho Exp $ */ import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.se...
如何在servlet中,用javascript增加、更新Table记录?
我写了段程序,代码如下:
/* $Id: servletTest.java,v 1.2.4.1 2000/07/05 17:45:01 nacho Exp $
*/
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
import java.rmi.server.UnicastRemoteObject;
import jmonitor.agent.*;
public class servletTest extends HttpServlet {
private DataSheet cpu = null;
private Vector Result = null;
private PrintWriter out = null;
private StringTokenizer st = null;
// "JmonitorAgent" is the identifier that we'll use to refer
// to the remote object that implements the "Hello"
// interface
private JmonitorAgent agent = null;
public void init() {
try
{
agent = (JmonitorAgent)Naming.lookup("//" + "192.168.4.148" + "/JmonitorAgent");
//getCodeBase().getHost() + "/HelloServer");
} catch (Exception e) {
System.out.println("JmonitorAgent exception: " + e.getMessage());
e.printStackTrace();
}
}
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html; charset=GB2312");
out = response.getWriter();
//Print the HTML header
out.println("");
out.println("");
out.println(" ServletTest");
out.println("");
out.println("");
try
{
cpu = agent.getCPUInfo();
Result = cpu.getResult();
} catch (Exception e) {
System.out.println("JmonitorAgent exception: " + e.getMessage());
e.printStackTrace();
}
//»³ö±íÍ·
out.println("");
for(int i = 0; i
我写了段程序,代码如下:
/* $Id: servletTest.java,v 1.2.4.1 2000/07/05 17:45:01 nacho Exp $
*/
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
import java.rmi.server.UnicastRemoteObject;
import jmonitor.agent.*;
public class servletTest extends HttpServlet {
private DataSheet cpu = null;
private Vector Result = null;
private PrintWriter out = null;
private StringTokenizer st = null;
// "JmonitorAgent" is the identifier that we'll use to refer
// to the remote object that implements the "Hello"
// interface
private JmonitorAgent agent = null;
public void init() {
try
{
agent = (JmonitorAgent)Naming.lookup("//" + "192.168.4.148" + "/JmonitorAgent");
//getCodeBase().getHost() + "/HelloServer");
} catch (Exception e) {
System.out.println("JmonitorAgent exception: " + e.getMessage());
e.printStackTrace();
}
}
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html; charset=GB2312");
out = response.getWriter();
//Print the HTML header
out.println("");
out.println("");
out.println(" ServletTest");
out.println("");
out.println("");
try
{
cpu = agent.getCPUInfo();
Result = cpu.getResult();
} catch (Exception e) {
System.out.println("JmonitorAgent exception: " + e.getMessage());
e.printStackTrace();
}
//»³ö±íÍ·
out.println("");
for(int i = 0; i
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!