gwt与php混合使用~
注意的有几点,hosted模式下RequestBuilder读取server的json有问题,用本地文件代替即可。
Zend_Json默认输出的json数据不能被读取,必须加[和]...
echo "[";
echo Zend_Json::encode($myconfig);
echo "]";
简单读取json的例子:
package com.esbrain.client;
import com.esbrain.shared.FieldVerifier;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.Window;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.*;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class mygwt implements EntryPoint {
String MY_URL = "http://feeds.feedburner.com/jandan?format=xml";
final private Button btn = new Button();
private static final RequestBuilder reqBuilder = new RequestBuilder(
RequestBuilder.GET ,
"/my.json"
//"http://localhost/ecshop/public/rdcfg/base"
);
private class SendButtonHandler implements ClickHandler{
public void onClick(ClickEvent ce){
try{
相关文档:
<?php
class Model_Data_FocusData{
....
public function getData(){...}
}
class Model_Data_IndexData{
....
public function getData(){...}
}
?>
有这么几个类,希望能够自动的根据参数来调用不同的类处理数据。
看调用模块:
<?php
function getData($act){
$class = "Mode ......
1.
前言
我使用的主机名为server1.example.com
,ip
地址是192.168.0.100
。这些设置可能与你想要的有所不同,所以你必须在适当的地方修改一下。
2
安装MySQL5
用下列命令安装MySQL
:
yum install mysql mysql-server
然后我们为MySQL
创建系统启动链接(这样的话,MySQL
就会随着系统启动而启动),并启动 ......
<?php
//单例模式的类Lock
class
Lock
{
//静态属性$instance
  ......
看了些PHP的基础知识,自己在这里总结下:
1,在HTML嵌入PHP脚本有三种办法:
<script language="php">
//嵌入方式一
echo("test");
</script>
<?
//嵌入方式二
echo "<br>test2";
?>
<?php
//嵌入方式三
echo "<br>test3";
?>
还有一种嵌入方式,即使用 ......