Matt RaibleMatt Raible is a Web Developer and Java Champion. 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 "java". 1,588 entries found.

You can also try this same search on Google.

Denver's No Fluff Just Stuff begins today

Denver's No Fluff Just Stuff begins at noon today. I'm pumped since I've tried to go the last two and never made it. It looks to be a very fun weekend with lots of knowledge stuffed in my brain that I'm sure to forget in a week or two.Anyone got any suggestions on sessions to attend? If prefer sessions that have interesting topics and good speakers - but I'm open to anything. I plan to go with the flow moreso than to try and learn everything I can.

Speakers I'm looking forward to: Brian Boelsterli and Rick Hightower. Brian is a mentor of mine that I first met in May 2001. We commuted together for 6 months and I learned a lot about independent consulting, fatherhood and agile development from him. Rick is also a good friend and of course I'm gonna be interested in his talk on AppFuse!

Posted in Java at May 21 2004, 05:43:22 AM MDT 5 Comments

XDoclet vs. JSR 175

Rob Kischuk has a post where he describes what a Struts Action might look like using JSR 175 annotations.

@StrutsAction(
  @ActionMappings({
    @ActionMapping(
      path="index"
      @ActionForwards({
        @ActionForward(
          name="success"
          path="index.jsp"
        )
        @ActionForward(
          name="failure"
          path="error.jsp"
        )
      })
    )
  })
)
public class IndexAction extends Action {

As I read it, I though - "holy crap is that ugly!" Isn't the XDoclet version a bit cleaner?

 * @struts.action path="index"
 * @struts.action-forward name="success" path="index.jsp"
 * @struts.action-forward name="failure" path="error.jsp"

I'll admit, I don't know much about JSR 175, except that it is designed to replace XDoclet. However, I don't believe that it will generate code like XDoclet does - but rather it will allow your Java code to describe metadata using doclet tags. So what good does that do? Does this mean all my metadata and configuration stuff is hard-coded into my source? With XDoclet, I realize that a lot of this stuff is hard-coded into my source, but at least I can change things by changing an ant property and rebuilding - or changing the generated XML files. Why is JSR 175 better than XDoclet? I guess I just don't see the beauty of it. More typing and uglier javadocs aren't that appealing to me.

Posted in Java at May 19 2004, 11:12:29 AM MDT 7 Comments

Weekend Releases :: XDoclet 1.2.1, Tomcat 5.0.24 and Cactus 1.6

While many folks were oohing and awwhing over how EJB 3.0 will make their worlds easier and app servers viable again - some folks continued to get things done:

BTW, thanks to all the Symposium Bloggers - with all the good reporting, I felt like I didn't miss a thing.

Posted in Java at May 10 2004, 10:45:03 AM MDT 3 Comments

Struts Contract position in DTC

If you're an independent contractor, live in Denver, and know Struts - you might want to checkout this position. Requires: Struts, Tiles, JavaScript, DHTML. Sounds like a fun gig - contact me if you're interested and I'll give you the rate.

In a related note, I might have a contract opportunity for a local developer familiar with AppFuse and its technologies (most important: Struts, Hibernate, Spring and JUnit).

Posted in Java at May 05 2004, 09:11:46 AM MDT Add a Comment

You know you've made it when...

You know you've made it when you've been biled! Sweet - thanks Hani!

Matt "Proud to be an Asshat" Raible

Posted in Java at May 05 2004, 07:00:09 AM MDT 2 Comments

[ANN] AppFuse 1.5 Beta Released!

This release has lots of modifications that I've been meaning to make for quite some time. Specifically (1) removing the dependency on j2ee.jar and (2) removing Struts from the services layer. I also made improvements to Spring and its context file loading so you should be able to run unit tests from your IDE.

Other notables include full i18n support (with translations in Dutch, Brazilian and Chinese), improved setup-tomcat target (no additional JARs needed now), and an option to use Spring's MVC framework instead of Struts. If you'd like, you can read more about my conversion from Struts to Spring. Enjoy!

BTW, this upload was a little hefty for java.net at 12.5 MB - because of the iBATIS and Spring MVC option. My browsers (Mozilla and IE) kept timing out and I was getting a "Not enough space" error. To fix this, I had to increase the timeout on Mozilla. Here's the steps I went through:

