July 11th, 2007 by Wes Wannemacher
In the last post, I presented an in-depth example of a very simple Struts2 Action. Although this may have been helpful to some, there is much more that can be done with actions. The important aspect of the last example is to understand that Struts2 Actions are simple POJOs. Having your UI built around simple objects allows you to create code that is much easier to maintain. Simple classes are easier to unit test, easier to enhance, and easier to debug. In this post, I will show you that this simplicity carries through even for advanced aspects of using Struts2 Actions. Read the rest of this entry »
Category: Java, Struts 2 |
18 Comments »
July 7th, 2007 by Wes Wannemacher
The core component of the Struts2 framework is the Action. If you are unfamiliar with the Model 2 or MVC pattern, take a moment to read my previous post on the subject. The action is where you glue your business layer to your web-app. What does that mean, glue your business layer to your web-app? Well, if you have followed the guidelines of the Model 2 pattern, you will have created a separate set of classes to handle your business logic. Since this set of classes does not have any dependence on the the JSP/Servlet API, or any dependence on the API of the framework you have chosen (Struts2), then these classes need to be integrated into the web-app. To integrate these classes, you will use these classes in your actions. Read the rest of this entry »
Category: Java, Struts 2 |
34 Comments »
July 3rd, 2007 by Wes Wannemacher
So I have talked and talked in the previous entries without showing any code examples. Finally, it is time to start looking at code. I apologize for waiting this long, but in my defense, the Struts 2.x framework is complex and without thorough coverage, I would not be doing it justice. Read the rest of this entry »
Category: Java, Struts 2 |
17 Comments »
July 2nd, 2007 by Wes Wannemacher
At this point, you may have read the first part of the series and thought, “Well… That’s nice, but it doesn’t really help me create a Struts2-based web-app.” If you were hoping to read that post and then go and create the next flickr.com, then I apologize. In case you have not figured it out yet, Struts2 is a complex framework. On the Strut2 mailing list, I constantly here people asking, “Where do I start?” My hope is that this series will give people an answer to that question. But, getting started is tougher than it sounds. Read the rest of this entry »
Category: Java, Struts 2 |
4 Comments »
July 1st, 2007 by Wes Wannemacher
To start a Struts2-based project, it is as easy as downloading the appropriate WAR file from the Struts website (http://struts.apache.org) and importing it into the chosen development environment. The choice of developer platform is strictly a matter of preference. Personally, I enjoy using Eclipse Webtools combined with the Websphere AppServer Community Edition. Eclipse Webtools has a nifty ‘Import WAR’ utility that will setup the Struts2 template WAR files rather nicely. Read the rest of this entry »
Category: Java, Struts 2 |
19 Comments »
June 30th, 2007 by Wes Wannemacher
All professional developers have heard the phrase – “When all that you have is a hammer, then everything looks like a nail.” To many programmers, their preferred platform becomes their hammer. I will outline the reasons I prefer writing Java code, but this is mostly a response to the LAMP zealotry I come across regularly. As an experienced developer, I have learned to try to find the best tool for the job. Although this article may read like Java zealotry, I have recently written PHP and Perl code. Astute readers will also notice that this blog is based on Wordpress. So, I make an effort, as I believe all developers should, to find the best solution rather than retro-fitting my own preferred platform to the current project. Read the rest of this entry »
Category: Java, Opinion |
3 Comments »