易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi调用Servlet

一直想让Delphi做为RIA,而业务层使用Java!今天没事做,简单实现了一下!
目前有2种方案:
WebService
IndyHttp调用Servlet
以下是用IndyHttp来调用Servlet
一、先写一个helloworld的Servlet
1.编写ui以及service
//工具包
package com.cdrs.jutils;
import java.io.IOException;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public abstract class FormObject extends HttpServlet {

protected static final String ACTION = "ACTION";
public FormObject() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}

*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

}

@SuppressWarnings("deprecation")
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Date date = new Date();
System.out.println(date.getHours()+date.getMinutes()+date.getSeconds());
performTask(request, response);
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
public abstract void performTask(HttpServletRequest req,
HttpServletResponse res) throws ServletException, IOException;
}
//ui包
package com.cdrs.servlettest.ui;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cdrs.jutils.FormObject;
import com.cdrs.servlettest.service.ServletTestService;
public class ServletTes


相关文档:

Delphi多线程学习(10):Label(VCL)同步的问题

上文中,多线程同步主窗体的Label的Caption属性值,发现一个问题:使用Synchronize用于同步的时候,主窗体好像死掉一样;而直接用子程序为Label的引用赋值,则有时会出现“Canvas  does not allow drawing”错误。书上说VCL同步一定要用Synchronize,而不能直接访问。
    测试:
{主窗体} ......

Delphi中的Record


在Delphi中的Record类型中,与之C语言对应的即是结构体类型(struct
),也可能是为了符合C语言或C++程序员的习惯,对于它在Delphi中的应用存在的一些问题进行初步的说明。在Delphi中的记录体类型有两种方式定义
Type
    RecTest = record (packed
)
      ID :integer; ......

Delphi游戏开发网址大全[转贴]


Source Code
http://www.codefans.com/CodeList/Catalog_5_CodeTime_Desc_1.html
http://www.vscodes.com/sitemap.html
http://www.itlove.net/Soft/261/
DelphiX
http://www.micrel.cz/Dx/
http://www.delphi3d.net/index.php
http://www.pascalgamedevelopment.com/
http://www.2ccc.com/article.asp?articleid ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号