- 浏览: 97769 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
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 923修改hadoop中的io写的,远程调用对象的东西。 -
memcached安装
2010-05-14 17:24 1228memcached安装 1. 下载, memcached需要 ... -
类设计原则
2010-04-30 12:03 1100类设计原则 收藏 类设 ... -
zeroc ice Helloworld小例子
2010-02-09 11:13 2303ice 官方小例子,具体什么是ice网上的介绍挺多的。 下载 ... -
jetty写的一个小工具
2010-01-28 13:03 1058里面有一个聊天的小工具,一个上传图片的,一个发邮件的,发邮件的 ... -
多数据源事务jta测试
2009-12-31 17:34 1049测试代码在下边。 -
解决osgi spring 事务配置问题
2009-12-31 16:38 6414前久看了一篇文章, htt ... -
Vector,ArrayList 哪一个更好
2009-10-12 14:28 1010Vector 和 ArrayList的不同 ... -
Java中的HashSet和TreeSet HashSet和TreeSet的区别是什么
2009-10-12 14:25 6379一. 问题 1. HashSet,TreeSet ... -
hashcode()与equals()
2009-10-12 14:10 809hashcode()与equals() java.lna ... -
Hashtable和HashMap的区别
2009-10-12 14:09 886Hashtable和HashMap的区别: ... -
编码测试.
2009-08-27 14:22 906package codingTest; import jav ... -
java 使用相对路径读取文件
2009-08-26 12:07 1384java 使用相对路径读取文件 1.java project ... -
写了一个html特殊字符的转换代码.
2009-08-25 17:15 2918转换字串中的字符. 字符 实体名称 实体数字 描述 ♠ ... -
Quartz 的使用
2009-08-19 12:58 1444Quartz 的使用 Quartz 是个开源的作业调度框架,为 ... -
用httpclient写的登录开心网
2009-08-19 12:09 901登录开心网并,猜加密相册的密码,不过猜一会返回的东西好像就不对 ... -
LOG4J 配置文件
2009-08-19 10:59 1424一、log4j配置,一般可以采用两种方式,资源文件和XML文件 ... -
JDK自带的native2ascii工具完全揭密
2009-08-19 10:21 704JDK自带的native2ascii工具 ...
相关推荐
免责声明:资料部分来源于合法的互联网渠道收集和整理,部分自己学习积累成果,供大家学习参考与交流。收取的费用仅用于收集和整理资料耗费时间的酬劳。 本人尊重原创作者或出版方,资料版权归原作者或出版方所有,...
对于部署到同一个 Jetty 实例的多个 Web 应用程序,提供了一个占位符 SAML servlet。 选择应用程序并单击底部的端点按钮。 观察联合元数据和 SAML-P URL。 码头设置 将 jar 文件放在 Jetty 服务器类路径
免责声明:资料部分来源于合法的互联网渠道收集和整理,部分自己学习积累成果,供大家学习参考与交流。收取的费用仅用于收集和整理资料耗费时间的酬劳。 本人尊重原创作者或出版方,资料版权归原作者或出版方所有,...
这个小型演示介绍了如何配置项目以获取以下功能: 通过焊接的依赖注入 自动安心的资源扫描和通过焊缝的依赖注入 Resteasy资源中的JSR-303验证 Swagger JAX-RS扫描 Swagger在端点上提供其余文档 轻松灵活地处理JAX-...
结合 CDI (Weld)、JAX-RS (Jersey) 和 Jetty 的最小网络应用程序在花了比我愿意承认的更多时间来寻找 Maven、web.xml 和 Jetty 设置的正确组合之后,我认为把它放在网上可能是有意义的。 使用mvn jetty:run构建并...
"weixin208基于微信小程序的二手物品交易平台ssm"是一个使用Spring、SpringMVC和MyBatis(SSM)框架开发的微信小程序应用。该项目旨在为用户提供一个便捷的二手物品买卖平台,通过微信小程序实现快速访问和交易。...
该代码由一个客户端和一个Web应用程序组成,该Web应用程序提供了简单的计算功能来说明如何使用Jersey来使用JAX-RS。 还有一个有用的EmbeddedServer类,该类允许webapp作为独立的Java应用程序运行。 也可以使用Maven...
使用Java SE的Websocket的示例与其使用Java EE及其附带的所有功能,不如使用Java EE,而不是WebSocket的一种较小的实现方式,可能是针对独立程序或嵌入式应用程序的。 该示例将显示使码头服务器运行,为websocket...
融合的REST实用程序Confluent REST Utils提供了一个小型框架和实用程序,用于使用Jersey,Jackson,Jetty和Hibernate Validator编写Java REST API。 有关简单的演示服务,请参见目录。安全REST Application可以同时...
很多人想找一套真正完全开源的微信小程序商城而找不到,现在我们团队经过整合GitHub开源代码后重磅对出此套完全开源程序。希望大家可以支持我们,我们会不断完善代码和推出新功能来让大家更好的使用。 1 技术框架 ...
最近正在学习comet框架的异步通讯功能 用他的cometd+jetty7 +js 实现了三个工能 1.chat 聊天 2 注册 3 时间新
该代码由一个客户端和一个Web应用程序组成,该Web应用程序提供了简单的计算功能来说明如何使用Spring WebMVC。 还有一个有用的EmbeddedServer类,该类允许webapp作为独立的Java应用程序运行(基于内容)。 也可以...
这个项目是一个小型的JAX-RS样板,结合了Spring Framework,Hibernate和Jersey来构建Restful Web服务。 应用程序服务器是Jetty,数据库服务器是MySQL。 通过应用MVC和DAO模型,可以轻松扩展和维护该项目。
这个小项目是一个示例,说明如何构建“胖” jar ,其中包括JSP和servlet容器(Jetty)。 该jar是独立的,即,您可以直接运行jar并访问服务器页面,而无需进行任何安装或部署。 您可以使用目标compile和package 进行...
当您需要启动一个可能耗费很长时间的应用程序进程,而用户又无需等候进程完成以便从服务器获取响应时,异步处理程序非常有用。服务器提供了允许 request completion,以推动使用internal,transparent和monitoring...
java8 源码 面向对象 Open-Shop是企业在创立初期很好的技术基础框架,加快公司项目开发进度,当然也可以对现有的系统进行升级;...WEB服务器:Weblogic、Tomcat、WebSphere、JBoss、Jetty 等 数据库服务器:My
构建一个打包好的命令行应用程序 5. 一个简单的Web应用 5.1. 介绍 5.1.1. 下载本章样例 5.2. 定义这个简单的Web应用 5.3. 创建这个简单的Web应用 5.4. 配置Jetty插件 5.5. 添加一个简单的Servlet 5.6. ...
带有嵌入式Jetty 9和spring-boot-maven-plugin的HelloServlet 3.0 Maven项目 ... 一个小型而简单的Web应用程序。 我为Rasperry Pi设计,但是它可以在任何平台上使用。 /丹尼尔·马雷尔(Daniel Marell)
这个小示例演示了如何使用您选择的嵌入式 Servlet 容器(Tomcat、Jetty 或 Undertow)设置可运行的 Spring Boot 应用程序。 此示例可用于快速简便的嵌入式容器配置(因此后缀ecc )。 嵌入式Tomcat 此示例显示...
码头客房预订服务 使用Spring Boot和嵌入式Jetty...通常,默认的spring boot应用程序随Tomcat一起提供,我发现想出一个喜欢Jetty的新商业者几乎没有什么麻烦。 因此,我创建了一个带有嵌入式码头的示例弹簧启动应用程序