<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FJSP%2FForm_Beans</id>
		<title>Java/JSP/Form Beans - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FJSP%2FForm_Beans"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/JSP/Form_Beans&amp;action=history"/>
		<updated>2026-04-23T12:48:14Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/JSP/Form_Beans&amp;diff=8625&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/JSP/Form_Beans&amp;diff=8625&amp;oldid=prev"/>
				<updated>2010-06-01T07:10:11Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 07:10, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/JSP/Form_Beans&amp;diff=8624&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/JSP/Form_Beans&amp;diff=8624&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:47Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Jsp Form And Bean ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
//File: index.html&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
  Copyright 2004 The Apache Software Foundation&lt;br /&gt;
  Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
  you may not use this file except in compliance with the License.&lt;br /&gt;
  You may obtain a copy of the License at&lt;br /&gt;
      http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
  Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
  distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
  See the License for the specific language governing permissions and&lt;br /&gt;
  limitations under the License.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;body bgcolor= white&amp;gt;&lt;br /&gt;
&amp;lt;font size=6 color=red&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
This web page is an example using JSP and BEANs. &lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Guess my favorite two colors &lt;br /&gt;
&amp;lt;p&amp;gt; If you fail to guess both of them - you get yellow on red.&lt;br /&gt;
&amp;lt;p&amp;gt; If you guess one of them right, either your foreground or &lt;br /&gt;
    your background will change to the color that was guessed right.&lt;br /&gt;
&amp;lt;p&amp;gt; Guess them both right and your browser foreground/background &lt;br /&gt;
    will change to my two favorite colors to display this page.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;form method=GET action=colrs.jsp&amp;gt;&lt;br /&gt;
Color #1: &amp;lt;input type=text name= color1 size=16&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Color #2: &amp;lt;input type=text name= color2 size=16&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;input type=submit name=action value=&amp;quot;Submit&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;input type=submit name=action value=&amp;quot;Hint&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
///////////////////////////////////////////////////////////&lt;br /&gt;
//File: colr.jsp&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
  Copyright 2004 The Apache Software Foundation&lt;br /&gt;
  Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
  you may not use this file except in compliance with the License.&lt;br /&gt;
  You may obtain a copy of the License at&lt;br /&gt;
      http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
  Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
  distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
  See the License for the specific language governing permissions and&lt;br /&gt;
  limitations under the License.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;jsp:useBean id=&amp;quot;cb&amp;quot; scope=&amp;quot;session&amp;quot; class=&amp;quot;colors.ColorGameBean&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;jsp:setProperty name=&amp;quot;cb&amp;quot; property=&amp;quot;*&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;%&lt;br /&gt;
  cb.processRequest(request);&lt;br /&gt;
