setxx() and getxx() (or for boolean values isxx()) methods.
getxx() and setxx()isxx()).
To see a JavaBean in action:
StringBean.jsp and StringBean.java files from this directory. (Right click and select Save Target As.) These are extensions of the same files from the book's www.corewebprogramming.com archive.
StringBean.jsp file within the CoreWebProgramming webapp.
StringBean.java and put the StringBean.class file in the cwp package in the CoreWebProgramming application, i.e., in %TOMCAT_HOME%/webapps/CoreWebProgramming/WEB-INF/classes/cwp.
StringBean.jsp within the CoreWebProgramming application, e.g., http://localhost:8080/CoreWebProgramming/cwp/StringBean.jsp
StringBean.java is a JavaBean, it has methods other than get() and set() that can be called directly. The reverseMessage() method is an example.
<jsp:getProperty name="stringBean" property="bgColor" />style attribute inside a <span ... > tag.
<jsp:getProperty ... /> and see what happens.
Use this convenience to pass the calculator's operation and argument directly from the client to the Bean.
To illustrate automatic type conversion, let the operation be a char (use E to mean ME), and let the argument be an int (use memory and ME on the screen in both the calculator and the log.