2012-01-25 02:38:49 +00:00
|
|
|
<%@page contentType="text/html"%>
|
|
|
|
<%@page pageEncoding="UTF-8"%>
|
2012-03-01 23:46:06 +00:00
|
|
|
<%
|
|
|
|
// http://www.crazysquirrel.com/computing/general/form-encoding.jspx
|
|
|
|
if (request.getCharacterEncoding() == null)
|
|
|
|
request.setCharacterEncoding("UTF-8");
|
2018-07-28 19:03:01 +00:00
|
|
|
String i2pcontextId = null;
|
|
|
|
try {
|
|
|
|
i2pcontextId = (String) session.getAttribute("i2p.contextId");
|
|
|
|
} catch (IllegalStateException ise) {}
|
2012-03-01 23:46:06 +00:00
|
|
|
%>
|
2017-12-01 14:07:29 +00:00
|
|
|
<jsp:useBean class="net.i2p.router.web.helpers.SearchHelper" id="searchhelper" scope="request" />
|
2018-07-28 19:03:01 +00:00
|
|
|
<jsp:setProperty name="searchhelper" property="contextId" value="<%=i2pcontextId%>" />
|
2012-03-04 02:48:47 +00:00
|
|
|
<jsp:setProperty name="searchhelper" property="engine" value="<%=request.getParameter(\"engine\")%>" />
|
|
|
|
<jsp:setProperty name="searchhelper" property="query" value="<%=request.getParameter(\"query\")%>" />
|
2012-01-25 02:38:49 +00:00
|
|
|
<html><head></head><body><b>
|
|
|
|
<%
|
|
|
|
String url = searchhelper.getURL();
|
|
|
|
if (url != null) {
|
2013-12-09 20:45:11 +00:00
|
|
|
response.setStatus(303);
|
2012-01-25 02:38:49 +00:00
|
|
|
response.setHeader("Location", url);
|
|
|
|
%>
|
|
|
|
Searching...
|
|
|
|
<%
|
|
|
|
} else {
|
2016-10-21 21:38:55 +00:00
|
|
|
response.setStatus(403);
|
2012-01-25 02:38:49 +00:00
|
|
|
String query = request.getParameter("query");
|
|
|
|
if (query == null || query.trim().length() <= 0) {
|
|
|
|
%>
|
|
|
|
No search string specified!
|
|
|
|
<%
|
|
|
|
} else if (request.getParameter("engine") == null) {
|
|
|
|
%>
|
|
|
|
No search engine specified!
|
|
|
|
<%
|
|
|
|
} else {
|
|
|
|
%>
|
|
|
|
No search engines found!
|
|
|
|
<%
|
|
|
|
}
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
</b></body></html>
|