%&amp;gt;&lt;br /&gt;
&amp;lt;body bgcolor=&amp;lt;%= cb.getColor1() %&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;font size=6 color=&amp;lt;%= cb.getColor2() %&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;% if (cb.getHint()==true) { %&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;p&amp;gt; Hint #1: Vampires prey at night!&lt;br /&gt;
  &amp;lt;p&amp;gt;  &amp;lt;p&amp;gt; Hint #2: Nancy without the n.&lt;br /&gt;
&amp;lt;% } %&amp;gt;&lt;br /&gt;
&amp;lt;% if  (cb.getSuccess()==true) { %&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt; CONGRATULATIONS!!&lt;br /&gt;
  &amp;lt;% if  (cb.getHintTaken()==true) { %&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
        &amp;lt;p&amp;gt; ( although I know you cheated and peeked into the hints)&lt;br /&gt;
  &amp;lt;% } %&amp;gt;&lt;br /&gt;
&amp;lt;% } %&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Total attempts so far: &amp;lt;%= cb.getAttempts() %&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;form method=POST action=colrs.jsp&amp;gt;&lt;br /&gt;
Color #1: &amp;lt;input type=text name= color1 size=16&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Color #2: &amp;lt;input type=text name= color2 size=16&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;input type=submit name=action value=&amp;quot;Submit&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;input type=submit name=action value=&amp;quot;Hint&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
////////////////////////////////////////////////////////////&lt;br /&gt;
//File: ColorGameBean.java&lt;br /&gt;
/*&lt;br /&gt;
* Copyright 2004 The Apache Software Foundation&lt;br /&gt;
*&lt;br /&gt;
* Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
* you may not use this file except in compliance with the License.&lt;br /&gt;
* You may obtain a copy of the License at&lt;br /&gt;
*&lt;br /&gt;
*     http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
*&lt;br /&gt;
* Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
* distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
* See the License for the specific language governing permissions and&lt;br /&gt;
* limitations under the License.&lt;br /&gt;
*/&lt;br /&gt;
package colors;&lt;br /&gt;
import javax.servlet.http.*;&lt;br /&gt;
public class ColorGameBean {&lt;br /&gt;
    private String background = &amp;quot;yellow&amp;quot;;&lt;br /&gt;
    private String foreground = &amp;quot;red&amp;quot;;&lt;br /&gt;
    private String color1 = foreground;&lt;br /&gt;
    private String color2 = background;&lt;br /&gt;
    private String hint = &amp;quot;no&amp;quot;;&lt;br /&gt;
    private int attempts = 0;&lt;br /&gt;
  private int intval = 0;&lt;br /&gt;
    private boolean tookHints = false;&lt;br /&gt;
    public void processRequest(HttpServletRequest request) {&lt;br /&gt;
  // background = &amp;quot;yellow&amp;quot;;&lt;br /&gt;
  // foreground = &amp;quot;red&amp;quot;;&lt;br /&gt;
  if (! color1.equals(foreground)) {&lt;br /&gt;
      if (color1.equalsIgnoreCase(&amp;quot;black&amp;quot;) ||&lt;br /&gt;
      color1.equalsIgnoreCase(&amp;quot;cyan&amp;quot;)) {&lt;br /&gt;
      background = color1;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  if (! color2.equals(background)) {&lt;br /&gt;
      if (color2.equalsIgnoreCase(&amp;quot;black&amp;quot;) ||&lt;br /&gt;
      color2.equalsIgnoreCase(&amp;quot;cyan&amp;quot;)) {&lt;br /&gt;
      foreground = color2;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
  attempts++;&lt;br /&gt;
    }&lt;br /&gt;
    public void setColor2(String x) {&lt;br /&gt;
  color2 = x;&lt;br /&gt;
    }&lt;br /&gt;
    public void setColor1(String x) {&lt;br /&gt;
  color1 = x;&lt;br /&gt;
    }&lt;br /&gt;
    public void setAction(String x) {&lt;br /&gt;
  if (!tookHints)&lt;br /&gt;
      tookHints = x.equalsIgnoreCase(&amp;quot;Hint&amp;quot;);&lt;br /&gt;
  hint = x;&lt;br /&gt;
    }&lt;br /&gt;
    public String getColor2() {&lt;br /&gt;
   return background;&lt;br /&gt;
    }&lt;br /&gt;
    public String getColor1() {&lt;br /&gt;
   return foreground;&lt;br /&gt;
    }&lt;br /&gt;
    public int getAttempts() {&lt;br /&gt;
  return attempts;&lt;br /&gt;
    }&lt;br /&gt;
    public boolean getHint() {&lt;br /&gt;
  return hint.equalsIgnoreCase(&amp;quot;Hint&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public boolean getSuccess() {&lt;br /&gt;
  if (background.equalsIgnoreCase(&amp;quot;black&amp;quot;) ||&lt;br /&gt;
      background.equalsIgnoreCase(&amp;quot;cyan&amp;quot;)) {&lt;br /&gt;
  &lt;br /&gt;
      if (foreground.equalsIgnoreCase(&amp;quot;black&amp;quot;) ||&lt;br /&gt;
    foreground.equalsIgnoreCase(&amp;quot;cyan&amp;quot;))&lt;br /&gt;
    return true;&lt;br /&gt;
      else&lt;br /&gt;
    return false;&lt;br /&gt;
  }&lt;br /&gt;
  return false;&lt;br /&gt;
    }&lt;br /&gt;
    public boolean getHintTaken() {&lt;br /&gt;
  return tookHints;&lt;br /&gt;
    }&lt;br /&gt;
    public void reset() {&lt;br /&gt;
  foreground = &amp;quot;red&amp;quot;;&lt;br /&gt;
  background = &amp;quot;yellow&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    public void setIntval(int value) {&lt;br /&gt;
  intval = value;&lt;br /&gt;
  }&lt;br /&gt;
    public int getIntval() {&lt;br /&gt;
  return intval;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== JSP Form Beans: Convert Money ==&lt;/div&gt;</summary>
			</entry>

	</feed>