source: nutchez-0.1/tomcat/work/Catalina/localhost/_/org/apache/jsp/explain_jsp.java @ 66

Last change on this file since 66 was 66, checked in by waue, 15 years ago

NutchEz - an easy way to nutch

File size: 13.5 KB
Line 
1package org.apache.jsp;
2
3import javax.servlet.*;
4import javax.servlet.http.*;
5import javax.servlet.jsp.*;
6import java.io.*;
7import java.util.*;
8import org.apache.nutch.searcher.*;
9import org.apache.hadoop.conf.Configuration;
10import org.apache.nutch.util.NutchConfiguration;
11
12public final class explain_jsp extends org.apache.jasper.runtime.HttpJspBase
13    implements org.apache.jasper.runtime.JspSourceDependent {
14
15  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
16
17  private static java.util.List _jspx_dependants;
18
19  static {
20    _jspx_dependants = new java.util.ArrayList(1);
21    _jspx_dependants.add("/WEB-INF/taglibs-i18n.tld");
22  }
23
24  private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fi18n_005fbundle_0026_005fbaseName_005fnobody;
25  private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody;
26  private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey;
27  private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fi18n_005fmessageArg_0026_005fvalue_005fnobody;
28
29  private javax.el.ExpressionFactory _el_expressionfactory;
30  private org.apache.AnnotationProcessor _jsp_annotationprocessor;
31
32  public Object getDependants() {
33    return _jspx_dependants;
34  }
35
36  public void _jspInit() {
37    _005fjspx_005ftagPool_005fi18n_005fbundle_0026_005fbaseName_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
38    _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
39    _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
40    _005fjspx_005ftagPool_005fi18n_005fmessageArg_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
41    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
42    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
43  }
44
45  public void _jspDestroy() {
46    _005fjspx_005ftagPool_005fi18n_005fbundle_0026_005fbaseName_005fnobody.release();
47    _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody.release();
48    _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey.release();
49    _005fjspx_005ftagPool_005fi18n_005fmessageArg_0026_005fvalue_005fnobody.release();
50  }
51
52  public void _jspService(HttpServletRequest request, HttpServletResponse response)
53        throws java.io.IOException, ServletException {
54
55    PageContext pageContext = null;
56    ServletContext application = null;
57    ServletConfig config = null;
58    JspWriter out = null;
59    Object page = this;
60    JspWriter _jspx_out = null;
61    PageContext _jspx_page_context = null;
62
63
64    try {
65      response.setContentType("text/html; charset=UTF-8");
66      pageContext = _jspxFactory.getPageContext(this, request, response,
67            null, false, 8192, true);
68      _jspx_page_context = pageContext;
69      application = pageContext.getServletContext();
70      config = pageContext.getServletConfig();
71      out = pageContext.getOut();
72      _jspx_out = out;
73
74      out.write('\n');
75
76  Configuration nutchConf = NutchConfiguration.get(application);
77  NutchBean bean = NutchBean.get(application, nutchConf);
78  // set the character encoding to use when interpreting request values
79  request.setCharacterEncoding("UTF-8");
80  bean.LOG.info("explain request from " + request.getRemoteAddr());
81  Hit hit = new Hit(Integer.parseInt(request.getParameter("idx")),
82                    request.getParameter("id"));
83  HitDetails details = bean.getDetails(hit);
84  // get the lang from request
85  String queryLang = request.getParameter("lang");
86  if (queryLang == null) { queryLang = ""; }
87  Query query = Query.parse(request.getParameter("query"), queryLang, nutchConf);
88  String language =
89    ResourceBundle.getBundle("org.nutch.jsp.explain", request.getLocale())
90    .getLocale().getLanguage();
91  String requestURI = HttpUtils.getRequestURL(request).toString();
92  String base = requestURI.substring(0, requestURI.lastIndexOf('/'));
93
94      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
95
96  // To prevent the character encoding declared with 'contentType' page
97  // directive from being overriden by JSTL (apache i18n), we freeze it
98  // by flushing the output buffer.
99  // see http://java.sun.com/developer/technicalArticles/Intl/MultilingualJSP/
100  out.flush();
101
102      out.write('\n');
103      out.write('\n');
104      if (_jspx_meth_i18n_005fbundle_005f0(_jspx_page_context))
105        return;
106      out.write("\n");
107      out.write("<html lang=\"");
108      out.print( language );
109      out.write("\">\n");
110      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
111      out.write("<head>\n");
112      out.write("<title>Nutch: ");
113      if (_jspx_meth_i18n_005fmessage_005f0(_jspx_page_context))
114        return;
115      out.write("</title>\n");
116      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "/include/style.html", out, false);
117      out.write("\n");
118      out.write("<base href=\"");
119      out.print( base  + "/" + language );
120      out.write("/\">\n");
121      out.write("</head>\n");
122      out.write("\n");
123      out.write("<body>\n");
124      out.write("\n");
125      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response,  language + "/include/header.html", out, false);
126      out.write("\n");
127      out.write("\n");
128      out.write("<h3>");
129      if (_jspx_meth_i18n_005fmessage_005f1(_jspx_page_context))
130        return;
131      out.write("</h3>\n");
132      out.write("\n");
133      out.print(bean.getDetails(hit).toHtml());
134      out.write("\n");
135      out.write("\n");
136      out.write("<h3>");
137      //  i18n:message
138      org.apache.taglibs.i18n.MessageTag _jspx_th_i18n_005fmessage_005f2 = (org.apache.taglibs.i18n.MessageTag) _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey.get(org.apache.taglibs.i18n.MessageTag.class);
139      _jspx_th_i18n_005fmessage_005f2.setPageContext(_jspx_page_context);
140      _jspx_th_i18n_005fmessage_005f2.setParent(null);
141      // /explain.jsp(71,4) name = key type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
142      _jspx_th_i18n_005fmessage_005f2.setKey("scoreForQuery");
143      int _jspx_eval_i18n_005fmessage_005f2 = _jspx_th_i18n_005fmessage_005f2.doStartTag();
144      if (_jspx_eval_i18n_005fmessage_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
145        if (_jspx_eval_i18n_005fmessage_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
146          out = _jspx_page_context.pushBody();
147          _jspx_th_i18n_005fmessage_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
148          _jspx_th_i18n_005fmessage_005f2.doInitBody();
149        }
150        do {
151          out.write('\n');
152          out.write(' ');
153          out.write(' ');
154          //  i18n:messageArg
155          org.apache.taglibs.i18n.MessageArgumentTag _jspx_th_i18n_005fmessageArg_005f0 = (org.apache.taglibs.i18n.MessageArgumentTag) _005fjspx_005ftagPool_005fi18n_005fmessageArg_0026_005fvalue_005fnobody.get(org.apache.taglibs.i18n.MessageArgumentTag.class);
156          _jspx_th_i18n_005fmessageArg_005f0.setPageContext(_jspx_page_context);
157          _jspx_th_i18n_005fmessageArg_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_i18n_005fmessage_005f2);
158          // /explain.jsp(72,2) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
159          _jspx_th_i18n_005fmessageArg_005f0.setValue(query);
160          int _jspx_eval_i18n_005fmessageArg_005f0 = _jspx_th_i18n_005fmessageArg_005f0.doStartTag();
161          if (_jspx_th_i18n_005fmessageArg_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
162            _005fjspx_005ftagPool_005fi18n_005fmessageArg_0026_005fvalue_005fnobody.reuse(_jspx_th_i18n_005fmessageArg_005f0);
163            return;
164          }
165          _005fjspx_005ftagPool_005fi18n_005fmessageArg_0026_005fvalue_005fnobody.reuse(_jspx_th_i18n_005fmessageArg_005f0);
166          out.write('\n');
167          int evalDoAfterBody = _jspx_th_i18n_005fmessage_005f2.doAfterBody();
168          if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
169            break;
170        } while (true);
171        if (_jspx_eval_i18n_005fmessage_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
172          out = _jspx_page_context.popBody();
173        }
174      }
175      if (_jspx_th_i18n_005fmessage_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
176        _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey.reuse(_jspx_th_i18n_005fmessage_005f2);
177        return;
178      }
179      _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey.reuse(_jspx_th_i18n_005fmessage_005f2);
180      out.write("\n");
181      out.write("</h3>\n");
182      out.write("\n");
183      out.print(bean.getExplanation(query, hit));
184      out.write('\n');
185      out.write('\n');
186      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "/include/footer.html", out, false);
187      out.write("\n");
188      out.write("\n");
189      out.write("</body>     \n");
190      out.write("</html>\n");
191    } catch (Throwable t) {
192      if (!(t instanceof SkipPageException)){
193        out = _jspx_out;
194        if (out != null && out.getBufferSize() != 0)
195          try { out.clearBuffer(); } catch (java.io.IOException e) {}
196        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
197      }
198    } finally {
199      _jspxFactory.releasePageContext(_jspx_page_context);
200    }
201  }
202
203  private boolean _jspx_meth_i18n_005fbundle_005f0(PageContext _jspx_page_context)
204          throws Throwable {
205    PageContext pageContext = _jspx_page_context;
206    JspWriter out = _jspx_page_context.getOut();
207    //  i18n:bundle
208    org.apache.taglibs.i18n.BundleTag _jspx_th_i18n_005fbundle_005f0 = (org.apache.taglibs.i18n.BundleTag) _005fjspx_005ftagPool_005fi18n_005fbundle_0026_005fbaseName_005fnobody.get(org.apache.taglibs.i18n.BundleTag.class);
209    _jspx_th_i18n_005fbundle_005f0.setPageContext(_jspx_page_context);
210    _jspx_th_i18n_005fbundle_005f0.setParent(null);
211    // /explain.jsp(54,0) name = baseName type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
212    _jspx_th_i18n_005fbundle_005f0.setBaseName("org.nutch.jsp.explain");
213    int _jspx_eval_i18n_005fbundle_005f0 = _jspx_th_i18n_005fbundle_005f0.doStartTag();
214    if (_jspx_th_i18n_005fbundle_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
215      _005fjspx_005ftagPool_005fi18n_005fbundle_0026_005fbaseName_005fnobody.reuse(_jspx_th_i18n_005fbundle_005f0);
216      return true;
217    }
218    _005fjspx_005ftagPool_005fi18n_005fbundle_0026_005fbaseName_005fnobody.reuse(_jspx_th_i18n_005fbundle_005f0);
219    return false;
220  }
221
222  private boolean _jspx_meth_i18n_005fmessage_005f0(PageContext _jspx_page_context)
223          throws Throwable {
224    PageContext pageContext = _jspx_page_context;
225    JspWriter out = _jspx_page_context.getOut();
226    //  i18n:message
227    org.apache.taglibs.i18n.MessageTag _jspx_th_i18n_005fmessage_005f0 = (org.apache.taglibs.i18n.MessageTag) _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.i18n.MessageTag.class);
228    _jspx_th_i18n_005fmessage_005f0.setPageContext(_jspx_page_context);
229    _jspx_th_i18n_005fmessage_005f0.setParent(null);
230    // /explain.jsp(58,14) name = key type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
231    _jspx_th_i18n_005fmessage_005f0.setKey("title");
232    int _jspx_eval_i18n_005fmessage_005f0 = _jspx_th_i18n_005fmessage_005f0.doStartTag();
233    if (_jspx_th_i18n_005fmessage_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
234      _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_i18n_005fmessage_005f0);
235      return true;
236    }
237    _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_i18n_005fmessage_005f0);
238    return false;
239  }
240
241  private boolean _jspx_meth_i18n_005fmessage_005f1(PageContext _jspx_page_context)
242          throws Throwable {
243    PageContext pageContext = _jspx_page_context;
244    JspWriter out = _jspx_page_context.getOut();
245    //  i18n:message
246    org.apache.taglibs.i18n.MessageTag _jspx_th_i18n_005fmessage_005f1 = (org.apache.taglibs.i18n.MessageTag) _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.i18n.MessageTag.class);
247    _jspx_th_i18n_005fmessage_005f1.setPageContext(_jspx_page_context);
248    _jspx_th_i18n_005fmessage_005f1.setParent(null);
249    // /explain.jsp(67,4) name = key type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
250    _jspx_th_i18n_005fmessage_005f1.setKey("page");
251    int _jspx_eval_i18n_005fmessage_005f1 = _jspx_th_i18n_005fmessage_005f1.doStartTag();
252    if (_jspx_th_i18n_005fmessage_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
253      _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_i18n_005fmessage_005f1);
254      return true;
255    }
256    _005fjspx_005ftagPool_005fi18n_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_i18n_005fmessage_005f1);
257    return false;
258  }
259}
Note: See TracBrowser for help on using the repository browser.