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 "appfuse". 771 entries found.

You can also try this same search on Google.

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

Java Development with Ant, The Application

Ant Book If you've been fortunate enough to read Erik Hatcher's Java Development with Ant, you know that there's tons of good tips in it. I read it and I've been recommending it every since. Erik has been continuing development of the sample app for the book ever since it was released. I got many tips from Erik in developing AppFuse and I have to say, it really is a nice example. Maybe I'll get some more stuff now that it appears to have jumped from version 0.4 to 0.9! Here's a message Erik sent about the latest release.

All -

I'm proud (and worried about the support e-mails! :) to announce the 
near-final release of a project demonstrating Ant, XDoclet, Struts, 
JUnit, Cactus, and Lucene.  Its called JavaDevWithAnt as it was written 
for the book Steve and I co-authored and has been refined during 
several presentations I've been giving on Ant, XDoclet and Struts.

The documentation is in draft stage, and my primary goal is to collect 
feedback on polishing the documentation (and the application if there 
are any bugs that surface).  The site where I'm hosting the 
distribution and documentation is:

	http://www.ehatchersolutions.com/JavaDevWithAnt/

Please let me know if you try it out and have suggestions for 
improvement, or just to let me know you tried it and hate it or love 
it, etc.  Feedback more than welcome!  Direct feedback to me at 
[email protected]

	Erik

p.s. Since this e-mail is directed to the XDoclet, Lucene, and Cactus 
lists, here is a brief teaser for you:

XDoclet - its used extensively, even using a custom tag handler to 
generate starter JSP's from Struts form beans.

Lucene - my <index> Ant task is used to index text and HTML files, and 
Lucene's API is used at run-time to query the index.

Cactus - StrutsTestCase is used, although no direct Cactus tests.

Happy information-overload! There's a lot there, but if I could figure it out - I'm sure you can. Erik - finally on Jaguar eh? What took you so long ;-)

Posted in Java at Dec 27 2002, 07:25:45 PM MST 1 Comment

Ant won't delete a file - any ideas?

I've been experiencing this problem for the last couple of days. Basically, when I run "ant clean" on my project, I get the following error:

file:d:/source/appfuse/build.xml:746: 
  Unable to delete file D:\source\appfuse\dist\appfuse-common.jar

I can delete the "dist" directory in Explorer, and also using "rm -r dist" in Cygwin. Any ideas why Ant is choking on this all of a sudden?

Posted in Java at Dec 26 2002, 05:05:32 PM MST 18 Comments

Ant's jspc task - doesn't work on Tomcat 4.1.18

I'm trying to use Ant's JSPC task to pre-compile my JSPs. I've used Erik Hatcher's example from Java Development with Ant. It works great when using a 4.0.x version of Tomcat, and the following jasper.classpath:

<path id="jasper.classpath">
    <fileset dir="${tomcat.home}/lib">
        <include name="jasper-*.jar"/>
    </fileset>
    <fileset dir="${tomcat.home}/common/lib">
        <include name="servlet.jar"/>
    </fileset>
</path>

However, it doesn't work on Tomcat 4.1.17. I had to change the jasper.classpath to find the appropriate jars (they're in different directories now), plus I had to include ant.jar or I got java.lang.NoClassDefFoundError: org/apache/tools/ant/AntClassLoader. Where everything works on the older Tomcat version, now it fails - what gives?

compile-jsp:
     [jspc] Compiling 8 source filesD:\source\appfuse\build\jspc\java
  [jasperc] 2002-12-21 11:15:51 - uriRoot implicitly set to 
            "D:\Tools\tomcat-4.1.17\webapps\appfuse"
  [jasperc] error:/common/footer.jsp(0,0) null
  [jasperc] 2002-12-21 11:15:53 - ERROR-the file '\common\footer.jsp' 
            generated the following general exception: org.apache.jasper.JasperException: 
            /common/footer.jsp(0,0) null

Posted in Java at Dec 21 2002, 05:23:49 PM MST 3 Comments

Bloody Noses and Struts Chapter Progress

I've gotten three bloody noses in the last 36 hours - and I don't seem to recall ever having them before in my life! Yikes - is the stress getting to me?! Oh well, I'm sure I'll be fine. I read on a website today that bloody noses are way over-emphasized and they aren't a big deal at all.

