Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.
You searched this site for "framework". 558 entries found.

You can also try this same search on Google.

Using XDoclet to generate your validation.xml?

Are you using XDoclet to generate the validation.xml file for Struts' Validator Framework? If you're using Struts and you're not using the Validator - you should be IMO. It makes both client-side and server-side validation soooo simple. Using XDoclet to generate the key file (validation.xml) makes implementation a piece of cake. We have Erik to thank for this wonderful addition to XDoclet. Much appreciated sir!

I'm guessing that not many people are using this feature b/c it works kinda funky right now. It disregards the order of your properties in your ValidatorForm and generates entries in alphabetical order. This is great except the client-side (JavaScript) piece of the Validator uses the order to determine which fields to validate first. This has caused a slight headache for me on my project, so I fixed it. Checkout XDoclet's JIRA for the bug and the patch. Hopefully it'll get committed soon, but in the meantime, I'll continue using my patched Apache module that allows me to generate ActionForms from POJOs and orders my validation.xml correctly.

Posted in Java at Jan 21 2003, 10:12:23 PM MST 6 Comments

xPetstore v2.2 Released!

I haven't looked at it much or used it at all, but it sounds good.

xPetStore is a WODRA (Write Once, Deploy and Run Anywhere) implementation of Sun PetStore application based on the following opensource tools/framework:
- XDoclet
- Struts
- SiteMesh

If you're writing web applications (and you're using Struts or Webwork) and you're NOT using XDoclet (or one if it's derivatives - i.e. Middlegen), you're wasting your time (IMHO). Of course, I also believe that if you're not using Ant to build your java-based project, you're really wasting your time.

Hmmm, while over at the WebWork site, I stumbled upon this Eclipse + Resin + WebWork + Hibernate tutorial. I don't know if it's such a good idea to call your persistence layer directly from your servlets is it? Shouldn't that be in a Business Delegate - or am I losing focus of KISS and trying to follow too many patterns? Patterns give me more opportunities for Unit Testing. The only way to test this servlet would be something like Cactus, right? As always, to each his own... ;-)

Posted in Java at Jan 19 2003, 10:24:25 PM MST 1 Comment

Fighting Technology and Fatherhood

Today was one of those days I hate. I've been struggling with Hibernate for what seems like weeks now. Today was a day that almost convinced me to quit trying. I seem to be fighting with XDoclet and Hibernate all day, every day. I don't seem to be getting anything done on my AppFuse project, nor at my new on-site project.

I am getting things done, but if I'd just done JDBC, I'd probably much further ahead than I am right now. Such is the life of someone that tries to learn the latest technologies. I remember doing this with Struts and now I'm grateful that I did. Hopefully, using/learning/struggling with XDoclet and Hibernate will soon get better. The Hibernate and XDoclet developers have been great in dealing with my learning curve - thanks guys.

I predict my learning curve will be similar as that with Struts. This means that I will write all kinds of code as workarounds for problems I'm having - since I have ridiculous deadlines and I need to get it working. The sad part is that I'm willing to bet that I'll delete a whole bunch of this code when I finally figure out how to work with Hibernate, rather than against it. I think it's a great framework, but I'm trying to do too much from examples, rather than digging in and actually learning the framework. This is the hard way, but alas - I will learn it well - through my own mistakes.

I got a nice break from Technology tonight as Julie and I went to pick up our new car. We drove the long way home - through Red Rocks. We enjoyed the smooth ride, bright lights, and nice stereo. The bug had all of this, but the Accord is newer, and therefore, more fun. We stopped and bought a bottle of wine at one of my favorite liquor stores in Morrison and had a nice little celebration. I was planning on finishing up my struts-resume sample application tonight, but instead decided to play with Abbie. We gurgled and had some "tummy time" - and I definitely feel like I did the right thing.

I think I really need to stop working so much, and start being a Dad more. I've worked every weekend since she was born, and I feel like an Ass for it. Hopefully, the Wrox gig will be over soon, and I'll be able to catch up on my work for OnPoint and relax a little more. All this extra work is wearing me thin, especially when it's been dumping in the mountains lately - I don't know how many more "8 inches at Vail" e-mails I can take!!

