校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識(shí)庫 > jsp搜索引擎

jsp搜索引擎

熱門標(biāo)簽:長春回?fù)芡夂粝到y(tǒng)廠家 電銷外呼系統(tǒng) 排行榜 外呼系統(tǒng)啥意思 地圖標(biāo)注創(chuàng)業(yè)項(xiàng)目入駐 四川電信外呼系統(tǒng)靠譜嗎 山東智能云外呼管理系統(tǒng) 廣州三五防封電銷卡 地圖標(biāo)注制作道路 珠海銷售外呼系統(tǒng)運(yùn)營商

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; icommonSpecs.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網(wǎng)頁搜索結(jié)果中實(shí)現(xiàn)選中一行使其高亮
  • jsp源碼實(shí)例4(搜索引擎)
  • php+ajax做仿百度搜索下拉自動(dòng)提示框(有實(shí)例)
  • asp+ajax仿google搜索提示效果代碼
  • jquery創(chuàng)建一個(gè)ajax關(guān)鍵詞數(shù)據(jù)搜索實(shí)現(xiàn)思路
  • asp.net和ajax實(shí)現(xiàn)智能搜索功能代碼
  • ThinkPHP實(shí)現(xiàn)ajax仿官網(wǎng)搜索功能實(shí)例
  • php+ajax實(shí)時(shí)輸入自動(dòng)搜索匹配的方法
  • ajax Suggest類似google的搜索提示效果
  • Ajax+Servlet+jsp顯示搜索效果

標(biāo)簽:玉樹 吳忠 紹興 肇慶 潮州 北海 保定 廣元

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《jsp搜索引擎》,本文關(guān)鍵詞  jsp,搜索引擎,jsp,搜索引擎,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《jsp搜索引擎》相關(guān)的同類信息!
  • 本頁收集關(guān)于jsp搜索引擎的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 辉县市| 蕲春县| 淮滨县| 南平市| 星座| 七台河市| 南开区| 兴文县| 志丹县| 邳州市| 长葛市| 色达县| 新乡市| 甘孜| 喜德县| 策勒县| 贵港市| 通榆县| 余干县| 高陵县| 巴中市| 马鞍山市| 克拉玛依市| 丘北县| 温州市| 河西区| 手机| 杂多县| 会泽县| 安泽县| 喀什市| 荥经县| 扎赉特旗| 抚州市| 陆良县| 休宁县| 抚松县| 和平区| 旬阳县| 泸溪县| 顺平县|