History
This chapter describes the history of JSF, starting from its early conception and ending where we are today at the moment of writing. We’ll discuss how the JSF API (application programming interface) itself evolved, which important events took place during that evolution, and who some of the people were that were involved in all of this.
This is in no way a complete description of the history and the reader should take notice of the fact that many more events took place and many more people were involved than we were able to mention here.
In the Beginning . . .
JSF goes back a long time. Its initial JSR, JSR 127, started in 2001. At that time the Struts web framework was wildly popular, although it wasn’t that long ago that it was released itself (around 2000). Despite Struts’ popularity, a large number of other web frameworks were in use in the Java space, and new ones were popping up all the time. JavaServer Faces (JSF) was conceived as an attempt to bring a standardized MVC (model-view-controller) web framework base into the overall Java EE platform. Controversies are quite common in the web framework space, and JSF is no exception here. Right at the start of its inception there was a big controversy where Apache opposed the creation of JSF on the bases that Apache Struts already existed and a closed source alternative would have little value. Apache therefore voted against the creation of JSF with the following comment:
This JSR conflicts with the Apache open source project Struts. Considering Sun’s current position that JSRs may not be independently implemented under an open source license, we see little value in recreating a technology in a closed environment that is already available in an open environment.
To the extent that this JSR extends beyond Struts today, we would encourage the Sun developers proposing this JSR to join the Sun developers already leading Struts to create an open solution at Apache, something which when finished would be assured of being able to be implemented as open source.
Eventually the conflict was resolved when after about a year into the process spec lead Amy Fowler (from Swing fame) was replaced by Craig McClanahan, the very father of the Struts project that JSF was said to be competing with. The open source restriction was lifted as well, and the open source JSF implementation, called MyFaces, was developed in parallel with the (then nameless) RI and hence the specification itself. MyFaces initially started as an LGPL licensed project at sourceforge.net in December 2002 and had an initial 0.1 release conforming to what was then called an “Early Access Specification” in January 2003.
Open source implementations are the most common implementations in Java EE 8, and there’s barely any EE specification at the time of this writing (2018) that’s still implemented as closed source. In 2001, however, this was not just uncommon; it was actually not allowed for new JSRs. Allowing for an open source implementation was therefore quite a change, and the honor fell to JSF to be the first of its kind for which this was allowed.
Despite the open source implementation being allowed, the actual development of the spec was still done in secret and behind closed doors. There was no public mailing list, and no tracker (e.g., a JIRA instance) for the public to create issues or express wishes. Occasionally interviews were being done, and in the fall of 2002 by then former spec lead Amy Fowler did reveal quite a few details about JSF, but largely the project was shrouded in mystery for the general public.
The team behind JSF was, however, hard at work. The first e-mail to the internal JSR-127 list was sent on August 17, 2001. As with most projects, the team spent the initial months on gathering requirements and looking at the existing competing products. A package name was chosen as well. The initial placeholder package, which was "javax. servlet.ui", now "javax.faces", was chosen as the package to use. The very first technical architecture to be considered was the component model. For a componentbased MVC framework this is obviously one of the most important aspects. During the last month of 2001 and the first two months of 2002 the team looked at what is now known as the Managed Bean (called “Object Manager” then). Managed beans with their scopes, names, and dependency injection are clearly another cornerstone of the JSF framework. Events and the model behind it were being looked at as well during that time frame.
In the second quarter of 2002 two other cornerstones of JSF were discussed: the Expression Language (inspired by JSTL), which is instrumental for the so-called bindings of beans from a template to backing code, and the factory finder, which allowed key parts of JSF to be replaced and although perhaps not fully realized at the time may have contributed greatly to JSF still being relevant some 16 years later.
It was in this same quarter that Craig McClanahan took over as spec lead, father of Struts and architect of Tomcat’s Servlet container, took over. Not long after the discussion about using JSP started, a discussion, perhaps unbeknownst to the team at the time, that would, unfortunately, have a rather negative impact on JSF later on. Around the end of the year 2002, Ed Burns, who like McClanahan had also worked on Tomcat before, joined the team as co-spec lead. Burns is the person who would eventually become the main spec lead of JSF for well over a decade.
While the team continued to work on things like the aforementioned managed beans and the so-called value binding, which is the Java representation of the also aforementioned expression language binding, the first dark cloud appeared when in the spring of 2003 team member Hans Bergsten realized that there were very real and major issues with using JSP as the templating language for JSF. He brought these concerns to the team, but ultimately they weren’t addressed and instead the following months were spent, among other things, on a variant of the value binding; it later on became clear that the method binding and the state saving mechanism were another of JSF’s less than ideal implementations.
JSF 1.0 and its still nameless RI were eventually released on March 11, 2004— coincidentally, a mere two weeks before the release of another framework that’s still strong today, Spring 1.0. MyFaces released its 1.0.0 alpha version only days later, on March 19. It’s perhaps an interesting observation that JSF went final with a full-fledged XML-based dependency injection (DI) framework just before Spring, which is largely known for its DI, went final.
JSF 1.0 was generally well received; despite a rather crowded market with competitors such as Tapestry, WebObjects, Velocity, and Cocoon operating, not less than three books from writers such as Horst Caymann and Hans Bergsten appeared in the months after, and the eXo platform (a Digital Collaboration Platform) started using JSF right away.
Hans Bergsten’s earlier concerns, however, become painfully clear almost just as quickly; the JSP technology is based on processing a template from start to end, immediately writing to the response as tags are encountered. JSF, however, requires a phased approach where components need to be able to inspect and act on the
component tree, which is built from the tags on the page, before starting to write anything to the response. This mismatch led to many strange issues, such as content disappearing or being rendered out of order.
Only three months after the introduction of JSF, Hans Bergsten made a strong case of dropping JSP in his legendary article “Improving JSF by Dumping JSP.” There Bergsten explains how ill-suited JSP is for use a template language in JSF, but he also presents a glimmer of hope; because of JSF’s great support for extendibility, it’s relatively easy to introduce alternative templating simply by replacing the so-called view handler, something which JSF explicitly allows. It would, however, take five long years until JSF would indeed ship with a more suitable view templating language, and even though JSP had been essentially deprecated at that point it’s still present in JSF at the time of writing.
The Adolescent Years
Back in 2004 another first befell JSF; on June 28 Ed Burns announced that the source of the RI was released by Sun. This represented a major milestone as before that date most technology in active use by Sun was closed source. Initially the source was licensed under the somewhat exotic JRL, but later this would be changed to dual licenses, GPL with classpath exception and CDDL. At the same time as this announcement, the tradition was established that every new feature or bug fix should be accompanied by a test, and that all existing tests should be executed before committing the change. Some 14 years later there’s a largely different set of people working on the RI source, and the project structure and code conventions have changed as well, but the test-driven tradition is still being uphold in its original form.
At that point Ed Burns decided to focus more on the specification aspects of JSF as the JSF 1.2 spec work had started right away, and Jayashri Visvanathan, one of the early team members, took on the lead role concerning the implementation aspects, with Ryan Lubke, working as the TCK (testing) engineer.
Still only a few months old, a variety of component libraries for JSF had already started to pop up, although all of them commercial. Among those was the one from Oracle, ADF Faces. ADF Faces was put on Oracle’s roadmap well before JSF 1.0 went final, and the first early access release was presented on August 17, 2004. Its lead was Adam Winer, who represented Oracle in the team that created JSF 1.0. ADF Faces primarily contained a set of rich components, but also a dialog framework, and remarkably already featured partial page rendering (PPR), quite a bit ahead of the later crop of AJAX
solutions. ADF Faces also contained a “for each” tag (af:forEach) that actually worked. Adam Winer explained in these early days that such tag is not quite trivial to build but promised that Oracle would contribute the knowledge back to JSF itself.
The ADF Faces components originated mostly from the earlier User Interface XML (UIX) framework, of which Adam Winer was the lead architect as well. Earlier versions of UIX used the names “Cabo,” “Baja,” and “Marlin.” UIX was a rich client framework for use in the browser. With JSF sharing more than a few similarities to UIX, and with its lead, Adam Winer, being part of the original JSF team, it’s perhaps not unreasonable to surmise that UIX influenced JSF. Such similarities include the concept of components with separate renderers, JSP tag handlers and declarative options to compose a page, and the ability to instantiate those same components programmatically in Java. There was even a conceptually similar data binding, although with a less elegant syntax. Instead of, say, value="#{user.age}", UIX would use data:value="age@user" but also required a kind of producer to be defined on each page to declare where “user” comes from, and then nest the page’s content within that declaration. By contrast, JSF and EL have always used global definitions and left it up to the user to avoid name clashes.
One of the first, if not the first open source component library in 2004 was Matthias Unverzagt’s OurFaces. As JSF did not had its own resource API (application programming interface) at the time to serve up things like images, OurFaces required a Servlet to be added to web.xml, the so-called SkinServlet (ourfaces.common.webapp. SkinServlet). The significance of this is that it became a rather common thing for JSF libraries in those days to ask their users: add something manually to web.xml before the component library can be used.
Most of the last months of 2004 and early months of 2005 were spent by the JSF 1.2 expert group (EG) working on various JSP and EL issues, such as the JSTL <c:forEach> support and the generation of IDs in JSP, as well as on the dreaded “content interweaving” issue, which refers to the aforementioned content that appears at wrong places in the response when rendering.
While OurFaces may have been one of the first component libraries, it didn’t last and few will remember it or have even heard about it today. This is not quite the same for another framework that has its roots in early 2005, namely, Alexander Smirnov’s Telamon framework, later renamed Ajax4jsf. This framework was one of the first of its kind that combined JSF and the then new and fresh AJAX technology. The beauty of Ajax4Jsf was that it could add AJAX support to existing components, which weren’t built with AJAX support in mind at all by enclosing them among others in the <a4j:region>
tag. This technology was incorporated in the Exadel Visual Component Platform, which was released in March 2006 and would later be renamed RichFaces, and would become one of the most memorable JSF component libraries.
At around the same time Alexander Smirnov started work on what eventually would become RichFaces, a company called ICEsoft started working on a JSF component library. ICEsoft had been in business for a couple of years and had been working on a product called ICEbrowser, a Java-based browser, and a product called ICEbrowser beans, which were “lightweight, configurable Javabean components that can be rapidly integrated into Java client applications.” During JavaOne 2005 of that year, on 27 June, ICEsoft announced their its component library for JSF—ICEfaces. This was based on AJAX as well but incorporated AJAX directly into the components. ICEsoft called its specific technique “patent pending Direct-to-DOM™,” which basically meant that changes coming from the server were directly injected into the DOM tree structure of a web page. A final version wasn’t available right away though, but an early access release was provided. This was closed source but cost-free.
Meanwhile, JSF EG member Jacob Hookom, inspired by Hans Bergsten’s concerns about the unsuitability of JSP, grabbed the bull by the horns and started working himself on that alternative templating language envisioned by Bergsten. In August 2005 this work had progressed into a usable initial version. The name of this templating language? Facelets! It immediately took the JSF world by storm. Kito Mann published the first part of a series of articles about it on JSFCentral the very first month, and Richard Hightower published the famous article “Facelets fits JSF like a glove” several months later.
Oracle had not been sitting still either in 2005, and after about 16(!) early access releases it announced in late 2005 at the JavaPolis conference in Antwerpen (nowadays called Devoxx) that ADF Faces would be donated to MyFaces and thus become open source.
In the first month of 2006, Jacob Hookom and Adam Winer contemplated the terrible implementation of JSF’s state save mechanism. This worked by first creating a component tree from a template and then, near the end of the request, blindly serializing the entire tree with all data that may have been put there during the request. During a postback the tree is restored from this serialized form (hence the name of the phase “restore view”). This is a tremendous waste, as the majority of this information is already available in the template. Especially when doing AJAX requests with client-side state saving this poses a very big burden, but it is also a problem when storing this state on the server as it massively increases JSF’s memory usage. One of the main reasons for doing state saving in such terrible way again has to do with that one decision: to support JSP. With JSF 1.2 about to go final, there was unfortunately no time left to fix this for version 1.2.
Even though it was clear at this point that Facelets was the future of JSF, when JSF 1.2 was eventually released in May 2006 it still contained only JSP. Not all was bad though. Thanks to a cooperation between the JSF and JSP EGs, a revision of JSP was released, JSP 2.1, which was much better aligned with the demands of JSF. On top of that, JSP’s expression language and JSF’s expression language were merged. The result was UEL (Unified Expression Language). A very practical advantage of UEL is that JSF components no longer have to convert Strings manually into expressions but directly receive a ValueExpression from the templating language. Both JSP 2.1 and JSF 1.2 became part of Java EE 5, which was released at the same time.
On June 13, 2006, the MyFaces community announced that the donated project would have its name changed to Trinidad. ADF Faces kept existing at Oracle, though, but was based on Trinidad with some extra features (such as support for Portals, JSR 227, etc.). Just two weeks prior to that, on May 31, 2006, ICEsoft announced its free, although still closed source, community edition. A few months later, on November 14, 2006, ICEsoft would fully open source ICEfaces under the MPL license. RichFaces, still closed source at that point and being sold by Exadel, would not stay behind for long though, and some four months later, on March 29, 2007, Exadel announced a partnership with Red Hat that made RichFaces available under an open source license and available and supported via its JBoss group.
On to Maturity
On May 22, 2007, the specification work for JSF 2.0 began. The scope was hugely ambitious and promised not only to fix many of the issues that people had been complaining about but also to introduce quite a bunch of new features. Mentioned among the many goals in the JSR was a particularly interesting one when looking at the bigger picture—extracting the managed bean facility from JSF and making it available for the entire platform.
During the fall of 2007 the community was polled for a name for the JSF RI. Four names rose to the top, but as is often the case none of these names could be approved by Sun’s legal department. Eventually Mojarra was proposed, and perhaps to the surprise of some this one did pass legal’s scrutiny. Ryan Lubke, one of the main JSF committers then, made the official announcement on December 5, 2007.
A little under a year later, on October 29, 2008, Çağatay Çivici started a new library, PrimeFaces. The name derives from Çağatay’s nickname, which is Optimus Prime, the
courageous leader of the heroic autobots in the fictional Transformers universe. Çağatay had been involved with JSF development for a long time and had worked on the YUI4JSF JSF component library before. PrimeFaces was initially based on JSF 1.x, but with JSF 2.x looming and the project still young it would soon after switch to JSF 2.x.
On July 1, 2009, the long-awaited JSF 2.0 finally arrived. JSF 2.0 indeed fixed nearly every problem that the industry had with JSF; finally, Facelets was included as the default view templating language. JSP was effectively deprecated. The state saving concerns that Hookom and Winer brought forward more than three years earlier were addressed as well; from then on JSF only saved delta state (state changes), and in restore view the component tree was reloaded from the template, instead of actually restored.
Another big concern brought forward by the JSF community over the years, JSF’s over-the-top emphasis on postbacks, was addressed too; GET requests became a firstclass citizen in JSF 2.0. A well-known usability problem with JSF, sometimes called “The Trap,” was that for a number of operations the data involved needed to be the same during both the original request and the postback. This is not entirely trivial to guarantee in JSF 1.x. JSF 2.0 introduced the so-called view scope for this, which elegantly solved the problem. The creation of custom components, yet another problem area of JSF 1.x, was made much simpler as well. JSF 2.0 also introduced core support for AJAX, modeled after the way Ajax4Jsf worked, a resource API, system events, and quite a few other things.
One of JSF 2.0’s goals, making its managed bean facility usable outside JSF, was implicitly reached by the CDI spec, which was introduced together with JSF 2.0 in Java EE 6. The CDI spec itself has a long history too, but one of its defining characteristics is that CDI Beans are strongly based on JSF Managed Beans and are essentially a super set of those.
Altogether the impact of all those fixes and new features was such that it split the community essentially in two; those who had used JSF 1.x and never looked at it again and those who switched to JSF 2.x or, specifically, the ones who started using JSF with 2.0 and never saw 1.x. This often led to heated debates, with the 1.x side arguing that JSF is horrible, and the 2.x side not understanding at all why that would be the case. Even at the time of this writing, which is almost nine years after JSF 2.0 was released, and a longer period than JSF 1.x ever existed, these sentiments still remain to some degree.
Despite the many things that JSF 2.0 did right, there was one missed opportunity; even though CDI was now available and superseded JSF’s Managed Beans, JSF chose not to deprecate its managed bean facility right away. Even worse, it introduced an annotation-based alternative to the XML-based system JSF 1.x used to define managed beans. With CDI already out there having annotations like javax.enterprise.context. RequestScoped, simultaneously introducing a javax.faces.bean.RequestScoped
annotation that did exactly the same thing seems debatable as best. The EG seemed to be aware of this conflict, as a warning was put in place that these new annotations would possibly be superseded by platform functionality before long.
On December 23, Cay Horstmann raised his concerns about this very unwanted situation in an article titled “Is @javax.faces.bean.ManagedBean Dead on Arrival?” The response was quite clear; people, including Java EE book writer Antonio Goncalves, asked for this huge mistake that JSF 2.0 had made to be corrected as soon as possible and to deprecate javax.faces.bean.ManagedBean right away in the upcoming JSF 2.1 maintenance release which was called for, among other things, to rectify another mistake (namely, the problem JSF 2.0 introduced that in addition to a custom ResourceResolver it was also necessary to provide a custom ExternalContext, which was very unclear). Why javax.faces.bean.
ManagedBean indeed wasn’t deprecated in the JSF 2.1 MR remains a mystery to this day.
While applications written against the JSF 1.x APIs would mostly run unchanged on JSF 2.0, or only needed a few small changes, the component libraries had a much harder time. Specifically, the platform-provided AJAX support meant that the existing component libraries would have to forego their own AJAX implementations and rebase on the standard APIs. Clearly that was no small feat, and it took a long time for component libraries to migrate, with some never really making the switch at all.
Here PrimeFaces was clearly at an advantage. Being a relatively new library without much legacy, it made the switch relative easy. Be it a coincidence or not, PrimeFaces’ ascension in popularity seemed to start right after JSF 2.0 was released, which was also the exact same time that both ICEfaces and RichFaces seemed to become less popular. Although it must be noted that hard statistics are difficult to obtain and contain many facets (downloads, deployments, book, questions asked, available jobs, taking different industries into account, etc.), somewhere around 2012 PrimeFaces had seemingly become the more popular JSF component library.
In the beginning of that same year, February 19, 2012, Arjan Tijms and Bauke Scholtz (by coincidence also the authors of this book) started the OmniFaces library for JSF. The goal of OmniFaces was to be a utility library for JSF, essentially what Apache Commons and Google Guava are to Java SE. Tijms and Scholtz had worked on a JSF-based web site together and found that they both had a collection of private JSF utilities that they reused for different projects, and also that a great number of similar utilities were essentially rewritten again and again for many JSF projects and were partially floating around in places like forum messages and blog posts. OmniFaces was set up in particular not to not compete component libraries like PrimeFaces but to work together with those. Hence, visual-oriented components were largely out of scope for OmniFaces.
In 2012 the specification process for JSF 2.2 was also in full swing. JSF 2.2 was eventually released on the May 21, the next year. JSF 2.2 specifically came up with a formal version of the alternative mode in which Facelets could operate; instead of putting component tags on a view, plain HTML was put on it, with a special ID linking the tag to a component. Such a mode is generally speaking somewhat less interesting to JSF developers but appeals specifically to web designers who can more easily use plain HTML tools for such views. JSF 2.2 also introduced a CDI compatible @ViewScoped annotation, which removed one of the last reasons to still use the JSF managed bean facility in JSF 2.1, namely, that in that version @ViewScoped only worked on those beans. JSF 2.2 also introduced two new big features, Faces Flow and Resource Contracts, but these seem to have seen little uptake in practice.
Just prior to the start of JSF 2.3, on July 20, 2014, RichFaces lead Brian Leathem announced on his blog that RichFaces 5, the next-generation version of RichFaces, would be canceled. Instead, RichFaces would “pursue a path of stability over innovation,” which means that JBoss will make RichFaces 4.x compatible with JSF 2.2 and port back a few things that were in development for RichFaces 5. While the post was somewhat optimistic, it strongly looked like the writing was on the wall for RichFaces.
On August 26, 2014, the specification work for JSF 2.3 started. A new co-spec lead was introduced—Manfred Riem, who up to then had been working mostly on the implementation side of Mojarra, doing such things as migrating hundreds of the tests for which JSF is famous away from the ancient and retired Cactus framework to a more modern Maven-based one, and making sure the gazillions of open Mojarra issues were reduced to a manageable number. JSF 2.3 started off with a perhaps somewhat remarkable message that Oracle had only a few resources available. During the specification process those few resources dropped to a number that few would have expected—absolutely zero. Basically, after JavaOne 2015, nearly all of the spec leads just vanished and most specs as a result abruptly ground to a halt. Josh Juneau reported about this in his famous study, “Java EE 8, What Is the Current Status: Case Study for Completed Work Since Late 2015,” which undeniable makes it clear by showing graphs of e-mails, commits, and issues resolved that Oracle had just walked away.
The openness of the JSF and its RI Mojarra were fortunately such that the specification work and implementation thereof in Mojarra can largely be carried on by the other EG members, which indeed happens.
Meanwhile on February 12, 2016, Red Hat announced that RichFaces would be end of lived (EOL) later that year, namely, in June 2016. One of the most popular JSF component libraries at some point, often named something like “One of the big three,” effectively was no more. On June 20, 2016, the last real commit to the project was done, “RF-14279: update JSDoc.” Two days later Red Hat released RichFaces 4.5.17 and the GitHub repos were put into archived (read only) mode. Brian Leathem, who is still a JSF 2.3 EG member, announced a few days later on February 18 that he would no longer be doing any JSF-related work.
Rejuvenation
In late 2016 the JSF spec leads briefly returned, but with the message that the spec must be completed in only a few weeks, so the (somewhat) lengthy finalization process could start. On March 28, 2017, JSF 2.3 was then eventually released, bringing with it the start of replacing JSF native artifacts with CDI versions, and finally something which should have happened years ago: the deprecation of the JSF managed bean facility in favor of using CDI beans. Other features are support for WebSocket using the Java EE WebSocket APIs donated by OmniFaces, the introspection of available view resources in the system, and a search expression framework donated by PrimeFaces.
Following the somewhat turbulent development of the JSF 2.3 spec is the even more turbulent announcement by Oracle in 2017 that Java EE, thus including JSF, would be transferred to the Eclipse foundation. Oracle would stop leading the specs it owned before, which again includes JSF. This would mean that Mojarra would be re-licensed, and JSF would be evolved by a new process with likely different leads. At the time of writing, this transfer is in full swing.
From Zero to Hello World
In this chapter you will learn how to set up a JSF (JavaServer Faces) development environment with the Eclipse IDE (integrated development environment), the Payara application server, and H2 database from scratch.
Installing Java SE JDK
You probably already know that Java SE is available as JRE for end users and as JDK for software developers. Eclipse itself does not strictly require a JDK as it has its own compiler. JSF being a software library does not require a JDK to run either. Payara, however, does require a JDK to run, primarily in order to be able to compile JSP files, even though JSP has been deprecated as JSF view technology since JSF 2.0. Therefore, you need to make sure that you already have a JDK installed as per Oracle’s instructions. The current Java SE version is 9, but as Java EE 8 was designed for Java SE 8 which is currently more mature, JDK 8 is recommended: https://docs. oracle.com/javase/8/docs/technotes/guides/install/install_overview.html
The most important parts are that the PATH environment variable covers the /bin folder containing the Java executables (e.g., "/path/to/jdk/bin"), and that the JAVA_HOME environment variable is set to the JDK root folder (e.g., "/path/to/jdk"). This is not strictly required by JSF, but Eclipse and Payara need this. Eclipse will need the PATH in order to find the Java executables. Payara will need the JAVA_HOME in order to find the JDK tools.
What About Java EE?
Note that you do not need to download and install Java EE from Oracle.com even though JSF itself is part of Java EE. Java EE is basically an abstract specification of which the so-called application servers represent the concrete implementations. Examples of those application servers are Payara, WildFly, TomEE, GlassFish, and Liberty. It is exactly those application servers that actually provide among others JSF (JavaServer Faces),
© Bauke Scholtz, Arjan Tijms 2018 B. Scholtz and A. Tijms, The
EL (Expression Language), CDI (Contexts and Dependency Injection), EJB (Enterprise JavaBeans), JPA (Java Persistence API), Servlet, WebSocket, and JSON-P (JavaScript Object Notation Processing), APIs (application programming interfaces) out of the box.
There also exist so-called servlet containers which provide basically only the Servlet, JASPIC (Java Authentication Service Provider Interface for Containers), JSP (JavaServer Pages), EL, and WebSocket APIs out of the box, such as Tomcat and Jetty. However, it would require some work to manually install and configure, among others, JSF, JSTL (JSP Standard Tag Library), CDI, EJB, and JPA on such a servlet container. It is not even trivial in the case of EJB as it requires modifying the servlet container’s internals. That is, by the way, exactly why TomEE exists. It’s a Java EE application server built on top of the barebones Tomcat servlet container engine.
Coming back to the Java EE download at Oracle.com, it would give you basically the GlassFish server, along with a bunch of documentation and optionally the Netbeans IDE. We do not need it as we are already using Payara as the Java EE application server, and are targeting Eclipse as IDE. Therefore, the Java SE JDK is sufficient.
Installing Payara
Payara is an open source Java EE application server which is in 2014 forked from GlassFish. It is basically a response to Oracle’s announcement to stop its commercial support for GlassFish, so companies previously using GlassFish commercially could effortlessly switch to Payara and continue enjoying commercial support. Thanks to commercial support for business customers previously using GlassFish, the Payara application server software can continuously be bug-fixed and improved.
The first Payara version with JSF 2.3 integrated is 5. You can download it from https:// payara.fish. Make sure you choose either the “Payara Server Full” or “Payara Server Web Profile” download and not, for example, the “Payara Micro” or “Payara Embedded,” as they have other purposes. Installing is basically a matter of unzipping the downloaded file and putting it somewhere in your home folder. We’ll leave it there until we have Eclipse up and running, so that we can then integrate Payara in Eclipse and let it manage the server.
How About Other Servers?
The choice for Payara in this book is primarily because it is at time of this writing one of the very few available Java EE application servers with JSF 2.3 integrated. The other one is GlassFish, but we would rather not advocate it as it would basically
Chapter 2 From Zero to hello World
offer no commercial support or bug fixes. GlassFish must be seen as a true reference implementation for other application server vendors so they can, if necessary, build their application server implementation by example.
WildFly, TomEE, and Liberty did not, at the time of writing, have a version available with JSF 2.3 integrated.
Installing Eclipse
Eclipse is an open source IDE written in Java. It is basically like notepad but with thousands if not millions of extra features, such as automatically compiling class files, building a WAR file with them, and deploying it to an application server without the need to manually fiddle around with javac in a command console.
Eclipse is available in a lot of flavors. As we’re going to develop with Java EE, we need the one saying “Eclipse IDE for Java EE developers.” It’s usually the top-ranked download link at http://eclipse.org/downloads/eclipse-packages/. Also here, installing is basically a matter of unzipping the downloaded file and putting it somewhere in your home folder.
In Windows and Linux you’ll find the eclipse.ini configuration file in the unzipped folder. In Mac OS this configuration file is located in Eclipse.app/Contents/Eclipse. Open this file for editing. We want to increase the allocated memory for Eclipse. At the bottom of eclipse.ini, you’ll find the following lines:
-Xms256m -Xmx1024m
This sets, respectively, the initial and maximum memory size pool which Eclipse may use. This is a bit too low when you want to develop a bit of a decent Java EE application. Let’s at least double both the values.
-Xms512m -Xmx2g
Watch out that you don’t declare more than the available physical memory. When the actual memory usage exceeds the available physical memory, it will continue into virtual memory, usually in a swap file on disk. This will greatly decrease performance and result in major hiccups and slowdowns.
Now you can start Eclipse by executing the eclipse executable in the unzipped folder. You will be asked to select a directory as workspace. This is the directory where Eclipse will save all workspace projects and metadata.
After that, Eclipse will show a welcome screen. This is not interesting for now. You can click the Workbench button on the right top to close the welcome screen. Untick if necessary “Always show Welcome at start up” on the bottom right. After that, you will enter the workbench. By default, it looks like the screenshot in Figure 2-1.
Configuring Eclipse
Before we can start writing code, we would like to fine-tune Eclipse a bit so that we don’t eventually end up in trouble or with annoyances. Eclipse has an enormous amount of settings, and some of its default values should not have been the default values. You can verify and configure the settings via Window ➤ Preferences.
Figure 2-1. Eclipse workbench Chapter
Chapter 2 From Zero to hello World
• G eneral ➤ Workspace ➤ Text file encoding must be set to UTF-8. Particularly in Windows this might otherwise default to the proprietary encoding CP-1252 which does not support any characters beyond the Latin range. When reading and saving Unicode files with CP-1252, you risk seeing unintelligible sequences of characters. This is also called “mojibake.”.1
• G eneral ➤ Workspace ➤ New text file line delimiter must be set to Unix. It works just fine on Windows as well. This will particularly keep version control systems happy. Otherwise, developers pulling code on different operating systems might face confusing conflicts or diffs caused by different line endings.
• G eneral ➤ Editors ➤ Text editors ➤ Spelling should preferably be disabled. This will save you from a potentially big annoyance, because it unnecessarily also spellchecks XML configuration files such as faces-config.xml and web.xml, causing confusing errors and warnings in those files.
• Java ➤ Compiler ➤ Compiler compliance level must be set to 1.8. This is the minimum required Java version for Java EE 8.
• Java ➤ Installed JREs must be set to the JDK, not to the JRE. This setting will normally also be used to execute the integrated application server which usually requires the JDK.
Installing JBoss Tools Plug-in
Standard Eclipse for Java EE in its current version does not support any CDI tools. It has no wizards to create CDI managed beans, or autocompletion and hyperlinking for CDI managed beans in JSF pages. The JBoss Tools plug-in is an extensive plug-in which offers among others the CDI tools.2 This is very useful when developing a Java EE web application.
1https://en.wikipedia.org/wiki/Mojibake
2http://tools.jboss.org/features/cdi.html.
Another random document with no related content on Scribd:
Vinzi was not quite sure just when his father had begun to change in his attitude toward him, nor did he know why.
On the other hand, there was the sadness that for him all this lovely mountain life was at an end. He must leave all these kind people. And then the music! Yes, all the music! With whom could he continue his music at home? There was no one. Must all this be ended for him forever? His heart sank within him at the thought, but next moment it pulsated with the thought of going home and seeing those he loved.
Even if he must forget all about music at home, thought Vinzi to himself, he would surely be able to go up to Father Silvanus again some day, and this was his last consoling thought as he fell asleep.
The next morning there was no time for any discussion as they had to be off to the pasture as early as possible. Jos and Faz were already off for the cows, and Vinzi was ready to follow with Russli when his Cousin Lorenz drew him to one side and said in a low voice, "It has to be, Vinzi, and you will be glad to get home. I wanted to tell you so that you could bid good-bye to Father Silvanus and to the grandfather this morning."
Vinzi knew his cousin's words were final, and he went off in silence, which did not please Russli at all.
"Say something to me," said the little boy petulantly, after they had walked a short distance.
"I can't talk very well," replied Vinzi, "something is choking me. But don't be unhappy, for when I get home I will send you something nice for your little shop."
"You needn't go home," declared Russli confidently. "Faz has thought of something to do so you need not go. He told Jos about it at the pump. Early tomorrow morning he will go up the road and wait for the wagon. When it stops, he will climb up into the seat and say that he is the boy from Leuk. Then the man will drive on, and when they have gone some distance along the other side of the mountain, he will jump off the wagon and say he is not the right boy after all, and run back. Now don't you see? The man can't do anything then, for it will be too far for him to come back."
Vinzi was not at all convinced that this plan would prevent his trip home, but he felt deeply moved at the thought of Faz taking so much pains to keep him. He had really had less to do with Faz than with the other two boys.
"What are you going to send me for my shop?" inquired Russli later.
"I shall not tell you," replied Vinzi. "It must be a surprise; then it will please you better."
"Is it something to eat?" persisted Russli.
"No, nor anything to drink," answered Vinzi. "But I will tell you no more about it, or it will be no surprise."
At the pasture Vinzi parted from Russli and went on to the hospice as usual. He had been instructed always to go at once to the great room and there await Father Silvanus. He always came quickly. But this morning Vinzi did not stand before the harmonium with sparkling eyes in happy expectation, as he always did when the priest stepped in. Today his pupil was quite downcast and when the priest looked at him questioningly, Vinzi informed him that this would be the last time he would come; he was going home the next day.
"Oh, what a pity, what a real pity!" exclaimed Father Silvanus slowly. "But you can keep up your music at home, can't you?"
Vinzi fought back the tears, though his eyes filled in spite of him as he answered, "No, I believe not."
"Keep up your courage, my boy!" advised Father Silvanus, patting him kindly on the shoulder. "Keep up your courage! It is always lovely to go home, and if the Lord thinks music is good for you, it is an easy thing for Him to send someone across your path who will help you further. Perhaps you will return to us and we will go on with your music together."
The priest shook his hand in a fatherly way and accompanied him to the door, where he gave the lad his blessing, saying heartily: "May God watch over you!" and then sent him on his way.
Vinzi was scarcely able to stammer his thanks, he had to fight so hard to keep back the tears, and he was most grateful to the priest for making his farewell so short, he could not have controlled himself much longer. Perhaps Father Silvanus had perceived that fact.
Vinzi gazed around him again and again. The mist began to lift, and everything grew clearer in the sunshine— the snow-capped mountain, the cascade, the rocky cliffs, and above them all was the deep blue of the heavens. He looked at it all once more, then ran off to the Tower.
The grandfather had come out when the fog lifted, and was again seated on his bench.
"You've come early today, and that is right," he called out to the approaching boy. "But what's wrong, what is the
matter?" he added as he came up close.
When Vinzi explained, he said, "But we will be glad that you could stay this long. It has been my hope that you could come and sing my hymn for me when I go to my heavenly home. But perhaps I will be here till next summer, and then you will come back again. We will say good-bye with that thought," and the grandfather shook hands with Vinzi in a hearty way, saying his cousin would be expecting him, and he did not wish to detain him.
Vinzi hurried toward the house, thinking that the grandfather might be right. In the meanwhile, Cousin Josepha had been persuaded that Vinzi must go, and she rejoiced when she saw him coming so soon. It would give her a chance to talk with him, and that was necessary in order for her to regain her usual calm, for this sudden leave-taking had quite upset her.
When they had sat together and chatted as on the day of his arrival, her complacent mood was fully restored as Vinzi assured her he had no greater desire than to come up to the mountain again, live in her house, and occupy his lovely sleeping quarters.
When the family were all sitting together that evening, Father Lorenz said, "Singing is the best means of driving away sad thoughts," and began a song himself. The others joined in, and the music continued until bedtime.
The next morning things did not go just as Faz had planned. The brothers were ready to go to the pasture and were saying good-bye when the continuous cracking of a whip on the road told Father Lorenz that the fruit dealer was arriving earlier than he had said.
Vinzi climbed up to his high seat, and he called a separate farewell to Lorenz, Josepha and the three boys, after which the horses started off. Truly sad at heart, all five watched the departing Vinzi, Russli feeling the least grief because of the surprise he had in prospect.
When the wagon reached the spot from which the Tower in the meadow was visible, the road was suddenly lined with a crowd of noisy boys. More and more kept coming, and finally they lifted a shrill "Hurrah!" and then shouted over and over again, "Come again!" so lustily that all four horses reared.
Down below the grandfather sat on his bench and waved his hat high in the air and Vinzi answered by swinging his.
A window was opened in the hospice above, and a hand waved a friendly farewell to Vinzi; the hand of Father Silvanus.
One more stretch up the mountain, past the wild beeches and gnarled old fir-trees, and then came the quick descent to the valley.
CHAPTER VIII
MORE UNEXPECTED EVENTS
STEFELI'S summer was more pleasant than had seemed possible when Vinzi went away. Mr. Delrick never started on one of his long walks without asking, "Is Stefeli coming with me?"
As Stefeli did not go to the pasture after Vinzi had left, the mother never lost an opportunity to send her outdoors with Mr. Delrick, for the little girl fretted because she had to sit about the house so much. She was always highly pleased when she heard the welcome question and could lay aside the knitting of the long stocking to skip about in the meadows. Stefeli told her escort all sorts of things, what she had done out on the pasture, and all about the life in
the home, as well as the ambitions and ideals of father, mother, Vinzi and herself.
It was in this way that Mr. Delrick learned the history of the Lesa family, but he became intimate with the life of the three members of the household in another manner also.
Vinzenz Lesa liked to spend his leisure evening hours on the bench outside the door, where he could enjoy the pleasant odor of the walnut leaves wafted to him on the evening air. There he smoked his pipe, and was pleased when Mr. Delrick sat beside him and they discussed the topics of the day.
With Mrs. Lesa, he held an altogether different kind of conversation. Their talk always concerned the same subject, and that was Vinzi. She had told him how all Vinzi's happiness from early childhood had been centered on music, and how his father had centered his ambition in the determination that the boy should follow in his footsteps.
Mr. Delrick had deep sympathy for the mother, and tried to comfort her by saying that young lads such as Vinzi often evince an enthusiasm, only to drop it when a happy future lay before them, such as had come to Vinzi. At the same time he understood how anxiety pervaded her days and how her thoughts would dwell on the subject. And since he believed it lightened the mother's heart to discuss the matter, he often led their conversation back to Vinzi, and listened sympathetically to all she said.
In this way he had become the special friend and confidant of each member of the house, and Stefeli, as well as her father and mother, would say, "We will have to ask Mr. Delrick; he is sure to know," whenever a question came up which they could not answer at once; or when there was
something they worried about, they would say, "We must consult Mr. Delrick; he can certainly advise us."
Therefore when the good news came down from the mountain that both old and young loved Vinzi and that he had brought them all great happiness, Mr. Delrick took as lively an interest in the report as though he belonged to the family. The mother listened in silence but both he and the father expressed the hope that the boy had begun to find joy in those things which were connected with his future career, and now Mr. Delrick prayed that the little family to which he had become so attached was to be reunited and find happiness before he left them.
The day came when Father Lesa told his wife in the presence of Mr. Delrick that he had met an old friend who was driving to the mountain, and he had instructed him to bring Vinzi back, and they should arrive in five days.
The mother's heart throbbed with joy and Stefeli in her excitement could not sit still, but ran about restlessly. She kept counting the days, thinking they could not be lived through, but wonderful to relate the fifth day arrived with unexpected swiftness.
She had just returned from a walk with Mr. Delrick when her father came in from the field and said, "Vinzi may arrive at any minute. Let us have supper ready so he can sit down with us."
Mr. Delrick was summoned, and they began to eat, though Stefeli could scarcely swallow her food, and things went no better with her mother.
"Here he comes!" suddenly cried the child and she dashed out of the door.
None of the others had heard anything, but a few moments afterward Stefeli came in triumphantly holding Vinzi by the hand. The joy of the parents was not expressed in words, but one could easily see the father's pride as he looked at his son and led him up to Mr. Delrick.
The latter gave him a keen look, for his mind had dwelt on the lad for many weeks and now he thought, "I can easily understand why the mother is so devoted to him and how his father's hopes center in him, for he is certainly a fine appearing lad."
His father asked how he had liked the pasture up there and Vinzi described in ecstasy how the violets ladened the air with their perfume and tall larches spread their wide branches over the moss-covered stones, while the cows grazed so peacefully that their bells tinkled softly like a song of peace.
His mother asked if he had found pretty flowers up there too, and Vinzi waxed still more enthusiastic as he told how the field of roses made such a vivid glow it looked like fire.
Vinzi also described his sleeping quarters and said how dear the place had become to him—the little house that was filled with the fragrance of the haymow.
Both father and mother were amazed at their boy; he had never spoken with such assurance and enthusiasm.
The mother thought, "Our Vinzi is not the same as when he left us. He has begun a new life. What will happen now?"
The father had much the same impression for he said to himself, "Vinzi is different. He has found himself and knows what he wants."
The next morning Stefeli was up bright and early, for the joy of knowing Vinzi was home banished sleep. Just as she was about to knock on his door, it opened and Vinzi stepped out dressed and ready for the day.
Stefeli drew back in astonishment and exclaimed, "You're up frightfully early! You didn't use to do so and I was going to call you."
"Well, you see now I can do it too," said Vinzi, laughing at her surprise. "I always got up very early on the mountain. When one is impatient for the happiness the day is to bring, one is glad to jump out of bed. It's a habit with me now."
"What made you so happy up there?"
"Come along and I'll tell you about it," said Vinzi, going downstairs.
His father stood in the doorway, to forecast the weather, for he had just stepped out of his bedroom. Now he turned around.
"What, already?" he said in surprise. "That is a good sign. You learned something up there, Vinzi, that is worth while, for you did not use to be the first one up in the morning. Come, let us stroll over to the walnut trees until mother calls us to breakfast. The trees are making splendid growth, and the grass is thick under them too. Perhaps you can see that things here at home are lovely too, better than you did before. Do you?"
"Oh, yes!" declared Vinzi with his whole heart, looking up at the dense foliage of the walnut trees, under which he had always liked to tarry.
"You have seen how fine farm life is up there, and have learned to enjoy it. It is just as fine down here with us, and to cultivate a farm such as ours and to call it one's own is best of all."
"I could wish for something even better than that," said Vinzi with hesitation and then was silent.
His father looked at him in consternation.
"Listen, Vinzi! I am glad you have been happy up on the mountain; I haven't a word to say against it, but I am wondering what you have found up there that is better than what is down here. Tell me what it is."
"The loveliest thing up there is the harmonium in the hospice, and above everything else in the world I wish to learn to play it as Father Silvanus does."
Vinzenz Lesa darted a piercing look at his son. He stood silent a while, then: "Do you really mean what you say, Vinzi, or is it a joke?"
"I really mean just what I say," replied Vinzi.
"Well, then," said his father, "I will say something so you will know what I think of the matter. I sent you up the mountain to learn from a merry lot of boys how to enjoy farm work, for you really must learn to like it. I believed your eyes had been opened, that you had found yourself and come to your senses. But now I find you are every bit as childish as when you went away, with nothing but nonsense about music in your head. I hope I'll find a way to bring you to your senses yet and to make you see your good fortune. I certainly never thought you could get such fancies up there. You shall never go up there again. I'll find some other remedy."
Vinzi listened quietly to all his father said, though the words seemed to crush him, and when his father turned and went back to the house, he threw himself on the ground and tried to stifle his sobs by burying his face in the grass. He had surmised all along that his father would ignore his wishes about music and had cherished no hope of any other outcome. But he had firmly counted on returning to the mountain, and now that prospect was gone.
"Vinzi, you are to—" but Stefeli's voice suddenly ceased as she came nearer and heard him sobbing. "Oh, Vinzi, what is the matter?" she asked. "You must come into the house. If you can stop going on like this you must come to breakfast. Father is already at the table and mother sent me to fetch you quickly."
Vinzi jumped up and ran over to the pump, and bathed his eyes again and again to remove all traces of tears.
"You're all right; come along now," urged Stefeli. "Mr. Delrick never comes down to breakfast, father takes no notice and mother, will say nothing. Do come along!"
The two went in, and when Vinzi took his seat with bowed head, his father gave him one keen glance. Then he pushed away his half-empty cup, rose, and went outdoors. The sight of tears always upset Vinzenz Lesa, particularly those of his son, who was more precious to him than all his possessions.
"What is the matter with father?" asked the mother, and when Vinzi raised his head, she exclaimed, "Oh, and what is the matter with you?"
Try as he would, Vinzi could not say a word, and laying his head on his arms, he sobbed aloud.
Stefeli swallowed her milk and ran out of the room to escape the sight of her mother's anxious face. "Oh, if Mr. Delrick would only come!" she sighed; for Stefeli had noticed that when her father and mother sought his advice, every difficulty seemed to disappear. Now that things were so topsy-turvy, he could surely help.
Mr. Delrick was coming down the stairs from his room as Stefeli rushed out, and when she ran up to him and seized his hand, he asked kindly, "Are you ready to start? Are you coming with me for a morning walk?"
Stefeli had hoped he would ask this very question and gladly went off with him. She quickly poured into his ear how Vinzi had cried till his eyes were red and swollen, how her father had not finished his coffee, but had pushed the cup aside and hurried off, and now her mother was sadder than she had ever seen her.
"But you will make everything all right again," concluded Stefeli with great confidence.
"I will do whatever I can," he promised.
The child's words gave him food for thought. He wondered if the mother's fears had become a fact, and the thought caused him the greater anxiety because he planned to depart within a few days to meet a friend at the Italian lakes.
When the two returned to the house, matters did not appear to be much better. Vinzi had told his mother at last how his father's words had shattered all his hopes, and she had tried to console him by saying he might change his mind; Vinzi should try to do his father's pleasure and show an interest in the tasks he set him. Then his father would surely allow him to return to the mountain.
But Vinzi shook his head and said, "Father will never let me go again. He thinks I find pleasure up there in something he does not want me to do, and that is true. I understand now what he means, though I did not before."
His mother could say no more, for she believed Vinzi was right. What would happen next? Would he be sent away again? If so, where? Her husband had an older brother, and the two men had managed the farm at Freiburg which they had inherited from their father. When they had inherited the estate in Leuk from their cousin, Vinzenz had decided to live on it, for if it was to be brought into good condition again after having been sadly neglected, he would have to look after it himself. Her husband's brother was as silent and unsociable as the old cousin who had lived in Leuk, and he looked as much the savage too. Vinzenz had left an old servant with him on the Freiburg farm who knew how to do
everything just as Vinzenz wanted it. His brother was averse to undertaking anything new, and kept postponing all personal effort in the hope that his brother would soon return.
Mrs. Lesa knew that there had been eccentric people in the Lesa family and suddenly a new fear arose in her heart. If the father decided to send Vinzi to the Freiburg estate in order to interest him in the work and management of a farm, there would be nothing but solitude for him there. Might not the boy, who had always been different from other children, grow still more peculiar if he lived with his eccentric uncle? It was said the old cousin at Leuk used to sit in front of his barn for hours at a time and stare fixedly into space, and the people had called him Starri of Leuk.* The Freiburg uncle was said to do the same thing and as such nicknames are passed along and everyone knew the Lesa family originally came from Leuk, he also was called Starri of Leuk.
* The Starer of Leuk.
When she reached this point in her thinking, she was more anxious than ever. Her husband's grievance against his son was that he was always staring into the distance, never seeing or hearing what went on before his eyes. What if her lively young son should become the third Starri of Leuk?
She was roused from her dark forebodings by Stefeli's sudden entrance. She had come to tell her mother that Mr. Delrick had returned from his morning walk and was now talking to Vinzi in his room. Mrs. Lesa hurried to prepare her lodger's breakfast, which was not ready for him because he had returned much earlier than usual.
Mr. Delrick was well aware of Vinzi's lifelong passion for music, and he also knew the father's will and wish, and that he had sent his son to the mountain in order to accomplish his purpose. But he had not learned from Stefeli's eager story what had roused the father's anger and caused the son's tears so soon after the joyful homecoming. He took such a lively interest in the joys and sorrows of the Lesa family that he felt he must learn if he could help now in any way. He was to be with them such a very short time that he had hurried back from his walk to talk to the brooding Vinzi. Sitting down beside him, he told him he would be traveling over the Simplon in two days, and if Vinzi had any messages for his friends, he would gladly carry them.
Vinzi's face brightened at this news, and he asked with intense longing, "Are you going to see Father Silvanus and the grandfather?"
"I do not know who they are," answered Mr. Delrick. "Tell me about them, and about all your experiences up there."
Vinzi opened his heart. How he talked of all that occupied his thoughts! Mr. Delrick showed such quick sympathy that he could tell him all about the friends and the music that had made him so happy on the mountain. And now he would be glad to do whatever work was to be done, and would do it happily, even to giving up playing or even hearing any more music, if only he could hope to return to the mountain next summer and go to Father Silvanus every morning. But his father had said that could not be. His account shed new light on the matter, and after a while Mr. Delrick said, "Tell me, Vinzi, did Father Silvanus ask you to try to carry on your music at home or did he only mean that he wished you to continue your lessons if you went back to him?"
Vinzi reported what the priest had advised and that he had said it would be impossible as he knew his father would not allow such a thing.
"You wish to learn to play an instrument for your own pleasure, Vinzi?" inquired Mr. Delrick. "Have you thought of making music your life work? Or could you not imagine such a thing?"
Vinzi's eyes flamed.
"Oh, yes, I could! I kept thinking about it while I was up on the mountain, more each day. I can very well imagine what that would be!" Vinzi assured him. "I would like not only to play an instrument but want to know all about music, like Father Silvanus. He knows everything and can explain how the notes are put together so they make harmony, and how to write them down so that one can read them from the page. He started to teach me all that, and it is so lovely and so wonderful! Oh, I would gladly shovel snow all day and do all kinds of hard labor in order to stay up there the whole winter if I might be with Father Silvanus, for he would continue teaching me. He said so." Vinzi found it difficult to suppress his rising grief.
"You see, Vinzi, your father has only your welfare at heart," explained Mr. Delrick kindly. "You know that yourself, and I can assure you it is so. He made this decision because he thinks your life up on the mountain would stand in the way of your happiness. But time brings many changes, and he may not hold to this idea. It is altogether wrong for you to keep repeating those words; they only make you sad. Did you not find good fortune and happiness where you expected only sorrow and pain? Remember that, Vinzi; it will give you courage."
While they had been talking, Mrs. Lesa had gone in and out of the room, setting the breakfast table, and it did much for her peace of mind to see the two talking and to know the boy was paying close attention to Mr. Delrick's words.
"Now, Vinzi, pull yourself together and be happy that you are home again," advised Mr. Delrick, getting up from his chair. "Show your father a happy face when he comes home and be willing to do the work he wishes you to do. Then everything will come out right. Will you think over what I have said?"
Vinzi readily promised and when Mr. Delrick left the room looked up at his mother with brighter eyes.
The day passed quietly, for all felt depressed and the merry mood of the evening before had vanished. When evening came and Vinzenz sat out on his bench as usual, his forehead was drawn into deep wrinkles and he let his pipe go out as he stared at the ground.
Mr. Delrick now stepped up to him and as he struck a match and offered it to his host, he remarked, "You are not
in a good humor, Mr. Lesa, or you would not let your pipe go out. Here, light it again."
"Humor, humor indeed!" repeated Mr. Lesa savagely. "When a field is destroyed by hail, one may hope the next year will bring a crop. But when one's only son goes from bad to worse, where is there any hope?"
"So far as I can judge, you have a well-trained and honest son, Mr. Lesa," said Mr. Delrick calmly.
"There is nothing to complain about in that respect," replied the father. "But what's to be done when a father tries to see that all his son has to do is to enjoy his good fortune, and the boy does not see it or know what is best for him, and doesn't wish to learn anything but childish stuff? But I will not give up until Vinzi returns to his senses, even if I have to send him across the ocean. However, there is a place nearer where his childishness will find no support, that's a sure thing."
"You mean your son's love of music and his wish to devote himself to it? That may be something quite different from childishness; it may be something very serious on his part."
"Something very serious!" repeated the roused father. "It is play, just like anything else. I would have nothing against it if the boy amused himself singing merry songs in the leisure of the evening, but that's not his way. He sits and gazes ahead without seeing or hearing anything; he thinks only about his piping. Once I found a whole pile of pipes he had carved, stowed away in the haymow children's toys on which he put all his thought!"
"But that shows how earnest he is in his longing for music," replied Mr. Delrick. "If it were only play like any
other game, he would have dropped it for something else long since, after the way of boys. His mind would not cling so to one thing. And his perseverance in trying to make each instrument better so it would meet his requirements shows how great his zeal is. I am convinced this is no play with him but has become his serious work."
"Work! Do you call such a thing work?" and in his anger Vinzenz Lesa puffed unusually thick clouds out of his pipe.
"Certainly music can be work, and where there is genius, it can become a high calling," continued Mr. Delrick. "I think, Mr. Lesa, you should let your son learn an instrument. His desire for it is so intense, he would undertake any kind of work with pleasure in order to fulfil his wish."
Vinzenz Lesa laid his pipe aside, and that with him was a sign of greatest agitation.
"Sir," he said, restraining his anger with difficulty, "the only son of Vinzenz Lesa shall not be a musician. He has a farm on which he can live like a gentleman. If he wants to blow a trumpet later on as much as he wants to now, he can afford to do so. But it is quite a different matter to lead a boy away from a profitable and proper calling and train him to play instruments and write music. Vinzi has no common sense, for he tells me what you have just said: that he wants to take up music as his occupation. No, sir, the son of Vinzenz Lesa shall never become a wandering minstrel!"
"It is not necessary for a musician to be a wanderer," Mr. Delrick declared. "There are many musicians, gifted men, who practise their calling in quite a different manner."