Differences between revisions 7 and 8
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
[[TableOfContents]] <<TableOfContents>>
Line 11: Line 11:
Oliver Steele takes a look at [http://osteele.com/archives/2004/08/web-mvc Web MVC vs Rich Internet Application] architectures. And a nice, clear exposition it is. Oliver Steele takes a look at [[http://osteele.com/archives/2004/08/web-mvc|Web MVC vs Rich Internet Application]] architectures. And a nice, clear exposition it is.
Line 14: Line 14:
[http://www.waferproject.org/ Wafer] is "a research project which compares the many open source web application frameworks which are available using a common example application." Looks interesting. [[http://www.waferproject.org/|Wafer]] is "a research project which compares the many open source web application frameworks which are available using a common example application." Looks interesting.
Line 17: Line 17:
[http://struts.apache.org/ Apache Struts] Action Framework makes you work awfully hard to do something simple, but it's getting better. I don't like the way that additions and changes require touching so many files. And there's much information online that's out-of-date and misleading to those trying to learn Struts. Perhaps on a large project, with separate teams for various tasks (not the way I would separate into teams, given my druthers), the complexity of Struts is justified by its power. [[http://struts.apache.org/|Apache Struts]] Action Framework makes you work awfully hard to do something simple, but it's getting better. I don't like the way that additions and changes require touching so many files. And there's much information online that's out-of-date and misleading to those trying to learn Struts. Perhaps on a large project, with separate teams for various tasks (not the way I would separate into teams, given my druthers), the complexity of Struts is justified by its power.
Line 36: Line 36:
 * ''Struts Survival Guide -- Basics to Best Practices'' (covers Struts 1.1) by Srikanth Shenoy [http://www.objectsource.com/Struts_Survival_Guide.pdf PDF] and [http://www.objectsource.com/j2ee-resources.html resource links] from the same site.
 * [http://wiki.apache.org/struts/StrutsWidgets Struts Widgets] wiki page showing how to accomplish a number of common GUI widgets using Struts.
 * [http://extremecomponents.org/extremesite/welcome.jsp eXtremeComponents] is a tag libary distributed under an Apache license. The eXtremeTable takes a Collection of Beans or a Collection of Maps out of a given servlet scope and renders the content on the JSP.
 * [http://struts.sourceforge.net/strutsdialogs/dialogaction.html DialogAction] handles the related GET and POST in a single Action.
 * ''Struts Survival Guide -- Basics to Best Practices'' (covers Struts 1.1) by Srikanth Shenoy [[http://www.objectsource.com/Struts_Survival_Guide.pdf|PDF]] and [[http://www.objectsource.com/j2ee-resources.html|resource links]] from the same site.
 * [[http://wiki.apache.org/struts/StrutsWidgets|Struts Widgets]] wiki page showing how to accomplish a number of common GUI widgets using Struts.
 * [[http://extremecomponents.org/extremesite/welcome.jsp|eXtremeComponents]] is a tag libary distributed under an Apache license. The eXtremeTable takes a Collection of Beans or a Collection of Maps out of a given servlet scope and renders the content on the JSP.
 * [[http://struts.sourceforge.net/strutsdialogs/dialogaction.html|DialogAction]] handles the related GET and POST in a single Action.
Line 43: Line 43:
 * [http://www.rabago.net/struts/formdef/ FormDef] allows you to easily declare Struts form beans based on existing business classes. ([https://formdef.dev.java.net/ code])
 * [http://struts.application-servers.com/suggest/index.html Struts-Layout Suggest] tag allows to render a text field with a suggestions list.
 * [http://javawebparts.sourceforge.net JavaWebParts] provides AJAX support
 * about [http://marc.theaimsgroup.com/?l=struts-user&m=104205482618830&w=2 TLDs and URIs]
 * [[http://www.rabago.net/struts/formdef/|FormDef]] allows you to easily declare Struts form beans based on existing business classes. ([[https://formdef.dev.java.net/|code]])
 * [[http://struts.application-servers.com/suggest/index.html|Struts-Layout Suggest]] tag allows to render a text field with a suggestions list.
 * [[http://javawebparts.sourceforge.net|JavaWebParts]] provides AJAX support
 * about [[http://marc.theaimsgroup.com/?l=struts-user&m=104205482618830&w=2|TLDs and URIs]]
Line 49: Line 49:
[http://wicket.sourceforge.net/ Wicket] is "a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level." [[http://wicket.sourceforge.net/|Wicket]] is "a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level."

Building a Graphical User Interface in Java

local application

Swing vs. SWT

I've used Swing a bit, and haven't gotten around to trying SWT. Can someone give me a synopsis of the differences?

web application

Oliver Steele takes a look at Web MVC vs Rich Internet Application architectures. And a nice, clear exposition it is.

Wafer

Wafer is "a research project which compares the many open source web application frameworks which are available using a common example application." Looks interesting.

Struts Action Framework

Apache Struts Action Framework makes you work awfully hard to do something simple, but it's getting better. I don't like the way that additions and changes require touching so many files. And there's much information online that's out-of-date and misleading to those trying to learn Struts. Perhaps on a large project, with separate teams for various tasks (not the way I would separate into teams, given my druthers), the complexity of Struts is justified by its power.

In a Nutshell

The normal pattern is to have a prerender action before each page to put information into request scope that the .JSP will display. You can also use a tile controller for this, but by the time you reach the controller, you're committed as to which page you're going to display. If you use an Action, you have the opportunity to forward to a different page based on current conditions.

The .JSP frequently has one or more HTML forms, which are backed by an ActionForm (a.k.a. Form Bean) which collects the data from the Request. An advantage of using an ActionForm over just retrieving the data from the Request in your Action, is that you can declaritively add validation to the form input. Michael Jouravlev makes a convincing argument that you should not set this validation to be automatic, but call it explicitly in your Action.

The Action receiving the form submission should

  1. Validate the input.
  2. Marshall the input submission into Domain Objects
  3. Call the Business Layer
  4. Catch any exceptions from the Business Layer and turn them into appropriate error page forwards or other feedback to the user.
  5. Forward to a display page (e.g. prerender action) that will unmarshall the results for display.

The use of POST requests to cause a change and GET requests for display (even after a POST request) eliminates the infamous "back button problem."

Struts Resources

Wicket

Wicket is "a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level."

SiteMesh

SiteMesh is an alternative to Jakarta Tiles.

iDIAcomputing: JavaGui (last edited 2009-07-27 18:26:15 by localhost)