package coreservlets;



import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.net.*;




public class SearchEngines extends HttpServle " /> 成人在线视频免费看,国产一区二区三区免费在线观看,久久久国产精品视频

四虎精品视频-四虎精品成人免费网站-四虎黄色网-四虎国产视频-国产免费91-国产蜜臀97一区二区三区

jsp搜索引擎


package coreservlets; 



import Java.io.*; 
import Javax.servlet.*; 
import Javax.servlet.http.*; 
import Java.NET.*; 




public class SearchEngines extends HttpServlet { 
public void doGet(HttpServletRequest request, 
HttpServletResponse response) 
throws ServletException, IOException { 
String searchString = request.getParameter("searchString"); 
if ((searchString == null) 

(searchString.length() == 0)) { 
reportProblem(response, "Missing search string."); 
return; 

// The URLEncoder changes spaces to "+" signs and other 
// non-alphanumeric characters to "%XY", where XY is the 
// hex value of the ASCII (or ISO Latin-1) character. 
// Browsers always URL-encode form values, so the 
// getParameter method decodes automatically. But since 
// we"re just passing this on to another server, we need to 
// re-encode it. 
searchString = URLEncoder.encode(searchString); 
String numResults = request.getParameter("numResults"); 
if ((numResults == null) 

(numResults.equals("0")) 

(numResults.length() == 0)) { 
numResults = "10"; 

String searchEngine = 
request.getParameter("searchEngine"); 
if (searchEngine == null) { 
reportProblem(response, "Missing search engine name."); 
return; 

SearchSpec[] commonSpecs = SearchSpec.getCommonSpecs(); 
for(int i=0; i<commonSpecs.length; i++) { 
SearchSpec searchSpec = commonSpecs[i]; 
if (searchSpec.getName().equals(searchEngine)) { 
String url = 
searchSpec.makeURL(searchString, numResults); 
response.sendRedirect(url); 
return; 


reportProblem(response, "Unrecognized search engine."); 




private void reportProblem(HttpServletResponse response, 
String message) 
throws IOException { 
response.sendError(response.SC_NOT_FOUND, 
"<H2>" + message + "</H2>"); 




public void doPost(HttpServletRequest request, 
HttpServletResponse response) 
throws ServletException, IOException { 
doGet(request, response); 


jsp技術(shù)jsp搜索引擎,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 神经刀| 追捕演员表| 追捕演员表| 韩国我的养父电影免费观看| 欢乐的牧童钢琴谱| 在线播放你懂| 南通紫琅音乐节| squirt cytherea video| 勇敢的心演员表| 说木叶原文| xxxxxxxxxxxxx| 霹雳俏娇娃| 李采潭全部电影作品| 伸舌头接吻脱裤子| 德兰| douying| 黄婉| 从此以后歌词| 成人在线影片| xxoo电影| 真实游戏完整版高清观看| 成人免费视频观看视频| 去有风的地方| 上海东方卫视节目表| 协议过户什么意思| 底线电影| 艳妇乳肉豪妇荡乳ⅹxxo电影| 电影《德拉夫人》在线观看| 杨英格| 一类生字和二类生字图| 护士韩国电影| 《金色花》阅读理解答案| 三级大片在线观看| 搏击俱乐部豆瓣| 护花使者歌词| 最新电影免费观看| 扭曲的欲望| 行政职业能力测试2024题库及答案 | 曹查理的十部经典电影| 帕米尔我的家乡多么美简谱| 诗歌繁星|