The encouraging news (for you, the reader) is that I (with the help of Keith) upgraded this site to use a 100MB connection tonight. Hopefully the site will be a bit faster, but you know how bandwidth works - you pay for more and never seem to get it.

Posted in Java at Jan 02 2003, 10:21:16 PM MST 2 Comments

Copying Properties: The Good, the Bad and the Ugly

I realize that having an ActionForm and a POJO with the same getters/setters is ridiculous, but please bear with me for this example. I have a Form and a POJO with Strings, Longs and Dates. The Longs and the Dates get converted into Strings when I get the data from the database using BeanUtils.copyProperties. This works great.

BeanUtils.copyProperties(userForm, user);

However, when going back, it's a different story - here's the ugly way:

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

Date dateChanged = format.parse(userForm.getDateChanged());
Date dateCreated = format.parse(userForm.getDateCreated());

user = new User(userForm.getUserId(), userForm.getPassword(), 
                Long.valueOf(userForm.getDesktopId()),
                Long.valueOf(userForm.getCubeId()), 
                userForm.getCreatedBy(), dateCreated,
		userForm.getChangedBy(), dateChanged);

While this works, it's ugly and a pain. I want something like the ActionForm-Value Object mapper. This mapper allows you to easily copy properties between VOs (or Hibernate Objects) and Forms, and vise-versa.

vo = FormToVOMapper.map(form, new ExampleVO());

So I could do something as simple as user = FormToVOMapper.map(userForm, new User()); I like this mapper and I used it on my last project, where it works great. However, I get the feeling that developers in the Struts Community are using something better - and I want to use it. So please, tell me what it is and lets figure out the best way to do this. Another method I've used in the past is to set the VO (or object) on the form itself, allowing for setting of Strings without copying - and setting dates on the form, to be manipulated by the setter. This framework worked great, and I was actually the happiest with it out of any of the above. Chime in and give me your opinions!

Posted in Java at Dec 27 2002, 03:14:29 PM MST 6 Comments

Eclipse Plug-ins for Struts and DAO Generation

I ran across STRECL.COM today via the struts-user mailing list.

TRECL is a set of plugins for the Eclipse IDE. Using STRECL you will get a powerful tool for Java server-side applications development. STRECL plugins offer easier utilization of the Struts framework in Eclipse IDE by visualization of editing, facilitating navigation, wizards etc.

STRECL currently offers the following plugins:
  • struts-config.xml editor
  • JSP editor
  • DAO generator
  • validation.xml editor
  • Struts navigator view

Just in time to get some coverage in my Struts chapter - that is, if it's any good ;-)

Posted in Java at Dec 17 2002, 05:52:00 AM MST 3 Comments

Should I be using DBUnit?

Here's a question for you: Should I be using DBUnit in AppFuse and struts-resume? I've heard of it before, but have never used it. It sounds good:

The Dbunit database testing framework is a JUnit extension which sets up your database in a known state before executing your tests. This framework uses xml datasets (collection of data tables) and performs database operations before and after each test. The Dbunit framework supports both the clean insert and the refresh strategies.

Actually, know that I think of it, of course I should be! Currently, I use an Ant Sql task to create my database, and then Hibernate's SchemaExport class to create the tables. I have no way to automagically enter data into the database. I suppose I could use another sql task in my build file, but it sounds like this job is more suited for DBUnit. I don't want to give up Hibernate's table generation as it's smart and adds new columns when I add new columns to my VO. Hopefully these two can work together nicely.

I also found this Best Practices guide on using Hibernate. The first line about using fine-grained objects has motivated me to refactor my User class.

Write fine-grained classes and map them using <component> or <component-element>. Use an Address class to encapsulate street, suburb, state, postcode. This encourages code reuse and simplifies refactoring.

Posted in Java at Dec 14 2002, 01:37:09 AM MST Add a Comment

New Job, Struts, Testing Frameworks and Maven