  • Type "about:config" in the address bar.
  • Type "timeout" in the filter field and hit Enter.
  • Change "network.http.keep-alive.timeout" to 600 (10 minutes). The default is 300.

Posted in Java at May 04 2004, 03:57:41 PM MDT 10 Comments

Creating column indexes with Hibernate

One of the best ways to speed up your application's performance is to create or optimize indexes in your database. On my current project, when we created our database on the AS/400 last week, the DBA noticed that there weren't any indexed created. I expected this and said I'd do some research on creating indexes with Hibernate. Thanks to Gavin, it turns out to be quite simple. Let's say you have an XDoclet tag on a column you want to index. Currently it is:

@hibernate.property column="username" not-null="true"

If you're using Hibernate's <schemaexport> task, you can add an index on this column to your mapping file and it'll create the index when creating the database. To add an index, it's as simple as changing the above XDoclet tag to:

@hibernate.property
@hibernate.column name="username" not-null="true" index="index_name"

Now the hard part comes. Which columns should you put indexes on? From what I've heard, it's the ones that you use in where clauses of your queries. I expect one or two per table is sufficient (??). One thing I'm not sure of is: should id columns contain an index?

Posted in Java at May 03 2004, 12:06:44 PM MDT 11 Comments

Mapping buttons to methods

In AppFuse, I use Struts' LookupDispatchAction to map submit buttons to methods in my Actions. It's caused quite a headache for i18n, but Jaap provided a workaround and now everything works fine. However, as I did the Spring MVC implementation this weekend, I didn't have to do any complicated "button value -> method name" mapping. Part of it was because I didn't need to, but also because I discovered that you can easily just check if the button's name was passed in. Explaining this with code is probably easier. Let's say you have three buttons on a page:

The HTML code for the above buttons is:

<input type="submit" name="save" value="Save" />
<input type="submit" name="delete" value="Delete" />
<input type="submit" name="cancel" value="Cancel" />

Using the name as your key, you can easily check in your Action/Controller/etc. to see which button was clicked:

if (request.getParameter("save") != null) { 
    // do something
}

The nice thing about this is that it doesn't care what value you put on your button - just what you name it. It seems like all frameworks should use something like this, rather than a single parameter name (i.e. "method") that requires JavaScript on a button to change the method invoked. About a month ago, Rick Hightower mentioned that he uses a ButtonNameDispatcher for Struts. Rick, if you're reading this - I'm ready for that bad boy!

Posted in Java at May 03 2004, 09:27:52 AM MDT 12 Comments

Converting AppFuse to use Spring for MVC

It's been a long and painful week - with 3 or 4 nights where I was up to 4 or 5 in the morning. Last night I was up until 4:30 and Abbie woke me up promptly at 7:30. Ugh, sleeping more is probably a good idea. I started on the Spring MVC layer for AppFuse on Thursday night and it took me almost 2 days to convert everything. There's still a few kinks and workarounds - but if you're running it through a browser, everything works the same as it did with the Struts version. The hardest part about it was writing the unit tests. With Struts, it's rather easy b/c I use StrutsTestCase, which provides a very simple API for testing Actions. I'm sure Spring will soon have this same capability with its Servlet API Mocks, but I was definitely banging my head against the wall a few times. I did manage to convert the LabelTag to recognize required fields and error messages. The JSP conversion was a slight pain - but mostly because you have to type a lot more for input fields than you do for Struts. I'm looking forward to WebWork which requires one line to do the whole table row. It has Velocity templates for its tags and they write the <tr>, <label> and the <input>. Pretty slick IMO - less typing is always attractive to me.

I'd like to write-up a detailed entry on "migrating from Struts to Spring" on JRoller, but it's been flakey over there for a few days now - so I might just do it here. We'll see - the lack of sleep is draining my motivation to write. I hope to do the Ant-based installation for Spring in the next couple of days - then I'll release 1.5 beta. My main reason for the beta is because the Spring stuff can probably be cleaned up a lot, as well as it gives me time to write documentation before the final release.

Posted in Java at May 02 2004, 09:17:54 AM MDT 5 Comments

Populate your drop-downs with listeners and allow for refreshing

Most webapps have drop-downs (a.k.a. pick lists) that users select from when filling in forms. Spring has a nice referenceData method on its Controllers that you can use to populate these, but I prefer a different way. In AppFuse, I populate these using a ServletContextListener. However, one of the problems with using this is that your drop-downs won't get refreshed unless you have admins screens or a way to reload the attributes set in the listener.

In short, I think it's a good idea to load drop-down options in a listener and also have an action or servlet to refresh these options. For examples, see StartupListener.java and ReloadAction.java. Got a better way? I'm interested...

Posted in Java at Apr 29 2004, 04:50:55 PM MDT 4 Comments