Building HTML Forms

Struts includes a page construction tag library to build HTML forms. In our sample application, page construction tags are prefixed with html. Here is the Struts code to render the input elements for a person's first and last names Download lt label for firstName class desc gt First Name lt label gt lt html errors property firstName gt lt html text property firstName styleId firstName styleClass text medium gt lt label for lastName class desc gt Last Name lt label gt lt html errors property...

Java Map and Ruby Hash

Java has several implementations of Maps, which are collections that manage key value pairs. One such collection is the environment variables. Here, then, is a simple program that enumerates the environment variables Download code java_xt src PrintEnv.java public static void main String args Map map System.getenv for Iterator it map.entrySet .iterator it.hasNext Map.Entry e Map.Entry it.next s, e.getKey , e.getValue Download irb main 032 0 gt ENV.each k,v puts k v TERM_PROGRAM Apple_Terminal...

Building HTML with Markaby

In the Java world, JSPs are the most controversial piece of the MVC web stack. JSPs are often despised and sometimes replaced entirely. We could spend an entire book debating the reasons for this and comparing various alternatives. But the underlying turmoil here comes from a simple fact. The view layer is where programmers, interaction designers, and graphic designers all have to work together. These groups have different goals, different skills, and different tools. JSP syntax exists, in...