You just entered the number 0
The running total is now 0

For mobile smartphone device with full browser use this meta tag in the header:
<meta name="viewport" content="width=device-width, initial-scale=2, maximum-scale=2">
so page is bigger by default and the user doesn't have to zoom in. Also force numeric pad to come up
using type="number"


____________________________________

JSP page source:

<! krg Jun 2011 jsp Addition Example - one file only Mobile (no .HTML)
<%@ page language="java" %>
<HTML>
<HEAD>
<TITLE>Simple Addition Example Mobile .JSP file only</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=2, maximum-scale=2">
</HEAD>
<BODY>
<P>
</p><form action="additionm.jsp" method="get">
<INPUT SIZE="12" TYPE="number" NAME="userinput">
<INPUT TYPE="SUBMIT" value="Add" name="NumberToAdd">
</FORM>
<p>
<%! // Declaration of class wide instance variables
int NumberEntered; // number submitted from html page
int Total;// running tolal of numbers entered
%>
<%
String input;
input = (request.getParameter("userinput"));
if (input != null)
NumberEntered = Integer.parseInt(input); // try to extract an integer
Total += NumberEntered;
%>
<%= "You just entered the number " + NumberEntered %> <BR>
<%= "The running total is now " + Total %> <BR>
</P>
</p>
<pre>For mobile smartphone device with full browser use this meta tag in the header:
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=2, maximum-scale=2&quot;&gt;
so page is bigger by default and the user doesn't have to zoom in.

____________________________________

JSP page source:
&lt;! krg Jan 08 jsp Addition Example - one file only (no .HTML)<br>&lt;%@ page language=&quot;java&quot; %&gt;<br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;TITLE&gt;Simple Addition Example Mobile .JSP file only&lt;/TITLE&gt;<br>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=2, maximum-scale=2&quot;&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;P&gt;<br>&lt;/p&gt;&lt;form action=&quot;additionm.jsp&quot; method=&quot;get&quot;&gt;<br>&lt;INPUT SIZE=&quot;12&quot; NAME=&quot;userinput&quot;&gt;<br>&lt;INPUT TYPE=&quot;SUBMIT&quot; value=&quot;Add&quot; name=&quot;NumberToAdd&quot;&gt;<br>&lt;/FORM&gt;<br> &lt;p&gt;<br> &lt;%! // Declaration of class wide instance variables<br> int NumberEntered; // number submitted from html page<br> int Total;// running tolal of numbers entered<br> %&gt; <br> &lt;% <br> String input;<br> input = (request.getParameter(&quot;userinput&quot;));<br> if (input != null)<br> NumberEntered = Integer.parseInt(input); // try to extract an integer<br> Total += NumberEntered;<br> %&gt;<br> &lt;%= &quot;You just entered the number &quot; + NumberEntered %&gt; &lt;BR&gt;<br> &lt;%= &quot;The running total is now &quot; + Total %&gt; &lt;BR&gt;<br> &lt;/P&gt;<br> &lt;/p&gt;<br> &lt;pre&gt;For mobile divice use this meta tag in the header:<br>&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=2, maximum-scale=2&amp;quot;&amp;gt;<br>so page is bigger by default and the user doen't have to zoom in. &lt;/pre&gt;<br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br>
</pre>
</BODY>
</HTML>