_guess__jsp.java

来自「《jsp编程起步》里面的所有源代码」· Java 代码 · 共 149 行

JAVA
149
字号
/*
 * JSP generated by Resin 1.2.0 -- Wed Nov  1 07:35:54 PST 2000
 */

package _jsp;
import java.io.*;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import javax.servlet.http.*;
import num.NumberGuessBean;

public class _guess__jsp extends com.caucho.jsp.JavaPage{
  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    com.caucho.jsp.QPageContext pageContext = (com.caucho.jsp.QPageContext) com.caucho.jsp.QJspFactory.create().getPageContext(this, request, response, null, true, 8192, true);
    javax.servlet.jsp.JspWriter out = (javax.servlet.jsp.JspWriter) pageContext.getOut();
    com.caucho.jsp.ByteWriteStream _jsp_raw_out;
    _jsp_raw_out = (com.caucho.jsp.ByteWriteStream) out;
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    javax.servlet.http.HttpSession session = pageContext.getSession();
    javax.servlet.ServletContext application = pageContext.getServletContext();
    response.setContentType("text/html; charset=GB2312");
    try {
      _jsp_raw_out.write(_jsp_string0, 0, _jsp_string0.length);
      _jsp_raw_out.write(_jsp_string1, 0, _jsp_string1.length);
      num.NumberGuessBean numguess;
      synchronized (session) {
        numguess = (num.NumberGuessBean) session.getValue("numguess");
        if (numguess == null) {
          numguess = new num.NumberGuessBean();
          session.putValue("numguess", numguess);
        }
      }
      _jsp_raw_out.write(_jsp_string0, 0, _jsp_string0.length);
      {
        java.lang.String _jspParam;
        java.lang.String []_jspParams;
      _jspParam = request.getParameter("guess");
      if (_jspParam != null && ! _jspParam.equals(""))
        numguess.setGuess(_jspParam);}
      _jsp_raw_out.write(_jsp_string2, 0, _jsp_string2.length);
       if (numguess.getSuccess()) { 
      _jsp_raw_out.write(_jsp_string3, 0, _jsp_string3.length);
      out.print(( numguess.getNumGuesses() ));
      _jsp_raw_out.write(_jsp_string4, 0, _jsp_string4.length);
       numguess.reset(); 
      _jsp_raw_out.write(_jsp_string5, 0, _jsp_string5.length);
       } else if (numguess.getNumGuesses() == 0) { 
      _jsp_raw_out.write(_jsp_string6, 0, _jsp_string6.length);
       } else { 
      _jsp_raw_out.write(_jsp_string7, 0, _jsp_string7.length);
      out.print(( numguess.getHint() ));
      _jsp_raw_out.write(_jsp_string8, 0, _jsp_string8.length);
      out.print(( numguess.getNumGuesses() ));
      _jsp_raw_out.write(_jsp_string9, 0, _jsp_string9.length);
       } 
      _jsp_raw_out.write(_jsp_string10, 0, _jsp_string10.length);
    } catch (java.lang.Throwable e) {
      pageContext.handlePageException(e);
    } finally {
      JspFactory.getDefaultFactory().releasePageContext(pageContext);
    }
  }

  private java.util.ArrayList _caucho_depends;
  private java.util.ArrayList _caucho_cache;
  private com.caucho.java.LineMap _caucho_line_map;

  public boolean _caucho_isModified()
  {
    if (com.caucho.util.CauchoSystem.getVersionId() != -1355223634)
      return true;
    for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
      com.caucho.jsp.Depend depend;
      depend = (com.caucho.jsp.Depend) _caucho_depends.get(i);
      if (depend.isModified())
        return true;
    }
    return false;
  }

  public long _caucho_lastModified()
  {
    return 0;
  }

  public com.caucho.java.LineMap _caucho_getLineMap()
  {
    return _caucho_line_map;
  }

  public void init(com.caucho.java.LineMap lineMap,
                   com.caucho.vfs.Path appDir)
    throws javax.servlet.ServletException
  {
    com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
    com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
    mergePath.addMergePath(appDir);
    mergePath.addMergePath(resinHome);
    mergePath.addClassPath(getClass().getClassLoader());
    _caucho_line_map = new com.caucho.java.LineMap("_guess__jsp.java", "/guess.jsp");
    _caucho_line_map.add(1, 1);
    _caucho_line_map.add(1, 30);
    _caucho_line_map.add(4, 32);
    _caucho_line_map.add(5, 41);
    _caucho_line_map.add(15, 50);
    _caucho_line_map.add(21, 54);
    _caucho_line_map.add(32, 56);
    _caucho_line_map.add(45, 62);
    _caucho_depends = new java.util.ArrayList();
    _caucho_depends.add(new com.caucho.jsp.Depend(appDir.lookup("guess.jsp"), 989146276000L, 1129L));
  }

  private static byte []_jsp_string3;
  private static byte []_jsp_string2;
  private static byte []_jsp_string4;
  private static byte []_jsp_string6;
  private static byte []_jsp_string8;
  private static byte []_jsp_string5;
  private static byte []_jsp_string10;
  private static byte []_jsp_string1;
  private static byte []_jsp_string7;
  private static byte []_jsp_string0;
  private static byte []_jsp_string9;
  static {
    try {
      _jsp_string3 = "\r\n\r\n  恭喜,你猜中了!<br>\r\n  所用次数:".getBytes("GB2312");
      _jsp_string2 = "\r\n\r\n<html>\r\n<head><title>猜数字</title></head>\r\n<body bgcolor=\"white\">\r\n<font size=4>\r\n\r\n".getBytes("GB2312");
      _jsp_string4 = " <br>\r\n\r\n  ".getBytes("GB2312");
      _jsp_string6 = "\r\n\r\n  Welcome to the Number Guess game.<p>\r\n\r\n  I'm thinking of a number between 1 and 100.<p>\r\n\r\n  <form method=get>\r\n  What's your guess? <input type=text name=guess>\r\n  <input type=submit value=\"Submit\">\r\n  </form>\r\n\r\n".getBytes("GB2312");
      _jsp_string8 = "</b>.\r\n\r\n  You have made ".getBytes("GB2312");
      _jsp_string5 = "\r\n\r\n  <a href=\"numguess.jsp\">再来一次吗?</a>?\r\n\r\n".getBytes("GB2312");
      _jsp_string10 = "\r\n\r\n</font>\r\n</body>\r\n</html>\r\n\r\n".getBytes("GB2312");
      _jsp_string1 = "\r\n\r\n".getBytes("GB2312");
      _jsp_string7 = "\r\n\r\n  Good guess, but nope.  Try <b>".getBytes("GB2312");
      _jsp_string0 = "\r\n".getBytes("GB2312");
      _jsp_string9 = " guesses.<p>\r\n\r\n  I'm thinking of a number between 1 and 100.<p>\r\n\r\n  <form method=get>\r\n  What's your guess? <input type=text name=guess>\r\n  <input type=submit value=\"Submit\">\r\n  </form>\r\n\r\n".getBytes("GB2312");
    } catch (java.io.UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?