001    package jsp.colors;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    
007    public final class colrs_jsp extends org.apache.jasper.runtime.HttpJspBase
008        implements org.apache.jasper.runtime.JspSourceDependent {
009    
010      private static java.util.List _jspx_dependants;
011    
012      public Object getDependants() {
013        return _jspx_dependants;
014      }
015    
016      public void _jspService(HttpServletRequest request, HttpServletResponse response)
017            throws java.io.IOException, ServletException {
018    
019        JspFactory _jspxFactory = null;
020        PageContext pageContext = null;
021        HttpSession session = null;
022        ServletContext application = null;
023        ServletConfig config = null;
024        JspWriter out = null;
025        Object page = this;
026        JspWriter _jspx_out = null;
027        PageContext _jspx_page_context = null;
028    
029    
030        try {
031          _jspxFactory = JspFactory.getDefaultFactory();
032          response.setContentType("text/html");
033          pageContext = _jspxFactory.getPageContext(this, request, response,
034                            null, true, 8192, true);
035          _jspx_page_context = pageContext;
036          application = pageContext.getServletContext();
037          config = pageContext.getServletConfig();
038          session = pageContext.getSession();
039          out = pageContext.getOut();
040          _jspx_out = out;
041    
042          out.write("<html>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n  contributor license agreements.  See the NOTICE file distributed with\n  this work for additional information regarding copyright ownership.\n  The ASF licenses this file to You under the Apache License, Version 2.0\n  (the \"License\"); you may not use this file except in compliance with\n  the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n-->\n\n");
043          colors.ColorGameBean cb = null;
044          synchronized (session) {
045            cb = (colors.ColorGameBean) _jspx_page_context.getAttribute("cb", PageContext.SESSION_SCOPE);
046            if (cb == null){
047              cb = new colors.ColorGameBean();
048              _jspx_page_context.setAttribute("cb", cb, PageContext.SESSION_SCOPE);
049            }
050          }
051          out.write('\n');
052          org.apache.jasper.runtime.JspRuntimeLibrary.introspect(_jspx_page_context.findAttribute("cb"), request);
053          out.write('\n');
054          out.write('\n');
055    
056            cb.processRequest(request);
057    
058          out.write("\n\n<body bgcolor=");
059          out.print( cb.getColor1() );
060          out.write(">\n<font size=6 color=");
061          out.print( cb.getColor2() );
062          out.write(">\n<p>\n\n");
063     if (cb.getHint()==true) { 
064          out.write("\n\t\n\t<p> Hint #1: Vampires prey at night!\n\t<p>  <p> Hint #2: Nancy without the n.\n\n");
065     } 
066          out.write('\n');
067          out.write('\n');
068     if  (cb.getSuccess()==true) { 
069          out.write("\n\n    <p> CONGRATULATIONS!!\n\t");
070     if  (cb.getHintTaken()==true) { 
071          out.write("\n    \n        <p> ( although I know you cheated and peeked into the hints)\n\n\t");
072     } 
073          out.write('\n');
074          out.write('\n');
075     } 
076          out.write("\n\n<p> Total attempts so far: ");
077          out.print( cb.getAttempts() );
078          out.write("\n<p>\n\n<p>\n\n<form method=POST action=colrs.jsp>\n\nColor #1: <input type=text name= color1 size=16>\n\n<br>\n\nColor #2: <input type=text name= color2 size=16>\n\n<p>\n\n<input type=submit name=action value=\"Submit\">\n<input type=submit name=action value=\"Hint\">\n\n</form>\n\n</font>\n</body>\n</html>\n");
079        } catch (Throwable t) {
080          if (!(t instanceof SkipPageException)){
081            out = _jspx_out;
082            if (out != null && out.getBufferSize() != 0)
083              out.clearBuffer();
084            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
085          }
086        } finally {
087          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
088        }
089      }
090    }