I'm at 22 pages on the Struts chapter now, doing Exceptions and how Struts lets you declare exceptions in your struts-config.xml -- pretty cool stuff. The bad part is that I've never used them before, so it's kinda tough to write about them - at least in the context of Struts. I tried to use Strut's ApplicationException (now renamed ModuleException) last summer on a client's project - and it was too buggy to use. Now it seems to to work as I originally expected it to, and it's pretty sweet. I do feel like I'm building an application to show functionality though, rather than developing an application to fulfill some requirements, which is unfortunate. I'd rather build an application that employs KISS, and shows the easy way to do things. It's like using design patterns because your manager thinks they're a good idea, but you could get the project done in half the time without them. Sure, your app might not be extendable in the future, but if it doesn't live past 3 months, what's the point?! Of course, I think using the Validator and Tiles is easy, and many developers think that's the complicated part. If my learning curve was up to snuff, Exception and Modules (a.k.a sub-applications) would be easy. Soon they will be, though I still may never use them.

Tomorrow is my last day (for a while) as a full-time employee of Raible Designs. I've certainly enjoyed the last year, but I've missed the office comradery and face-to-face interaction. It'll be good to get back into an office, but I'm sure I'll miss coding in my living room within a week, and wish I was back here.

I'm going to get my mugshot tomorrow for the Wrox book - I've convinced Abbie and Julie to go with me so we can get some good family photos - should be fun. After that, I'm going to fill out the paperwork - W2's - for the new gig, and then off to a project kick-off party! Sounds like my kind of project already!! It's got a good name too - Project Fiji. One of the things I'm looking forward to is implementing Struts and Hibernate (if they'll let me) using XDoclet. I've done it in my sample project and AppFuse (expect a new release in a week), but it'll be awesome to cut our development time in half right away! Especially when the first deliverable is due January 15th!

If I'm good (and I can figure it out), I hope to use Maven on the project as well. It should be interesting to be the primary Java Developer on the project, along with a Web Developer and Oracle DBA. I've always been the web developer - but I've learned so much in the past year and a half (since I met Struts), that I feel more than comfortable being the Java guy. You know what the best part is - I feel like I've learned more from the java.blogs community than I have from studying for certifications, or from any conferences I've been to. Keep it up - learning is awesome!

You know what the better part is? Julie just said to me - "thanks for making all my dreams come true." Enough said, life is awesome - even with toilet paper stuffed up my nose and a chapter that seems like it'll never get done.

Posted in Java at Dec 16 2002, 03:56:38 PM MST 1 Comment

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

What Maven Does

I, like Charles, was unsure of what Maven did. James has made it clear and I have seen the light - I think. In my AppFuse project, I have a lib directory that contains all the various third-party jars I'm using in my build process. Among these are XDoclet, Struts, Cactus, JSTL, Hibernate, JUnitDoclet, etc. The problem is that this directory is ~16MB and if I add it to CVS, I've got a monster project. The zipped up version of AppFuse's source is 14MB! That's enough to scare off folks right there.

It sounds to me that Maven can help me out in 2 ways. It can be used to download and install these jars as part of the build process. Slick if it can! Can it get me nightly builds from CVS? The 2nd feature seems to be building a project website for me. That's cool and definitely better than my simple readme file. However, can I make my site look like this (my site) rather than this (Maven site)? The good news I see is that the generated website does use XHTML and a DOCENGINE:

<!DOCENGINE html PUBLIC "-//CollabNet//DTD XHTML 1.0 Transitional//EN"
    "http://www.collabnet.com/dtds/collabnet_transitional_10.dtd">

The bad news is that it's not a standard DOCENGINE and even after I override the doctype and charset, it still does not validate. Of coure, this may not be a big deal, but if this were to be more "standard" it would be easier to convince folks like me to jump on the bandwagon. If there's templates I can modify, show me, and I'll dig like a miner that's struck gold.

Posted in Java at Dec 13 2002, 12:25:05 AM MST 2 Comments

Design Patterns, Marc Fleury and JBoss

I just got back from the Denver JUG meeting and have lots to talk about. I've started this post at 11:03 p.m., for the record. I want to start out with discusssing a topic that Dave and I talked about a few days ago. Basically, in his Ag application, he is using one Business Delegate and one DAO to do all his business logic and data access. Actually, he's got two DAO's, one for Hibernate and one for Castor. Basically, the DAO is determined at startup, set on the Business Delegate and then stuffed into the servlet context. While Ag is a small application, it got me thinking. I believe the recommended pattern for this is to have a Business Delegate for each entity, as well as a DAO. So for a user, you would end up with 4 classes, UserManager/UserManagerImpl and UserDAO/UserDAOHibernate. So everytime I add a new entity, i.e. account, I have to create 4 new classes. What a pain, and a lot of copy and pasting - or at least that's how I'd do it.

Dave's KISS methodology at first struck me as strange, but then I thought, "Damn, that's a lot easier." So now in AppFuse (reference implementation: security-example), I changed to use this idea - with a BusinessManager/BusinessManagerImpl and ApplicationDAO/ApplicationDAOImpl. The idea is that these will contain any and all methods to access data.

I went to the DJUG meeting still struggling this this pattern, feeling like it stunk and I should back it out and go with a factory pattern and a business delegate/dao for each entity. However, during Marc Fleury's presentation, he preached that one of the founding rules of JBoss was KISS. He said that the greatest thing about open source is that no one will ever even look at your code until it's broken. "And how bad does it suck when you have to look through 5 levels of inheritence to figure out the problem?" He mentioned that bad code was his favorite, because chances are - if there's a bug - it'll be staring you in the face, rather than buried inside some design patterns and 10 different classes. I agree, so I'm going with KISS, but I'm also interested in hearing your opinions. I like the current architecture of AppFuse because it sets the business manager on startup, stores it in the servlet context and is available for everyone to use at any time. There's nothing saying that I couldn't set a SessionBean (on the business manager as it's proxy) and call EJBs for my persistence layer.

In fact, after Marc's gospel about JBoss, I want to use EJBs. In fact, not just EJBs, I want to use JBoss - and I can't wait for "JB 4." Why? Well they're adding the ability to add all of EJB's services (i.e. Security, Transactions, Persistence) to any POJO. This means that all you need to do is write a little deployment descriptor for it, and whalla, you're in business. His sermon is something you really need to see to appreciate. I can't do it justice in summarizing it here, but I certainly liked what he had to say, and feel like I'm a better person for it. The JBoss Group's goal is to become the de facto standard for application servers. I like their idea that the app server should be free - and the money (usually spent on app servers) should be directed towards smart developers instead. He also mentioned that JBoss Group (the company) is doing great right now and will be spending some cash on Marketing and PR to squash any rumors that it's not good enough.

Marc mentioned that most of the things he talked about tonight are written in his Blue Paper (PDF, 11 pages), titled "Why I love EJBs". It's part 1 of 3, the Blue of the "Red, White and Blue Technology Trilogy."

Other news that I stumbled upon today:

  • JBoss uses JavaGroups, and I've heard you can make work with Tomcat - for clustering and such.
  • The release plan for Struts 1.1 Beta 3 has been committed to CVS, code freeze this Saturday.
  • Ted Husted defends Struts after I posted it's recent criticizm to the mailing list.
  • The xPetstore Application has a new release. xPetStore is a refactored version of Sun PetStore application that shows how to use xDoclet to build WODRA (Write Once, Deploy and Run Anywhere) J2EE application. Tested with JBoss and WebLogic.

Phew, done at 11:44 p.m.

Posted in Java at Dec 11 2002, 05:37:32 PM MST 4 Comments

AppFuse and Resume App

I've decided to rename struts-xdoclet to AppFuse! Why? Because 1) it's easier to say, 2) it's a more descriptive name, and 3) it's the fuse to get your app started! I'll be checking it into SourceForge's Struts project soon, and will post more information then.

I've been thinking about my sample app for the Struts Chapter and I'd like to develop something that's useful. I doubt I'll have the time to pull it off, but I'd like to develop a resume builder/viewer app. I think it'd be a great way to demonstrate CRUD with Struts with skills and such. It could even be an application that would support multiple users, where skills can be shared and selected. I've been thinking about doing something like this for a while. It's a pain to update my resume right now because there's 4 different versions - online JSP, downloadable HTML, Word and Text. I've often thought about just creating an XML version and using JSTL to to XSL transformations into HTML, Text, RTF and PDF. I wonder if this XML resume project at SourceForge could help? I'd love to create an app that allows you to easily update your resume and can publish it in all these different formats. Even better, if it could be resume-standards-compliant (i.e. DTD or XSD) and allow users to select/upload/use different styles. I think this would take much of the headache out of online resume publishing. However, I'd probably spend more time tweaking it than I would just updating the 4 different versions of my resume. It'd kinda like this website, I chose to use Roller as my re-design engine because it was quick and easy - and now I spend a couple hours each day tweaking and updating. I could've redesigned for a lot cheaper! Of course, new content == hits.

The only problems I can foresee with this app (so far) are Old Man Time and that it might be a maintenance nightmare. I would suspect a lot of folks might want import/export to/from existing formats. Thoughts? Comments?

Posted in Java at Dec 06 2002, 09:57:52 AM MST 3 Comments