I found out this afternoon that they want me for the job I interviewed for yesterday. I'm expecting to start on Wednesday. It's a small team of 3 folks and should be a lot of fun. I'm really looking forward to getting back into an office environment where I can converse with co-workers and such. After blogging for the last few months, I feel like the java.blogs guys are my co-workers, but it's still fun to talk and interact with folks. I never used to like it - I'd bring my lunch to work everyday, and hunker down like a code monkey the whole time - just trying to get my 8 hours in and get outa there. I'd get annoyed when people would stop to talk about their weekend or other random stuff. Now I'm going to be that guy - I'd better watch for the telltale signs of get the hell out of my cube! I wonder if we'll even have cubes? The floor where my interview was had just cleared out a bunch of folks - it was empty when I went in there. When I say cleared out, you know what I mean. Needless to say, there is plenty of space and plenty of computers available -- it'll be interesting to see what I get.

My last project had horrible machines - NT4 Gateways with 4MB video cards and about 700 Mhz. And this was last year!! I had just bought a brand new Dell 8100 P4 1.5 Ghz 2 weeks before I started the gig - so you can imagine my disappointment. And I was running XP at the time, albeit a beta version. But still, I felt like I was taking a huge step back in time. So I brought in my own Windows 2000 CD on my 8th day on the job. It all looked to be going pretty smooth (and the install was about to finish around 7 a.m. - I got there at 5) when everyone started rolling in. The video drivers weren't compatible and I was forced to humbly call tech support and tell that how I had violated all the rules. This place at least has Windows 2000, and I have my Powerbook, so all should be good. I just hope I can get a dual monitor setup - there's nothing quite so enjoyable.

This evening I did some minimal development on AppFuse. I spent most of the day writing the Struts Chapter. I'm on page 12 and expect to do 10-20 more pages. It was fun writing because I described tools that make developing Struts apps easier: Ant, XDoclet, JUnit, StrutsTestCase, and Cactus among others. I dug in a little to the Testing frameworks and played with them, but nothing too serious. I can waste many hours coding and I need to finish writing, then code later. I used 2 very cool tools today. The first is Canoo's WebTest. It basically is a framework built on top of HttpUnit that allows you to write all your tests as Ant tasks. It's fricken sweet as you don't have to really write any code, and it just worked for me. Check out this file (XML) to see how easy it is.

The 2nd tool was written by Erik Hatcher to generate JSPs and a resource bundle based on a Struts ActionForm. I hadn't tried it out until tonight and it just worked - my favorite feature in any software. The one area I think I might run into issues (in generating all this code), is when I have ArrayLists of beans on a form. I think Hibernate will allow this using Sets, Lists and other types of Collections, but I'm doubting that XDoclet's strutsform task will support it and I don't think Erik's too; generates nested tag libraries or anything like that. This is unfortunate because I'll probably get a wild hair up my you-know-what and want to create this functionality. And there goes my deadline, right out the window. Need.... to ... stay ... focused..!

Lastly, I made an attempt to mavenize AppFuse. It was pretty easy at first, as you're only required to alter this XML file to fit your project's needs. I realized I didn't have much as far as a CVS repository, mailing lists, etc., but I also realized that these would be almost essential to any project. And they'd certainly make things a lot simpler - even on a small team. When I got to the dependency section (which is what I really need), I sorta gave up. Here's my dependencies and their presence at the Maven Repository:

So while Maven looks great, it doesn't offer all the third-party jars I need. Is it possible to partially integrate? Also, I found the documentation to be a bit lacking on how exactly to configure each dependency. Is there a standard naming convention or versioning to rely on? It'd be great to have a list and possible versions - or even XML fragments you can copy/past. Can we, as developers, contribute nightly builds to the repository? I'd love to use both AppFuse and Maven at my new project, but I hate waiting on things to happen. If I can do anything to make the above modules/versions present in Maven, let me know.

Posted in Java at Dec 13 2002, 06:23:07 PM MST 1 Comment

Eclipse Plugins and Hibernate

