diff --git a/WEB-INF/work/_jsp/_calculator__jsp.class b/WEB-INF/work/_jsp/_calculator__jsp.class index 7e013ad..21e2aa9 100644 Binary files a/WEB-INF/work/_jsp/_calculator__jsp.class and b/WEB-INF/work/_jsp/_calculator__jsp.class differ diff --git a/WEB-INF/work/_jsp/_calculator__jsp.java b/WEB-INF/work/_jsp/_calculator__jsp.java index 6bfc86e..53d7113 100644 --- a/WEB-INF/work/_jsp/_calculator__jsp.java +++ b/WEB-INF/work/_jsp/_calculator__jsp.java @@ -17,9 +17,10 @@ public class _calculator__jsp extends com.caucho.jsp.JavaPage javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { + javax.servlet.http.HttpSession session = request.getSession(true); com.caucho.server.webapp.WebApp _jsp_application = _caucho_getApplication(); javax.servlet.ServletContext application = _jsp_application; - com.caucho.jsp.PageContextImpl pageContext = _jsp_application.getJspApplicationContext().allocatePageContext(this, _jsp_application, request, response, null, null, 8192, true, false); + com.caucho.jsp.PageContextImpl pageContext = _jsp_application.getJspApplicationContext().allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true, false); javax.servlet.jsp.PageContext _jsp_parentContext = pageContext; javax.servlet.jsp.JspWriter out = pageContext.getOut(); final javax.el.ELContext _jsp_env = pageContext.getELContext(); @@ -29,6 +30,31 @@ public class _calculator__jsp extends com.caucho.jsp.JavaPage request.setCharacterEncoding("Big5"); try { out.write(_jsp_string0, 0, _jsp_string0.length); + + String inputdata = request.getParameter("symbol"); + + if(inputdata == null) { + + + out.write(_jsp_string1, 0, _jsp_string1.length); + + } + else { + + try{ + //int data = Integer.parseInt(inputdata); + out.println(inputdata); + + out.write(_jsp_string2, 0, _jsp_string2.length); + + } + catch(NumberFormatException e) { + throw new NumberFormatException("\ufffd\u523b\u6493\ufffd\u4ea6\ufffd\ufffd\u929d\ufffd\ufffd\u8200\ufffd\u6e54\ufffd\ufffd"); + } + + } + + out.write(_jsp_string3, 0, _jsp_string3.length); } catch (java.lang.Throwable _jsp_e) { pageContext.handlePageException(_jsp_e); } finally { @@ -102,12 +128,18 @@ public class _calculator__jsp extends com.caucho.jsp.JavaPage String resourcePath = loader.getResourcePathSpecificFirst(); mergePath.addClassPath(resourcePath); com.caucho.vfs.Depend depend; - depend = new com.caucho.vfs.Depend(appDir.lookup("calculator.jsp"), 1898269132803111951L, false); + depend = new com.caucho.vfs.Depend(appDir.lookup("calculator.jsp"), 3495430881658896476L, false); com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend); } private final static char []_jsp_string0; + private final static char []_jsp_string1; + private final static char []_jsp_string3; + private final static char []_jsp_string2; static { - _jsp_string0 = "\n\n \n Calculator \n \n\n \n
\n

\n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n

\n
\n \n".toCharArray(); + _jsp_string0 = "\n\n \n Calculator \n \n\n \n

Calculator

\n ".toCharArray(); + _jsp_string1 = "\n\n
\n

\n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n

\n
\n\n ".toCharArray(); + _jsp_string3 = " \n \n".toCharArray(); + _jsp_string2 = "\n
\n

\n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n

\n
\n ".toCharArray(); } } diff --git a/WEB-INF/work/_jsp/_calculator__jsp.java.smap b/WEB-INF/work/_jsp/_calculator__jsp.java.smap index 3fa0f9a..20098f1 100644 --- a/WEB-INF/work/_jsp/_calculator__jsp.java.smap +++ b/WEB-INF/work/_jsp/_calculator__jsp.java.smap @@ -6,6 +6,12 @@ JSP + 1 calculator.jsp calculator.jsp *L -1#1:31 -50#1:32 +1#1:32 +9#1,6:33 +14#1:39 +52#1,8:40 +59#1:48 +95#1,8:49 +102#1:57 +104#1:58 *E diff --git a/calculator.jsp b/calculator.jsp index df8850c..bbed951 100644 --- a/calculator.jsp +++ b/calculator.jsp @@ -5,46 +5,100 @@ -
-

- -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - - - - - - - -

-
+

Calculator

+ <% + String inputdata = request.getParameter("symbol"); + + if(inputdata == null) { + + %> + +
+

+ +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +

+
+ + <% + } + else { + + try{ + //int data = Integer.parseInt(inputdata); + out.println(inputdata); + %> +
+

+ +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +

+
+ <% + } + catch(NumberFormatException e) { + throw new NumberFormatException("您輸入的不是整數"); + } + + } + %> \ No newline at end of file