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 "<a href=". 3,022 entries found.

You can also try this same search on Google.

PlugIns and Struts Nightly Build

I had a nice frustrating evening tonight trying to get the nightly build of Struts to work with Tiles, Modules and the Struts Menu. Actually, it wasn't a Struts problem so much as a Struts Menu problem. I was getting a java.lang.AbstractMethodError error when hitting the first action class, and couldn't figure out why. I started by bitching to the struts-dev list, and then filed a bug. Eddie Bush was kind enough to suggest that there was something wrong with my PlugIns. I thought - how could there be - I'm using Tiles and Validator? So I looked at my struts-plugins.xml file and there was the culprit - struts-menu. It turns out that I needed to add the following variable and method to MenuPlugIn.java:

/** The plugin config object provided by the ActionServlet initializing
 *  this plugin.
 */
protected PlugInConfig currentPlugInConfigObject;

/**
 * Method used by the ActionServlet initializing this plugin.
 * Set the plugin config object read from module config.
 * @param currentPlugInConfigObject
 */
public void setCurrentPlugInConfigObject(PlugInConfig currentPlugInConfigObject) {
    this.currentPlugInConfigObject = currentPlugInConfigObject;
}

This post was written in hopes of alleviating someone else's troubles with this same problem.

Posted in Java at Dec 28 2002, 02:00:47 AM MST Add a Comment

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

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

ChainedExceptions and BeanUtils.copyProperties

I am wondering about a few things, so thought I'd try and get some help from the best source I know - the java.blogs community. First, an update on last night. I experienced some difficulty with Hibernate (persisting child objects) and Struts (nightly build doesn't quite work right with Tiles and Modules) and gave up at 2:00 a.m. Luckily, my head cleared up this morning after a deep 4 hours of sleep and I figured out Hibernate and it appears that a fix for the Tiles/Modules problem was checked into CVS by Cedric.

Now I'm wondering if it's possible to use declared exceptions in Struts to grab all your Exceptions from the bottom up. I can do this in an Action (or even a filter) using the following:

// caught exception e
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,
           new ActionError("errors.general"));

while (e != null) {
    errors.add(ActionErrors.GLOBAL_ERROR,
               new ActionError("errors.detail", e.getMessage()));
    e = (Exception) e.getCause();
}

request.setAttribute(Globals.ERROR_KEY, errors);

Can I do this with declared exceptions? Man that would be sweet if I could - I wouldn't have to have any exception handling in my Actions. Maybe that's the easy way out, but it also makes for rapid development - and you can always add them in when you really want them. Two other things I need to do.

  • I have a java.util.Set on my User (Hibernate) object. This refers to a collection of Resume objects. When I generate my StrutsForms, I need to do something in my XDoclet template to turn a java.util.Set into a java.util.ArrayList. I don't know that I have to do this, but I've always used ArrayLists or Vectors on ActionForms for child objects.
  • I am using BeanUtils.copyProperties in a Business Delegate to transfer properties from my User object to a UserForm object. When I do this, the child objects come through as Resume objects - where I really want them to come through as ResumeForms. Is this possible using BeanUtils, or do I have to do this manually?

I should probably do some research now to try and figure this stuff out on my own - but hopefully an answer will come through while I'm doing that ;-). I'll post to the proper mailing lists if I can't figure it out by COB. BTW, if you're using Hibernate, the FAQ is awesome. I wish more OSS (or closed-source software) had documentation this good.

Posted in Java at Dec 27 2002, 11:40:40 AM MST 9 Comments

RE: Easy Windows Authentication with Tomcat 4.x

Robert Rasmussen has a nice post about integrating Tomcat with your NT Domain for authentication. Very cool - and it includes source code! This is my kind of post. My current project in the office is using Oracle to authentication while they wait to transition to using LDAP. However, they're already setup on NT - so I might just suggest using this JAASRealm - it'd surely make things a lot smoother until they get LDAP up and running.

Posted in General at Dec 26 2002, 10:45:57 AM MST 1 Comment

Maven IDE Integration

Project to watch: Maven IDE Integration over at Sourceforge. No files released yet, but hopefully soon. Notice that Eclipse integration is the initial focus - nice!

Posted in General at Dec 25 2002, 04:32:04 AM MST 2 Comments

RE: Reading Blogs

Well said Chris. I enjoy the personal side of blogs more than the technical side to be honest. I view the java.blogs community like a group of co-workers. I'd much rather hear about a co-workers weekend over their use of an I or Impl to name their interfaces ;-)

Give us the good stuff - talk about your families, the parties, the birthdays - we're listening... eagerly. I'm looking forward to Christmas morning with Mimosas (Orange Juice and Champagne) - a family tradition of Julie's. Her mom and sister, Stephanie and Holly, are in town for the week and festivities. Abbie's first Christmas - I'll post pictures by the end of the week. I'm heading out to do some last-minute Christmas shopping (typical guy right?) and then we're going to see the Twin Towers later this afternoon.

I guess you could say I won't get the chapter/sample app done today - maybe later this week. I've got all the writing done - 38 pages, but need a good app to go with it IMO. A good friend told me yesterday to just "get it out" - he mentioned that the last technical book he read had code that didn't even compile! It should be nice not worrying about writing this afternoon and tomorrow - first time in weeks. I feel like I've somewhat missed out on Christmas with writing and the new job. I can't wait until I get to do 50 hour weeks again!

Posted in General at Dec 24 2002, 05:37:03 AM MST Add a Comment

[XDoclet] Generating StrutsForms from a POJO

I was successfully able to complete my mission last night and this morning. I guess you could say that it took me more than 2 hours as I just finished it about an hour ago. I was up until 3 and worked on it a couple of hours this morning too. It's definitely a hack as it still depends on running the <strutsform> task inside the <ejbdoclet> task. But, it doesn't require EJBs anymore, which I think is a good thing. I'll be using it in my chapter's sample app, as well as on my current project - so I think it was time well spent. Now I just have a POJO marked up with Hibernate and StrutsForm/Validator Tags, and walla - life is good. I've opened an enhancement request in XDoclet's JIRA, so you can check out what changed if you're that interested. If you want to use it, you can download the patched xdoclet-apache (43K) module.

Posted in Java at Dec 24 2002, 05:18:19 AM MST Add a Comment

How I fixed Ant running in Eclipse

I was able to fix my Ant problem this week. In the latest release of Eclipse (2.1 - M4), it allows you to specify an ANT_HOME, rather than the internal one. So I did that and it still didn't work. I ended up having to add tools.jar as a external jar and now everything works [screenshot]. Cool!

Posted in General at Dec 24 2002, 04:58:02 AM MST 1 Comment

New Blog to Watch - Jon Lipsky

I don't really know Jon, only that he sent me an e-mail about Hibernate's Reverse Engineering Tool. Anyway, he's now blogging and better yet - he's using Roller! Don't forget - I'm biased b/c I think Roller is the best thing to come along since sliced bread. Speaking of the RET, from the documentation, it doesn't even look like it exists - there's no instructions on how to run it??

Man, I wish someone would alter Middlegen to generate Hibernate-tagged classes. Erik Hatcher's been bugging me to do it - any volunteers?

Posted in Roller at Dec 23 2002, 04:39:56 PM MST 1 Comment