------送100分------applet问题------送100分------
我是个java初学者最近一直在学applet
想让applet可以和asp通信,我看了网上的一些applet通信的资料,都特少而且重复。我想通过url带参数的方法发给asp,例如:?content=123,asp端request(“content”)。但是我现在applet可以读取编译好的asp参数,但是不能发送参数到asp,我的代码如下,希望各位高人能给解决一下,我这个问题在SUN社区还有很多QQ群里都问了,很多人都说不会或者不看applet包括我老师也是,他们都觉得applet的商业价值不大而且麻烦,但是我觉得学习就应该深入学学,现在在论坛上很流行的applet+ASP制作的涂鸦版就是日本人做的applet我觉得他们能用applet制作出这么流行的东西而我们国内连个仿照的都没实在有点以外。
顺便在说下~日本人写的applet用的方法不是我这个,我看不懂,asp端是中国人写的用ADO来存储数据的。
我不知道这里送分多少合适我有100分可以都送给能解决的高人
asp代码:<%content=request("content")
bb=2323
response.write "&&content="&content&"&bb="&bb%>
applet代码:
void sendButton_actionPerformed(ActionEvent e) {
String content=messageField.getText();
try{
String surl="http://localhost/bbs/code/chat.asp?"+URLEncoder.encode("content") + "=" +
URLEncoder.encode(content);
URL url = new URL(surl);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.connect();
// POST the request data (html form encoded)
PrintStream out = new PrintStream(conn.getOutputStream());
out.println(url);
out.close();
//HttpURLConnection httpConnection = (HttpURLConnection)url.openConnection ();
//httpConnection.connect();
//收
String content2;
surl2="http://localhost/bbs/code/chat.asp" ;
URL url2 = new URL(surl2);
URLConnection conn2 = url2.openConnection();
InputStreamReader reader=new InputStreamReader(conn2.getInputStream ());
BufferedReader in=new BufferedReader(reader);
String message;
message=in.readLine();
jTextArea1.insert("33:"+message+"\n",0);
}
catch(IOException e1){
System.err.println ("IOException");
e1.printStackTrace (System.err);
showStatus(e1.toString ());
}
jTextArea1.insert("cc:"+content+"\n",0);
}
}
applet全部代码:http://gceclub.sun.com.cn/NASApp/sme/jive/thread.jsp?forum=9&thread=10329
想让applet可以和asp通信,我看了网上的一些applet通信的资料,都特少而且重复。我想通过url带参数的方法发给asp,例如:?content=123,asp端request(“content”)。但是我现在applet可以读取编译好的asp参数,但是不能发送参数到asp,我的代码如下,希望各位高人能给解决一下,我这个问题在SUN社区还有很多QQ群里都问了,很多人都说不会或者不看applet包括我老师也是,他们都觉得applet的商业价值不大而且麻烦,但是我觉得学习就应该深入学学,现在在论坛上很流行的applet+ASP制作的涂鸦版就是日本人做的applet我觉得他们能用applet制作出这么流行的东西而我们国内连个仿照的都没实在有点以外。
顺便在说下~日本人写的applet用的方法不是我这个,我看不懂,asp端是中国人写的用ADO来存储数据的。
我不知道这里送分多少合适我有100分可以都送给能解决的高人
asp代码:<%content=request("content")
bb=2323
response.write "&&content="&content&"&bb="&bb%>
applet代码:
void sendButton_actionPerformed(ActionEvent e) {
String content=messageField.getText();
try{
String surl="http://localhost/bbs/code/chat.asp?"+URLEncoder.encode("content") + "=" +
URLEncoder.encode(content);
URL url = new URL(surl);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.connect();
// POST the request data (html form encoded)
PrintStream out = new PrintStream(conn.getOutputStream());
out.println(url);
out.close();
//HttpURLConnection httpConnection = (HttpURLConnection)url.openConnection ();
//httpConnection.connect();
//收
String content2;
surl2="http://localhost/bbs/code/chat.asp" ;
URL url2 = new URL(surl2);
URLConnection conn2 = url2.openConnection();
InputStreamReader reader=new InputStreamReader(conn2.getInputStream ());
BufferedReader in=new BufferedReader(reader);
String message;
message=in.readLine();
jTextArea1.insert("33:"+message+"\n",0);
}
catch(IOException e1){
System.err.println ("IOException");
e1.printStackTrace (System.err);
showStatus(e1.toString ());
}
jTextArea1.insert("cc:"+content+"\n",0);
}
}
applet全部代码:http://gceclub.sun.com.cn/NASApp/sme/jive/thread.jsp?forum=9&thread=10329
...全文
相关推荐
JAVA100例之实例72Applet的使用权用
性能问题:Applet需要Java插件支持,而插件的安装和更新可能导致性能问题。3. 移动设备支持:移动设备上的浏览器往往不支持Java插件。4.
100-java-applet-example.zip_Java example
**实践应用**:通过分析和运行这100个示例,你可以看到各种Applet应用场景,从而提升自己的编程技巧和问题解决能力。10.
Applet
随着Web技术的发展,Applet由于其安全性、兼容性和性能问题,逐渐被更现代的技术如JavaScript、Ajax、Flash以及现在广泛采用的HTML5取代。
Applet类及应用
**安全限制**:Applet运行时受到严格的沙箱限制,无法访问本地文件系统等资源。3. **性能问题**:使用`Thread.sleep()`可能会导致性能问题,特别是在高负载服务器上。4.
教你构建第一个Java Applet程序
extends Applet { public void paint(Graphics g) { g.drawRect(0, 0, 250, 100); g.setColor(Color.blue);


Java SE

