IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope:Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  Java technology  >

Revisiting Java technology on the client

Make use of the full spectrum of the Java platform to build compelling systems

developerWorks


Listing 2. Using a servlet to return a Java object
        
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
{
  // code here to set content type and other information
  ObjectOutputStream ObjectOutput = new ObjectOutputStream(resp.getOutputStream);
  ObjectOutput.writeObject(GetShippingInformation(req.getParameter("ShippingPostalCode")));
    // GetShippingInformation calculates shipping and handling, and all tax rates for a given location
    // within the United States or Canada.  This is returned as a ShippingInformation object.
  // code here to clean up and handle exceptions.
}
      

Return to article

    关于 IBM 隐私条约 联系 IBM 使用条款