- 浏览: 100440 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
malixxx:
这个上传图片真费劲,上传了word文件
arm mini2440的led灯总结 -
huanglei_jay:
...
解决osgi spring 事务配置问题 -
arne3166:
不错,谢谢分享。
MySQL的LAST_INSERT_ID -
darrendu:
你好,protocolBuffer,能根据一个URL直接进行数 ...
protocolBuffer 说明 -
malixxx:
我也没研究了,我们的项目不用这个了,不过可以配置事务就应该可以 ...
解决osgi spring 事务配置问题
用jetty写了一个小程序,主要是解决局域网内很多人不能上网的问题.我的想法是通过一台可以上网的主机,启动这个服务.其他人访问他就可以浏览网页.写的很糙.不过能跑,有的页面还是有问题.
思路:
浏览器 --> jetty服务,httpclient(这里的url写死的 http://www.google.cn/search?q= 查询内容) --> google
浏览器 <-- 这里有流操作,把一些url替换掉 <-- google
一下都是一样的,还有翻页也没写. get提交加一个 属性start=0 或10 20 ...
不过感觉很慢,就是随便写着玩的. 希望大家给点意见.
图片为要导入的包.
package Jetty_Test.mytest;
import java.util.Random;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.HashSessionIdManager;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.thread.BoundedThreadPool;
public class JettyMain implements Constant{
static Server server;
static {
server = new Server();
}
public static void startserver() {
// Service对象就是Jetty容器,实例化出这样一个对象就产生了一个容器。
server.setSessionIdManager(new HashSessionIdManager(new Random()));
server.setStopAtShutdown(true);
BoundedThreadPool pool = new BoundedThreadPool();
pool.setLowThreads(minThreads);
pool.setMaxThreads(maxThreads);
server.setThreadPool(pool);
Connector connector = new SelectChannelConnector();
connector.setPort(httpPort);
connector.setHost(ipStr);
server.addConnector(connector);
Context context = new Context(server, "/", Context.SESSIONS);
context.addServlet(new ServletHolder(new MainServlet()), context_Main+"/*");
context.addServlet(new ServletHolder(new GoogleServlet()), context_Google+"/*");
context.addServlet(new ServletHolder(new PageServlet()), context_Page+"/*");
// HandlerCollection handlers = new HandlerCollection();
// ContextHandlerCollection contexts = new ContextHandlerCollection();
// RequestLogHandler requestLogHandler = new RequestLogHandler();
// handlers.setHandlers(new Handler[] { contexts, new DefaultHandler(),
// requestLogHandler });
// server.setHandler(handlers);
// ContextHandlerCollection contexts = new ContextHandlerCollection();
// server.setHandler(contexts);
//
// WebAppContext webapp = new WebAppContext(contexts, "webapp", "/testjsp");
// SessionManager session = webapp.getSessionHandler().getSessionManager();
//
// HandlerCollection handlers = new HandlerCollection();
// handlers.setHandlers(new Handler[] { context, webapp });
// server.setHandler(handlers);
// Handler handler = new MyHandelr();
// server.setHandler(handler);
try {
server.start();
// server.join();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static void main(String args[]) {
startserver();
}
}
package Jetty_Test.mytest;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.mortbay.jetty.HttpConnection;
import org.mortbay.jetty.Request;
public class MainServlet extends HttpServlet {
private static final long serialVersionUID = -5499674229427179325L;
static byte[] buf;
static {
InputStream file = null;
ByteArrayOutputStream out = null;
try {
file = new FileInputStream(Constant.filePath);
out=new ByteArrayOutputStream();
int temp=file.read();
while(temp!=-1){
out.write(temp);
temp=file.read();
}
buf=out.toByteArray();
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
file.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void init() throws ServletException {
super.init();
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Request base_request = (request instanceof Request) ? (Request) request : HttpConnection.getCurrentConnection().getRequest();
base_request.setHandled(true);
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
response.setStatus(HttpServletResponse.SC_OK);
OutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
outputStream.write(buf);
outputStream.flush();
} finally {
if (outputStream != null) {
outputStream.close();
}
}
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
package Jetty_Test.mytest;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
public class PageServlet extends HttpServlet {
public void init() throws ServletException {
super.init();
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String urlstr = request.getParameter("urlstr");
// System.out.println("PageServlet url:" + urlstr);
if (urlstr == null) {
urlstr = "";
}
// urlstr = URLEncoder.encode(urlstr);
HttpClient httpclient = new HttpClient();
GetMethod postMethod = new GetMethod(urlstr);
httpclient.executeMethod(postMethod);
InputStream input = postMethod.getResponseBodyAsStream();
response.setCharacterEncoding("uft8");
OutputStream out = response.getOutputStream();
Help.analyse(input, out);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
package Jetty_Test.mytest;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
public class GoogleServlet extends HttpServlet {
private static final long serialVersionUID = 8306441036467951814L;
public void init() throws ServletException {
super.init();
}
public static void main(String args[]) throws UnsupportedEncodingException {
String str = "a";
byte[] bs = str.getBytes("utf8");
// byte[] bs=str.getBytes("gbk");
for (int i = 0; i < bs.length; i++) {
// System.out.println(bs[i] + "");
}
// System.out.println();
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String searchcontext = request.getParameter("searchcontext");
if (searchcontext == null) {
searchcontext = "";
}
String URLTest = "http://www.google.cn/search?q=" + URLEncoder.encode(searchcontext);
HttpClient httpclient = new HttpClient();
GetMethod postMethod = new GetMethod(URLTest);
httpclient.executeMethod(postMethod);
InputStream input = postMethod.getResponseBodyAsStream();
response.setCharacterEncoding("uft8");
OutputStream out = response.getOutputStream();
Help.analyse(input, out);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
package Jetty_Test.mytest;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
public class Help implements Constant{
private static byte[] handleALine(byte[] buff) throws UnsupportedEncodingException {
StringBuilder str = new StringBuilder();
if (buff[9] == 'h' && buff[10] == 't' && buff[11] == 't' && buff[12] == 'p') {
str.append("a href=\"http://" + ipStr + ":" + httpPort + context_Page + "?urlstr=");
for (int i = 9; i < buff.length; i++) {
if (buff[i] == '"') {
break;
}
str.append((char) buff[i]);
}
str.append("\"");
} else {
str.append("a href=\"http://" + ipStr + ":" + httpPort + context_Main +"\"");
}
// System.out.println(str.toString());
byte[] bss = str.toString().getBytes("utf8");
return bss;
}
public static void analyse(InputStream input, OutputStream out) throws IOException {
byte[] buff = null;
int flg = 0;
int flga = 0;
long num = 0;
int index = 0;
int temp = input.read();
while (temp != -1) {
num++;
if (temp == '<') {
flg = 1;
num = 1;
} else if (temp == 'a') {
if (flg == 1 && num == 2) {
flga = 1;
buff = new byte[2048];
buff[index] = '<';
index++;
} else {
flg = 0;
}
} else if (temp == '>') {
if (flga == 1) {
buff[index] = (byte) temp;
index++;
for (int i = 0; i < buff.length; i++) {
// System.out.print((char) buff[i]);
}
byte[] bss = handleALine(buff);
for (int i = 0; i < bss.length; i++) {
out.write(bss[i]);
}
// System.out.println();
}
flg = 0;
flga = 0;
index = 0;
} else {
}
if (flga == 1) {
buff[index] = (byte) temp;
index++;
} else {
out.write(temp);
}
temp = input.read();
}
input.close();
out.close();
}
}
package Jetty_Test.mytest;
public interface Constant {
static String context_Main = "/index";
static String context_Google = "/google";
static String context_Page = "/pageshow";
static int minThreads = 5;
static int maxThreads = 10;
static String ipStr = "192.168.1.5";
static int httpPort = 12345;
static String filePath="src/Jetty_Test/mytest/start.txt";
}
start.txt文件
<html>
<body>
<form action="http://192.168.1.5:12345/google" method="get">
google搜索 请输入你要搜索的内容:
<input type="text" name="searchcontext">
<input type="submit" value="提交">
</form>
<p/>
<b>mgt 测试</b><br/>
<a href="http://200.eff.com:81/trunk/index.jsp" target="_blank">黄师傅 mgt</a> http://200.eff.com:81/trunk/index.jsp <br/>
<a href="http://163.eff.com:88/trunk/" target="_blank">163 mgt</a> http://163.eff.com:88/trunk/
<p/>
<b>总控查看</b><br/>
<a href="https://192.168.0.73/list.jsp" target="_blank">23 总控</a> https://192.168.0.73/list.jsp <br/>
<a href="https://192.168.0.173/list.jsp" target="_blank">25 总控</a> https://192.168.0.173/list.jsp
<p/>
<b>eim服务查看</b><br/>
<a href="http://192.168.0.23:5227/admin/login.jsp" target="_blank">23 eim控制</a> http://192.168.0.23:5227/admin/login.jsp <br/>
<a href="http://192.168.0.25:5227/admin/login.jsp" target="_blank">25 eim控制</a> http://192.168.0.25:5227/admin/login.jsp
<p/>
<b>测试客户端</b><br/>
<a href="http://192.168.0.10/" target="_blank">测试客户端</a> http://192.168.0.10/ <p/>
<b>工具下载</b><br/>
<a href="ftp://192.168.2.1/" target="_blank">工具下载</a> ftp://192.168.2.1/ <p/>
<b>bug管理</b><br/>
<a href="http://192.168.0.3/TDBIN/start_a.htm" target="_blank">bug管理(td)</a> http://192.168.0.3/TDBIN/start_a.htm <p/>
<b>svn地址</b><br/>
<a href="#">svn地址</a> https://192.168.0.2/svn/server <p/>
<b>Search URL</b><br/>
<a href="#">更新全部的doc 注意ip地址: </a> http://192.168.0.182:8089/search/action/?action=updateAll <br/>
<a href="#">优化单个公司索引 注意ip地址: </a> http://192.168.0.182:8089/search/action/?action=optimizeAll <br/>
<a href="#">更新单个的doc 注意ip地址,公司id: </a> http://192.168.0.25:8089/search/action/?corpID=5349&action=update <br/>
<a href="#">优化单个公司索引 注意ip地址,公司id: </a> http://192.168.0.182:8089/search/action/?corpID=5349&action=optimize <p/>
</body>
</html>
思路:
浏览器 --> jetty服务,httpclient(这里的url写死的 http://www.google.cn/search?q= 查询内容) --> google
浏览器 <-- 这里有流操作,把一些url替换掉 <-- google
一下都是一样的,还有翻页也没写. get提交加一个 属性start=0 或10 20 ...
不过感觉很慢,就是随便写着玩的. 希望大家给点意见.
图片为要导入的包.
package Jetty_Test.mytest;
import java.util.Random;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.HashSessionIdManager;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.thread.BoundedThreadPool;
public class JettyMain implements Constant{
static Server server;
static {
server = new Server();
}
public static void startserver() {
// Service对象就是Jetty容器,实例化出这样一个对象就产生了一个容器。
server.setSessionIdManager(new HashSessionIdManager(new Random()));
server.setStopAtShutdown(true);
BoundedThreadPool pool = new BoundedThreadPool();
pool.setLowThreads(minThreads);
pool.setMaxThreads(maxThreads);
server.setThreadPool(pool);
Connector connector = new SelectChannelConnector();
connector.setPort(httpPort);
connector.setHost(ipStr);
server.addConnector(connector);
Context context = new Context(server, "/", Context.SESSIONS);
context.addServlet(new ServletHolder(new MainServlet()), context_Main+"/*");
context.addServlet(new ServletHolder(new GoogleServlet()), context_Google+"/*");
context.addServlet(new ServletHolder(new PageServlet()), context_Page+"/*");
// HandlerCollection handlers = new HandlerCollection();
// ContextHandlerCollection contexts = new ContextHandlerCollection();
// RequestLogHandler requestLogHandler = new RequestLogHandler();
// handlers.setHandlers(new Handler[] { contexts, new DefaultHandler(),
// requestLogHandler });
// server.setHandler(handlers);
// ContextHandlerCollection contexts = new ContextHandlerCollection();
// server.setHandler(contexts);
//
// WebAppContext webapp = new WebAppContext(contexts, "webapp", "/testjsp");
// SessionManager session = webapp.getSessionHandler().getSessionManager();
//
// HandlerCollection handlers = new HandlerCollection();
// handlers.setHandlers(new Handler[] { context, webapp });
// server.setHandler(handlers);
// Handler handler = new MyHandelr();
// server.setHandler(handler);
try {
server.start();
// server.join();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static void main(String args[]) {
startserver();
}
}
package Jetty_Test.mytest;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.mortbay.jetty.HttpConnection;
import org.mortbay.jetty.Request;
public class MainServlet extends HttpServlet {
private static final long serialVersionUID = -5499674229427179325L;
static byte[] buf;
static {
InputStream file = null;
ByteArrayOutputStream out = null;
try {
file = new FileInputStream(Constant.filePath);
out=new ByteArrayOutputStream();
int temp=file.read();
while(temp!=-1){
out.write(temp);
temp=file.read();
}
buf=out.toByteArray();
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
file.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void init() throws ServletException {
super.init();
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Request base_request = (request instanceof Request) ? (Request) request : HttpConnection.getCurrentConnection().getRequest();
base_request.setHandled(true);
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
response.setStatus(HttpServletResponse.SC_OK);
OutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
outputStream.write(buf);
outputStream.flush();
} finally {
if (outputStream != null) {
outputStream.close();
}
}
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
package Jetty_Test.mytest;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
public class PageServlet extends HttpServlet {
public void init() throws ServletException {
super.init();
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String urlstr = request.getParameter("urlstr");
// System.out.println("PageServlet url:" + urlstr);
if (urlstr == null) {
urlstr = "";
}
// urlstr = URLEncoder.encode(urlstr);
HttpClient httpclient = new HttpClient();
GetMethod postMethod = new GetMethod(urlstr);
httpclient.executeMethod(postMethod);
InputStream input = postMethod.getResponseBodyAsStream();
response.setCharacterEncoding("uft8");
OutputStream out = response.getOutputStream();
Help.analyse(input, out);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
package Jetty_Test.mytest;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
public class GoogleServlet extends HttpServlet {
private static final long serialVersionUID = 8306441036467951814L;
public void init() throws ServletException {
super.init();
}
public static void main(String args[]) throws UnsupportedEncodingException {
String str = "a";
byte[] bs = str.getBytes("utf8");
// byte[] bs=str.getBytes("gbk");
for (int i = 0; i < bs.length; i++) {
// System.out.println(bs[i] + "");
}
// System.out.println();
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String searchcontext = request.getParameter("searchcontext");
if (searchcontext == null) {
searchcontext = "";
}
String URLTest = "http://www.google.cn/search?q=" + URLEncoder.encode(searchcontext);
HttpClient httpclient = new HttpClient();
GetMethod postMethod = new GetMethod(URLTest);
httpclient.executeMethod(postMethod);
InputStream input = postMethod.getResponseBodyAsStream();
response.setCharacterEncoding("uft8");
OutputStream out = response.getOutputStream();
Help.analyse(input, out);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
package Jetty_Test.mytest;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
public class Help implements Constant{
private static byte[] handleALine(byte[] buff) throws UnsupportedEncodingException {
StringBuilder str = new StringBuilder();
if (buff[9] == 'h' && buff[10] == 't' && buff[11] == 't' && buff[12] == 'p') {
str.append("a href=\"http://" + ipStr + ":" + httpPort + context_Page + "?urlstr=");
for (int i = 9; i < buff.length; i++) {
if (buff[i] == '"') {
break;
}
str.append((char) buff[i]);
}
str.append("\"");
} else {
str.append("a href=\"http://" + ipStr + ":" + httpPort + context_Main +"\"");
}
// System.out.println(str.toString());
byte[] bss = str.toString().getBytes("utf8");
return bss;
}
public static void analyse(InputStream input, OutputStream out) throws IOException {
byte[] buff = null;
int flg = 0;
int flga = 0;
long num = 0;
int index = 0;
int temp = input.read();
while (temp != -1) {
num++;
if (temp == '<') {
flg = 1;
num = 1;
} else if (temp == 'a') {
if (flg == 1 && num == 2) {
flga = 1;
buff = new byte[2048];
buff[index] = '<';
index++;
} else {
flg = 0;
}
} else if (temp == '>') {
if (flga == 1) {
buff[index] = (byte) temp;
index++;
for (int i = 0; i < buff.length; i++) {
// System.out.print((char) buff[i]);
}
byte[] bss = handleALine(buff);
for (int i = 0; i < bss.length; i++) {
out.write(bss[i]);
}
// System.out.println();
}
flg = 0;
flga = 0;
index = 0;
} else {
}
if (flga == 1) {
buff[index] = (byte) temp;
index++;
} else {
out.write(temp);
}
temp = input.read();
}
input.close();
out.close();
}
}
package Jetty_Test.mytest;
public interface Constant {
static String context_Main = "/index";
static String context_Google = "/google";
static String context_Page = "/pageshow";
static int minThreads = 5;
static int maxThreads = 10;
static String ipStr = "192.168.1.5";
static int httpPort = 12345;
static String filePath="src/Jetty_Test/mytest/start.txt";
}
start.txt文件
<html>
<body>
<form action="http://192.168.1.5:12345/google" method="get">
google搜索 请输入你要搜索的内容:
<input type="text" name="searchcontext">
<input type="submit" value="提交">
</form>
<p/>
<b>mgt 测试</b><br/>
<a href="http://200.eff.com:81/trunk/index.jsp" target="_blank">黄师傅 mgt</a> http://200.eff.com:81/trunk/index.jsp <br/>
<a href="http://163.eff.com:88/trunk/" target="_blank">163 mgt</a> http://163.eff.com:88/trunk/
<p/>
<b>总控查看</b><br/>
<a href="https://192.168.0.73/list.jsp" target="_blank">23 总控</a> https://192.168.0.73/list.jsp <br/>
<a href="https://192.168.0.173/list.jsp" target="_blank">25 总控</a> https://192.168.0.173/list.jsp
<p/>
<b>eim服务查看</b><br/>
<a href="http://192.168.0.23:5227/admin/login.jsp" target="_blank">23 eim控制</a> http://192.168.0.23:5227/admin/login.jsp <br/>
<a href="http://192.168.0.25:5227/admin/login.jsp" target="_blank">25 eim控制</a> http://192.168.0.25:5227/admin/login.jsp
<p/>
<b>测试客户端</b><br/>
<a href="http://192.168.0.10/" target="_blank">测试客户端</a> http://192.168.0.10/ <p/>
<b>工具下载</b><br/>
<a href="ftp://192.168.2.1/" target="_blank">工具下载</a> ftp://192.168.2.1/ <p/>
<b>bug管理</b><br/>
<a href="http://192.168.0.3/TDBIN/start_a.htm" target="_blank">bug管理(td)</a> http://192.168.0.3/TDBIN/start_a.htm <p/>
<b>svn地址</b><br/>
<a href="#">svn地址</a> https://192.168.0.2/svn/server <p/>
<b>Search URL</b><br/>
<a href="#">更新全部的doc 注意ip地址: </a> http://192.168.0.182:8089/search/action/?action=updateAll <br/>
<a href="#">优化单个公司索引 注意ip地址: </a> http://192.168.0.182:8089/search/action/?action=optimizeAll <br/>
<a href="#">更新单个的doc 注意ip地址,公司id: </a> http://192.168.0.25:8089/search/action/?corpID=5349&action=update <br/>
<a href="#">优化单个公司索引 注意ip地址,公司id: </a> http://192.168.0.182:8089/search/action/?corpID=5349&action=optimize <p/>
</body>
</html>
发表评论
-
修改hadoop中的io写的,远程调用对象的东西。
2012-06-04 18:55 999修改hadoop中的io写的,远程调用对象的东西。 -
memcached安装
2010-05-14 17:24 1273memcached安装 1. 下载, memcached需要 ... -
类设计原则
2010-04-30 12:03 1145类设计原则 收藏 类设 ... -
zeroc ice Helloworld小例子
2010-02-09 11:13 2352ice 官方小例子,具体什么是ice网上的介绍挺多的。 下载 ... -
jetty写的一个小工具
2010-01-28 13:03 1093里面有一个聊天的小工具,一个上传图片的,一个发邮件的,发邮件的 ... -
多数据源事务jta测试
2009-12-31 17:34 1115测试代码在下边。 -
解决osgi spring 事务配置问题
2009-12-31 16:38 6480前久看了一篇文章, htt ... -
Vector,ArrayList 哪一个更好
2009-10-12 14:28 1055Vector 和 ArrayList的不同 ... -
Java中的HashSet和TreeSet HashSet和TreeSet的区别是什么
2009-10-12 14:25 6420一. 问题 1. HashSet,TreeSet ... -
hashcode()与equals()
2009-10-12 14:10 849hashcode()与equals() java.lna ... -
Hashtable和HashMap的区别
2009-10-12 14:09 925Hashtable和HashMap的区别: ... -
编码测试.
2009-08-27 14:22 943package codingTest; import jav ... -
java 使用相对路径读取文件
2009-08-26 12:07 1418java 使用相对路径读取文件 1.java project ... -
写了一个html特殊字符的转换代码.
2009-08-25 17:15 2951转换字串中的字符. 字符 实体名称 实体数字 描述 ♠ ... -
Quartz 的使用
2009-08-19 12:58 1502Quartz 的使用 Quartz 是个开源的作业调度框架,为 ... -
用httpclient写的登录开心网
2009-08-19 12:09 964登录开心网并,猜加密相册的密码,不过猜一会返回的东西好像就不对 ... -
LOG4J 配置文件
2009-08-19 10:59 1501一、log4j配置,一般可以采用两种方式,资源文件和XML文件 ... -
JDK自带的native2ascii工具完全揭密
2009-08-19 10:21 741JDK自带的native2ascii工具 ...
相关推荐
本篇将详细讲解如何使用Jetty来指定一个端口,开通一个TCP服务。 首先,理解Jetty的基本结构。Jetty的核心组件包括Server、Connector和Handler。Server是整个Jetty服务器的入口点,Connector负责处理网络连接,而...
这个压缩包文件提供的可能是一个简单的Jetty使用示例,帮助初学者理解如何在Eclipse环境中配置和运行Jetty。 首先,让我们深入了解一下Jetty。Jetty是开源的,由Eclipse基金会维护,符合Java Servlet和JSP规范。它...
总之,Jetty整合SpringMVC是一个高效且灵活的Web应用开发方式,结合了Jetty的轻量级特性和SpringMVC的丰富功能,使得开发过程更为便捷。通过理解这个例子,开发者可以快速搭建起自己的Java Web应用。
Jetty是一个轻量级、高性能且开源的Java Web服务器和HTTP服务器库,广泛用于开发、测试和部署Web应用程序。在给定的压缩包文件中,包含了Jetty运行所需的四个核心组件,分别是: 1. **jetty-6.1.8.jar**:这是Jetty...
【标签】"源码 工具"表明这个压缩包中可能包含该小工具的源代码,对于学习和理解Jetty的使用方法以及如何编写基于Jetty的应用程序来说,这是一个宝贵的资源。源码通常可以帮助开发者深入理解工具的工作原理,并能...
除了基础的HTTP服务,Jetty 8还提供了WebSocket支持,这是一个低延迟、全双工的通信协议,允许服务器和客户端之间进行实时双向通信。这在实时应用,如在线游戏、聊天室和协作工具中非常有用。 此外,Jetty 8的依赖...
Jetty 6.1.26是该服务器的一个旧版本,尽管如此,它仍包含了许多关键特性和功能。以下是一些关于Jetty 6.1.26及其核心知识点的详细介绍: 1. **Servlet容器**:Jetty作为Servlet容器,能够解析HTTP请求并将其转发给...
- **项目历史和现状**:Jetty 有着悠久的历史,6.x 版本发布于2009年左右,当时是一个成熟的版本,具有稳定性和兼容性。 - **Jetty vs Tomcat**:相比Tomcat,Jetty 在启动速度、内存占用和并发处理能力方面有优势...
这通常通过创建一个jetty.xml配置文件来完成,或者通过代码动态配置。 总结,启动Jetty所需jar包包括了Jetty的核心组件以及各种扩展功能。正确地理解并配置这些jar包是成功运行Jetty的关键。在实际项目中,应根据...
Jetty Eclipse Plugin则是一个用于集成Jetty到Eclipse开发环境中的插件,方便开发者进行调试和测试Web应用程序。 在这个“jetty 学习资料合集”中,我们可能会涵盖以下关键知识点: 1. **Jetty基础**:了解Jetty的...
总的来说,jetty.jar、jetty-sslengine.jar和jetty-util.jar是Jetty服务器的核心组件,它们分别提供了Web服务器的基本功能、安全通信支持以及实用工具类,共同构建了一个强大而灵活的Java Web应用平台。对于Java...
而"jetty8.0"可能是一个解压后的Jetty 8.0安装目录,包含了服务器的jar文件和其他必要组件。用户可以通过遵循read-Me.text中的指南来设置和运行Jetty服务器,然后将他们的Web应用部署到这个服务器上。
内嵌Jetty意味着将Jetty服务器直接集成到你的Java应用中,而不是作为一个独立的服务来运行。这种方式提供了更高的灵活性和控制权,特别适合于快速迭代的开发环境或者需要自定义服务器配置的情况。 在“Jetty内嵌...
Jetty的版本4.2.24rc0是该软件的一个历史版本,可能包含了修复的一些错误或者特定功能的改进。在本文中,我们将深入探讨Jetty的核心特性、工作原理以及如何使用这个版本。 一、Jetty简介 Jetty由Mortbay ...
Jetty是一款开源、轻量级的Web服务器和Servlet容器,被广泛用于开发、测试和部署Java Web应用程序。相较于Apache Tomcat,Jetty以其简洁的架构、高性能和低内存占用而受到开发者青睐。在选择Jetty时,必须考虑到与...
压缩包中的文件列表可能包括`jetty-server.jar`、`jetty-servlet.jar`、`jetty-websocket.jar`等,每个jar包对应Jetty的一个特定组件或功能。 理解并掌握Jetty的这些核心特性对于开发和维护基于Java的Web应用至关...
2. **Jetty架构**:Jetty采用模块化设计,包括HTTP服务器、WebSocket服务器、HTTP客户端等多个组件,用户可以根据需要选择加载。 3. **安装与配置**:介绍如何下载Jetty,设置环境变量,以及配置Jetty启动参数。 4...
- **下载**:根据提供的压缩包文件名"jetty-distribution-9.2.19.v20160908",这是一个Jetty 9.2.19版本的发行版。你可以从Jetty官方网站或镜像站点下载最新版本。 - **解压**:将下载的压缩包解压到任意文件夹,...
反向代理是一种网络代理服务,它接收来自客户端的请求,然后将这些请求转发给内部网络上的一个或多个服务器,最后将服务器的响应返回给客户端。这种方式可以让客户端认为它正在与实际的目标服务器直接通信,而实际上...
4. **创建和运行Jetty服务器**:在Eclipse的"服务器"视图中,你可以新建一个Jetty服务器实例,关联你的Web项目,并启动它来测试和调试你的应用程序。 通过这个Jetty插件,开发者可以更加便捷地进行服务端开发工作,...