<%-----------------------------------------------------------
   Copyright © 1999, Oracle Corporation. All rights reserved.
------------------------------------------------------------%>
<%@ include file="../../demoUtil.jsp" %>

<jsp:useBean id = "submitCount" class = "oracle.jsp.jml.JmlNumber" scope = "session" />

<jsp:useBean id = "bool" class = "oracle.jsp.jml.JmlBoolean" scope = "session" >
	<jsp:setProperty name = "bool" property = "value" param = "fBoolean" />
</jsp:useBean>

<jsp:useBean id = "num" class = "oracle.jsp.jml.JmlNumber" scope = "session" >
	<jsp:setProperty name = "num" property = "value" param = "fNumber" />
</jsp:useBean>

<jsp:useBean id = "fpnum" class = "oracle.jsp.jml.JmlFPNumber" scope = "session" >
	<jsp:setProperty name = "fpnum" property = "value" param = "fFPNumber" />
</jsp:useBean>


<HTML>

<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
	<META NAME="GENERATOR" Content="Visual Page 1.1 for Windows">
	<TITLE>Oracle JSP Built-in Objects Sample</TITLE>
</HEAD>

<% if (submitCount.getValue() > 1) { %>
	<h3> Last submitted values </h3>
	<ul>
		<li> bool: <%= bool.getValue() %>
		<li> num: <%= num.getValue() %>
		<li> fpnum: <%= fpnum.getValue() %>
	</ul>
<% }

   if (submitCount.getValue() > 0) { %>

	<jsp:setProperty name = "bool" property = "value" param = "fBoolean" />
	<jsp:setProperty name = "num" property = "value" param = "fNumber" />
	<jsp:setProperty name = "fpnum" property = "value" param = "fFPNumber" />
    
	<h3> New submitted values </h3>
	<ul>
		<li> bool: <jsp:getProperty name="bool" property="value" />
		<li> num: <jsp:getProperty name="num" property="value" />
		<li> fpnum: <jsp:getProperty name="fpnum" property="value" />
	</ul>
<% } %>

<jsp:setProperty name = "submitCount" property = "value" value = "<%= submitCount.getValue() + 1 %>" />
<%-- below for distributable applications, we preserve values in case of failover --%>
<%
  session.setAttribute("submitCount", submitCount);
  session.setAttribute("bool", bool);
  session.setAttribute("num", num);
  session.setAttribute("fpnum", fpnum);
%> 
		

<FORM ACTION="index.jsp" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">
<P> <pre>
 boolean test: <INPUT TYPE="text" NAME="fBoolean" VALUE="<%= bool.getValue() %>" >
  number test: <INPUT TYPE="text" NAME="fNumber" VALUE="<%= num.getValue() %>" >
fpnumber test: <INPUT TYPE="text" NAME="fFPNumber" VALUE="<%= fpnum.getValue() %>" >
</pre>


<P> <INPUT TYPE="submit">

</FORM>

</BODY>

</HTML>
