- 浏览: 73659 次
- 性别:
- 来自: 深圳
文章分类
最新评论
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>AppletServer</display-name> <servlet> <description>Test</description> <display-name>TestServlet</display-name> <servlet-name>TestServlet</servlet-name> <servlet-class>server.TestServlet</servlet-class> </servlet> <servlet> <description>log process</description> <display-name>LogServlet</display-name> <servlet-name>LogServlet</servlet-name> <servlet-class>server.LogServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>TestServlet</servlet-name> <url-pattern>/test</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>LogServlet</servlet-name> <url-pattern>/logServlet</url-pattern> </servlet-mapping> </web-app>
Sevrlet
public class LogServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { private static final long serialVersionUID = 1L; /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#HttpServlet() */ public LogServlet() { super(); } /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InputStream input = request.getInputStream(); InputStreamReader reader = new InputStreamReader(input); BufferedReader buffer = new BufferedReader(reader); StringBuffer sb = new StringBuffer(); String temp = null; while((temp = buffer.readLine()) != null) { sb.append(temp); } buffer.close(); reader.close(); input.close(); String content = URLDecoder.decode(sb.toString(), "UTF-8"); System.out.println(content); } }
URLConnection
public class LogConnectionManager { private static URLConnection conn = null; public static URLConnection getURLConnection() { try { URL url = new URL("http://127.0.0.1:8888/appletserver/logServlet"); conn = url.openConnection(); if(urlConn instanceof HttpURLConnection) { // 设定请求的方法为"POST",默认是GET ((HttpURLConnection)urlConn).setRequestMethod("POST"); } conn .setDoOutput(true); conn .setUseCaches(false); conn .setRequestProperty("Content-Type", "application/x-java-serialized-object"); return conn; } catch (Exception e) { //log.debug("URL connection failed ", e); return null; } }
发表评论
-
gradle
2018-06-19 16:38 0ext { xxxx_repo = 'http://n ... -
注解检查接口参数检查
2018-06-19 11:27 0@Documented @Target({java. ... -
linux搭建开发环境
2017-12-05 13:38 3751、查看linux机器是32位还是64位的方法: fil ... -
导出CSV文件
2017-07-12 13:44 363import java.io.BufferedWri ... -
rsa
2015-07-09 10:57 0package com.huawei.it.mcloud.m ... -
activeMq.xml
2015-04-30 16:47 0<?xml version="1.0&quo ... -
spring jms 配置
2015-04-30 16:36 01、配置spring_jms.xml 2、配置active ... -
用IBM的JDK不会出现的问题,但用SUN的JDK会出现的问题
2012-09-10 10:29 797DocumentBuilderFactory factory ... -
ant 安装
2012-02-06 16:42 7841、ant下载http://ant.apache.org/bi ... -
applet 触发 Servlet 【2】
2011-08-23 14:18 978public class LogConnectionManag ... -
SWING 表格
2011-08-23 11:32 1095blic class StudentNameCell exte ... -
java 反射
2011-08-23 11:27 984在运行时从某些外部源读取类名反射不适合 private ... -
Iterator
2011-08-17 14:02 1168public static void main( ... -
jxl读取excel
2011-08-09 16:42 1952public class TestJXLRead { ... -
logging日志(一) 扩展Formatter
2011-08-03 16:43 1221logging.properties handl ... -
logging日志(二) 扩展Handler
2011-08-03 16:40 874import java.net.InetAddress; ... -
java 开发高效辅助工具
2011-06-08 10:13 1231记录一下用过的开发效率提高的工具 BeyondCom ... -
批量重名文件
2011-02-16 16:38 955import java.io.File; import ja ... -
安装Eclipse插件 -- 链接的形式
2009-10-13 17:55 1310第一次这样安装Eclipse插件,方法是1.在eclipse目 ... -
网址记录
2009-07-25 12:04 36http://java.sun.com http://www ...
相关推荐
材料列表: 1.applet 数字签名 安全问题 2.Applet访问mysql数据库 3.Applet和Servlet利用http对象流通信 4.J2EE企业应用:Applet和Servlet的通信...等等
用applet+servlet+jsp根据MVC模式进行从数据库中取数据进行动态描点。
NULL 博文链接:https://self4j.iteye.com/blog/914068
如何实现java applet与servlet通讯
applet请求servlet,然后servlet读取文件流,并把文件流返回给applet,供applet打印
对java Applet与Servlet之间的通讯、通讯方式进行讲解,并给出一个实例。
Applet与Servlet的通讯.txt Applet与Servlet的通讯.txt
本文中我们讨论了有关建立一个前端使用Applet、后端使用Servlet的应用程序的一些有用的策略。Applet只有一个唯一的通信路径,但是我们可以有几种在Applet和Servlet之间交换信息的方式。Sun公司的应用程序模型所推荐...
Applet与Servlet的通信技术.pdf
Java Applet与Java Servlet的安全通信策略与实现
applet to servlet communication
基于Java Applet与servlet通信技术的Web文本页面保护方法.pdf
Applet和servlet通信
一个servlet 和 applet 通讯的完整项目 自己做的 很好 有说明文档
NULL 博文链接:https://hnzhoujunmei.iteye.com/blog/775143
引用页面 博文链接:https://springside.iteye.com/blog/120294
11. 1 Applet和Servlet通信概述 11. 2 Applet和Servlet的网络通信 11. 2. 1 初识Applet和Servlet网络通信 11. 2. 2 Applet和Servlet之间传递对象 11. 3 Applet和Servlet之间实现远程方法调用 11. 3. 1 远程方法调用...