home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / implicit_002dobjects_jsp.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-05-17  |  6.7 KB  |  92 lines

  1. package org.apache.jsp.jsp2.el;
  2.  
  3. import java.io.IOException;
  4. import java.util.List;
  5. import java.util.Vector;
  6. import javax.servlet.ServletConfig;
  7. import javax.servlet.ServletContext;
  8. import javax.servlet.ServletException;
  9. import javax.servlet.http.HttpServletRequest;
  10. import javax.servlet.http.HttpServletResponse;
  11. import javax.servlet.http.HttpSession;
  12. import javax.servlet.jsp.JspFactory;
  13. import javax.servlet.jsp.JspWriter;
  14. import javax.servlet.jsp.PageContext;
  15. import javax.servlet.jsp.SkipPageException;
  16. import org.apache.jasper.runtime.HttpJspBase;
  17. import org.apache.jasper.runtime.JspSourceDependent;
  18. import org.apache.jasper.runtime.PageContextImpl;
  19. import org.apache.jasper.runtime.ProtectedFunctionMapper;
  20.  
  21. public final class implicit_002dobjects_jsp extends HttpJspBase implements JspSourceDependent {
  22.    private static Vector _jspx_dependants;
  23.    // $FF: synthetic field
  24.    static Class class$java$lang$String;
  25.  
  26.    public List getDependants() {
  27.       return _jspx_dependants;
  28.    }
  29.  
  30.    public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  31.       JspFactory _jspxFactory = null;
  32.       PageContext pageContext = null;
  33.       HttpSession session = null;
  34.       ServletContext application = null;
  35.       ServletConfig config = null;
  36.       JspWriter out = null;
  37.       JspWriter _jspx_out = null;
  38.       PageContext _jspx_page_context = null;
  39.  
  40.       try {
  41.          _jspxFactory = JspFactory.getDefaultFactory();
  42.          response.setContentType("text/html");
  43.          pageContext = _jspxFactory.getPageContext(this, request, response, (String)null, true, 8192, true);
  44.          _jspx_page_context = pageContext;
  45.          application = pageContext.getServletContext();
  46.          config = pageContext.getServletConfig();
  47.          session = pageContext.getSession();
  48.          out = pageContext.getOut();
  49.          out.write("<!--\r\n  Copyright 2004 The Apache Software Foundation\r\n\r\n  Licensed under the Apache License, Version 2.0 (the \"License\");\r\n  you may not use this file except in compliance with the License.\r\n  You may obtain a copy of the License at\r\n\r\n      http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n  Unless required by applicable law or agreed to in writing, software\r\n  distributed under the License is distributed on an \"AS IS\" BASIS,\r\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n  See the License for the specific language governing permissions and\r\n  limitations under the License.\r\n-->\r\n<html>\r\n  <head>\r\n    <title>JSP 2.0 Expression Language - Implicit Objects</title>\r\n  </head>\r\n  <body>\r\n    <h1>JSP 2.0 Expression Language - Implicit Objects</h1>\r\n    <hr>\r\n    This example illustrates some of the implicit objects available \r\n    in the Expression Lanaguage.  The following implicit objects are \r\n    available (not all illustrated here):\r\n    <ul>\r\n      <li>pageContext - the PageContext object</li>\r\n");
  50.          out.write("      <li>pageScope - a Map that maps page-scoped attribute names to \r\n          their values</li>\r\n      <li>requestScope - a Map that maps request-scoped attribute names \r\n          to their values</li>\r\n      <li>sessionScope - a Map that maps session-scoped attribute names \r\n          to their values</li>\r\n      <li>applicationScope - a Map that maps application-scoped attribute \r\n          names to their values</li>\r\n      <li>param - a Map that maps parameter names to a single String \r\n          parameter value</li>\r\n      <li>paramValues - a Map that maps parameter names to a String[] of \r\n          all values for that parameter</li>\r\n      <li>header - a Map that maps header names to a single String \r\n          header value</li>\r\n      <li>headerValues - a Map that maps header names to a String[] of \r\n          all values for that header</li>\r\n      <li>initParam - a Map that maps context initialization parameter \r\n          names to their String parameter value</li>\r\n      <li>cookie - a Map that maps cookie names to a single Cookie object.</li>\r\n");
  51.          out.write("    </ul>\r\n\r\n    <blockquote>\r\n      <u><b>Change Parameter</b></u>\r\n      <form action=\"implicit-objects.jsp\" method=\"GET\">\r\n\t  foo = <input type=\"text\" name=\"foo\" value=\"");
  52.          out.write((String)PageContextImpl.proprietaryEvaluate("${param[\"foo\"]}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  53.          out.write("\">\r\n          <input type=\"submit\">\r\n      </form>\r\n      <br>\r\n      <code>\r\n        <table border=\"1\">\r\n          <thead>\r\n\t    <td><b>EL Expression</b></td>\r\n\t    <td><b>Result</b></td>\r\n\t  </thead>\r\n\t  <tr>\r\n\t    <td>${param.foo}</td>\r\n\t    <td>");
  54.          out.write((String)PageContextImpl.proprietaryEvaluate("${param.foo}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  55.          out.write(" </td>\r\n\t  </tr>\r\n\t  <tr>\r\n\t    <td>${param[\"foo\"]}</td>\r\n\t    <td>");
  56.          out.write((String)PageContextImpl.proprietaryEvaluate("${param[\"foo\"]}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  57.          out.write(" </td>\r\n\t  </tr>\r\n\t  <tr>\r\n\t    <td>${header[\"host\"]}</td>\r\n\t    <td>");
  58.          out.write((String)PageContextImpl.proprietaryEvaluate("${header[\"host\"]}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  59.          out.write("</td>\r\n\t  </tr>\r\n\t  <tr>\r\n\t    <td>${header[\"accept\"]}</td>\r\n\t    <td>");
  60.          out.write((String)PageContextImpl.proprietaryEvaluate("${header[\"accept\"]}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  61.          out.write("</td>\r\n\t  </tr>\r\n\t  <tr>\r\n\t    <td>${header[\"user-agent\"]}</td>\r\n\t    <td>");
  62.          out.write((String)PageContextImpl.proprietaryEvaluate("${header[\"user-agent\"]}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  63.          out.write("</td>\r\n\t  </tr>\r\n\t</table>\r\n      </code>\r\n    </blockquote>\r\n  </body>\r\n</html>\r\n");
  64.       } catch (Throwable t) {
  65.          if (!(t instanceof SkipPageException)) {
  66.             if (_jspx_out != null && _jspx_out.getBufferSize() != 0) {
  67.                _jspx_out.clearBuffer();
  68.             }
  69.  
  70.             if (_jspx_page_context != null) {
  71.                _jspx_page_context.handlePageException(t);
  72.             }
  73.          }
  74.       } finally {
  75.          if (_jspxFactory != null) {
  76.             _jspxFactory.releasePageContext(_jspx_page_context);
  77.          }
  78.  
  79.       }
  80.  
  81.    }
  82.  
  83.    // $FF: synthetic method
  84.    static Class class$(String x0) {
  85.       try {
  86.          return Class.forName(x0);
  87.       } catch (ClassNotFoundException x1) {
  88.          throw new NoClassDefFoundError(x1.getMessage());
  89.       }
  90.    }
  91. }
  92.