I found a new site with a list of Eclipse plugins tonight. I was hoping that the Ant View plugin could solve my Ant problems in Eclipse, but I can't seem to figure out what it does. I gave it the ol' 30 seconds of investigation - maybe I should read the documentation. The problem I'm having now is (after swapping Ant 1.4 jars for 1.5.1) is:

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.

Hmmm, works fine from Cygwin, and Eclipse (2.0.2) has tools.jar and rt.jar in the classpath. Must be time to download a nightly build.

There was a lot of talk today in the java.blogs community about Hibernate. I'm happy to see this as it feels like I just bought a new car and everyone is saying it's the best car on the road. I decided to use Hibernate based on Dave's implementation in Ag. It looked easy enough, so I figured - why not?! It turns out, at the same time, that the XDoclet folks were in the midst of creating a new hibernate module in CVS. In fact, I got the hibernate module from Joel Rosi-Schwartz (I'm assuming a hibernate developer) before it was even in the XDoclet source tree.

I got to be a guinea pig in making hibernate tags work with XDoclet. I have to say that with Dave's working example, I was able to markup a POJO with hibernate/xdoclet tags and generate my persistence layer in a matter of minutes. It just worked. Kinda like Tomcat IMHO. That's how software should be. Check out my security-example if you're interested in using Hibernate with XDoclet. The readme in the source will explain how to run initial generation and tests. Currently, it generates a Struts Validator Form and VO from an Entity bean (located at src/ejb/org/apache/template/User.java). Why? Because Struts Forms can only be generated from Entity Beans. This needs to change IMO. But at the same time, the EJB architecture is already in place, I just need to execute the ejb-related tasks, and I'm in business.

In other news, a couple of Struts related goodies:

  • ONJava.com has an introduction to the Validator Framework by Chuck Cavanass, an Introduction to Eclipse and Creating Reports with FOP. I used FOP on a project last year around this time and it's super slick. It's basically using XSL to generate PDF and RTF from an XML file. I highly recommend using something like RTF2FO to generate an XSL Template from a Word document.
  • Struts Kick Start is now shipping from Amazon. I'd buy all the Struts books just to say you have them. I've got three ;) Haven't read any. Damn, I wish I had the time! Reading Erik Hatcher's Java Development with Ant was one of the smartest things I did this year. Actually, the smartest thing I did was get my wife pregnant yeah baby
  • I downloaded TogetherSoft's Control Center to do some UML Modeling for the Struts Chapter, and found that they use Struts on their site. Nice...

Posted in Java at Dec 12 2002, 05:37:04 PM MST 22 Comments

The TVC Framework

Here's an interesting new extension for Struts:

The TVC Framework uses the Struts framework to create HTML tables with functionality that includes paging, sorting, filtering of data, and data validation.

This joins the ranks of Ed's <display:*> tag library and Yuriy's html table tag library. I've always like the display tag library as it's easy to setup and use - just pass it an ArrayList of beans and you're off! The TVC Framework seems to offer some cool functionality, but you have to pay $995 for the good stuff :(. Of course, if you're trying to code similar functionality on your own, you'd probably save your self some money if you bought it.

Posted in Java at Dec 11 2002, 04:20:36 AM MST 3 Comments

Down on Struts?

This post on Why are people so down on Struts probably deserves an immediate rebuttle, but I'm too tired and have better things to do. The best reason I can say that I like it - it's paying the bills. Show me a better framework and a contract that wants to use it, and I'll be all over it like a monkey f**in' a football. ;-)

So you ask, what "better things" do you have to do. Well, there are many things better than pounding on this keyboard (i.e. playing with Abbie, loving my wife), however, I'm a sad sob and I'll be here all night. I'm planning on digging into struts-menu and 1) upgrading it to CoolMenus4 and 2) configuring it to allow lists for DHTML menus. Then I have to make sure both methods allow for permission checking, since I want to use struts-menu to display url-hiding security in my chapter. Wish me luck - and feel free to help if you want to get your hands dirty!

Posted in Java at Dec 06 2002, 01:40:17 PM MST 1 Comment