Skip to content

Commit 5cf572a

Browse files
author
jossonsmith
committed
Improve charset detecting of HttpRequest;
Support cross site script for Simple RPC
1 parent ee46a01 commit 5cf572a

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*******************************************************************************
2+
* Java2Script Pacemaker (http://j2s.sourceforge.net)
3+
*
4+
* Copyright (c) 2006 ognize.com and others.
5+
* All rights reserved. This program and the accompanying materials
6+
* are made available under the terms of the Eclipse Public License v1.0
7+
* which accompanies this distribution, and is available at
8+
* http://www.eclipse.org/legal/epl-v10.html
9+
*
10+
* Contributors:
11+
* ognize.com - initial API and implementation
12+
*******************************************************************************/
13+
14+
package net.sf.j2s.test.ajax;
15+
16+
import net.sf.j2s.ajax.SimpleRPCRunnable;
17+
18+
/**
19+
* @author zhou renjian
20+
*
21+
* 2007-1-23
22+
*/
23+
public class ZZRunnable extends SimpleRPCRunnable {
24+
public String name;
25+
26+
/* (non-Javadoc)
27+
* @see net.sf.j2s.ajax.SimpleRPCRunnable#getHttpURL()
28+
*/
29+
public String getHttpURL() {
30+
return "http://localhost/doitrightnow/simplerpc";
31+
}
32+
33+
public void ajaxRun() {
34+
name = "/* server */" + name + "/* client */";
35+
}
36+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*******************************************************************************
2+
* Java2Script Pacemaker (http://j2s.sourceforge.net)
3+
*
4+
* Copyright (c) 2006 ognize.com and others.
5+
* All rights reserved. This program and the accompanying materials
6+
* are made available under the terms of the Eclipse Public License v1.0
7+
* which accompanies this distribution, and is available at
8+
* http://www.eclipse.org/legal/epl-v10.html
9+
*
10+
* Contributors:
11+
* ognize.com - initial API and implementation
12+
*******************************************************************************/
13+
14+
package net.sf.j2s.test.ajax;
15+
16+
import net.sf.j2s.ajax.SimpleRPCRequest;
17+
18+
/**
19+
* @author zhou renjian
20+
*
21+
* 2007-1-23
22+
*/
23+
public class ZZRunnableTest {
24+
/**
25+
* @param args
26+
*/
27+
public static void main(String[] args) {
28+
SimpleRPCRequest.switchToAJAXMode();
29+
SimpleRPCRequest.request(new ZZRunnable() {
30+
/* (non-Javadoc)
31+
* @see net.sf.j2s.test.ajax.ZZRunnable#getHttpURL()
32+
*/
33+
public String getHttpURL() {
34+
return "http://localhost/doitrightnow/simplerpc";
35+
}
36+
public void ajaxIn() {
37+
System.out.println("In");
38+
39+
this.name = "";
40+
for (int i = 0; i < 1000; i++) {
41+
this.name += "ABC %?#ABC %?#ABC %?#";
42+
}
43+
}
44+
public void ajaxOut() {
45+
System.out.println("Out");
46+
System.out.println(this.name);
47+
}
48+
public void ajaxFail() {
49+
System.out.println("Fail");
50+
}
51+
});
52+
}
53+
}

0 commit comments

Comments
 (0)