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.

Is it possible to disable CVS Notification of certain files?

I use Anthill for automated building and testing of my webapps. I think it's a great product. The UI could use some improvements, but I know that if I really cared, I'd fix it myself. It's only competition is CruiseControl as far as I know. CruiseControl (at first and only glance) looks to have a not-so-intuitive XML file that needs to be setup. Anthill was easy to figure out without even reading any documentation.

I am using Anthill on a number of projects and most of these projects use some sort of e-mail notification of CVS commits. When using CVS on *nix, I use CVSSpam, or the one built in at SourceForge. When using CVS NT on Windows (like my current *paid* project) I use CVSMailer. Both of these work great, however, when Anthill does a commit of my anthill.version file - everyone gets a notification of it.

Does anyone know how to configure CVSMailer or CVSSpam to "not" send e-mails for this specific file? I'd love to configure this from Anthill, but I realize it relies on committing this file.

Posted in Java at Dec 02 2003, 05:06:18 PM MST Add a Comment

Hibernate Blog

Sweet, the Hibernate guys have a group blog. Very nice - I subscribed. Gavin's post on Designing "query by criteria" is a should read if you're a Hibernate user. You might recall a while back, I was looking to use the QueryByCriteria API to construct dynamic queries. I ended up doing this with session.find and SQL, which turned out to be much easier. That being said, what's the advantage of using the Expression API over plain ol' SQL?

Posted in Java at Dec 02 2003, 09:58:22 AM MST Add a Comment

Struts Menu 2.0 Released!

This release is a significant refactoring of the 1.x codebase. The source and site is now built using Maven. Menus can now be defined using Velocity templates and support has been added for looking up dynamic values. This means that if you have ${variableName} in your menu-config.xml (in a link), the tag library will look in all scopes for a variable with the name "variableName". The example app has been updated to improve documentation.

IMO, the Velocity templates is huge because it means "if it's possible with HTML" - it's possible with Struts Menu.

Changes (from http://struts-menu.sourceforge.net/changes-report.html):

- Renamed package structure to net.sf.navigator.
- Added support for using Struts' actions and forwards for links in menu-config.xml.
- Added support for using dynamic variables in menu-config.xml.
- Updated build process to use Maven for building/deploying.
- Refactored to use Velocity and allow dynamic variable substitution.

You can read the nitty-gritty details about the Velocity enhancements, check out the sample app or download this tag library for yourself.

Posted in Java at Dec 01 2003, 04:03:09 AM MST Add a Comment

AppFuse 1.0 Released!

I feel this release deserves the big 1.0 designation because it is an up-to-date representation of my learnings and my perceived best practices in building web applications. Of course, as I learn more, I will continue to push out new releases.

In this release, I did a lot of refactoring and enhancements to existing features. The DAO and Manager interfaces are no longer tied to Struts or Hibernate. Hibernate's Session object is now passed as an argument into Manager and DAO constructors, rather than method signatures. The DAOFactory was refactored by Bear Giles to use reflection to instantiate Hibernate DAO's. Now, if you add a new DAO, you don't have to edit DAOFactory and DAOFactoryHibernate. To insantiate a new DAO, the code is now:

LookupDAO dao = (LookupDAO) DAOFactory.getInstance(conn, LookupDAO.class);

...where conn is a connection object retrieved from ServiceLocator or ActionFilter. When you add new POJOs, you still have to add them to ServiceLocator (for JUnit tests) and hibernate.cfg.xml, which is kindof a pain. I'd like to figure out a way to tell Hibernate to just look in appfuse-ejb.jar.

<tangent>
I still don't have a Factory for Managers, and I don't know that there's a need for one, but it's something I might add in the future. Managers are still creating using: LookupManager mgr = new LookupManagerImpl(ActionFilter.getConnection());. One thing I've been thinking about is the ability to switch webapp frameworks - kindof like you can do with Persistence Frameworks and the DAO Pattern. It'd be cool to add a way to switch (at build time) to use WebWork or Tapestry. Maybe by replacing values for the controller in web.xml. It'd probably be a pain since I'd probably have to create new JSPs for the new frameworks - but it would probably be a great learning experience.
</tangent>

The Remember Me feature has been refactored so the username and password cookies are only available under the /appfuse/security url-pattern. I also changed the posting to "j_security_check" in LoginServlet from response.sendRedirect to an HTTP POST, using Jakarta Common's HttpClient. The reason I have a LoginServlet vs. just using action="j_security_check" in my <form> is to encrypt passwords.

I've developed 3 different applications using AppFuse (struts-resume is one of them), and I have found that it's a pain to upgrade to new versions of AppFuse. Because of this, I don't recommend upgrading unless you really need to. I will be upgrading struts-resume to AppFuse 1.0, but I doubt I'll upgrade it to any future AppFuse releases - it's just too much work for not much reward.

Posted in Java at Nov 30 2003, 06:35:24 PM MST Add a Comment

JSTL Tips o' the Day

Here's a couple of tips to help you in your JSP development with JSTL:

  • The <c:out> tag has a default attribute you can use to provide a default value when the value in your the variable you're trying to write is null. This is much easier than using if statements. Example: <c:out value="${user.firstName}" default="None Given" />.
  • You can populate dynamic values in a key from your ResourceBundle using the <fmt:param> tag. For instance, if you have a message with a link in ApplicationResources.properties - and you want to populate it with a struts-forward, it's easy with JSTL:

    ApplicationResources.properties:

    mainMenu.link=Click <a href="{0}">here</a> to return to the Main Menu.
    
    In your JSP:

    <fmt:message key="mainMenu.link">
      <fmt:param><html:rewrite forward="mainMenu"/></fmt:param>
    </fmt:message>
    

Usually I try not to put any HTML in ApplicationResources.properties, but I don't think a minimal amount hurts anything. Of course, you could put all the HTML in your JSP, so mainMenu.link changes to "Click {0} to return to the Main Menu." and your JSP changes to:

<fmt:message key="mainMenu.link">
  <fmt:param>
      <html:link forward="mainMenu">here</html:link>
  </fmt:param>
</fmt:message>

Enjoy!

Posted in Java at Nov 30 2003, 06:14:20 PM MST 1 Comment

AppFuse won't work with J2EE 1.4 Final

I don't know why, but AppFuse's MailUtilTest won't run with J2EE 1.4 Final. It works fine with 1.4 Beta 2.

Posted in Java at Nov 26 2003, 10:09:12 PM MST Add a Comment

My Favorite Eclipse Plugins (Download v1.0)

When I go to new clients, I either have to install Eclipse, or help others configure Eclipse with cool plugins. So I made my own download of my favorite Eclipse plugins. If you want it, download version 1.0 from SourceForge. It includes the following:

Installation: Unzip to where ever you have Eclipse installed. I use c:\Tools\eclipse on Windows.

I don't really use XMLBuddy because it doesn't allow spaces (only tabs), but I suppose it's better than nothing. The built-in Ant Editor has the same behavior (tabs only). I'd love to find a plugin that gives code-completion for XDoclet when typing JavaDocs, but I couldn't find one. Sure, there's JBoss-IDE (which is just a bunch of Eclipse plugins), but that only has jboss-specific tags - no @hibernate, no @struts.

NOTE: Many of these plugins didn't work on Eclipse 3.0 M5, so I reverted back to M4.

OS X Users: Jalopy and Colorer don't seem to work at all for me (M4). You'll need to change Easy Explorer from "explorer.exe {0}" to "open {0}" in Window > Preferences > Easy Explorer.

These are all the latest versions as of November 26, 2003.

Posted in Java at Nov 26 2003, 01:02:59 PM MST 13 Comments

[Hibernate] Generating composite-id code using XDoclet

It's been a while since I dug into the guts of XDoclet and Hibernate. Now I'm digging in on my new project to figure out the best way to generate a <composite-id> entry in my .hbm.xml files. If you know something about Hibernate and XDoclet, please read my questions on the Hibernate Forums.

Posted in Java at Nov 24 2003, 12:41:12 PM MST 1 Comment

User-Mode Linux ~ should I switch my ISP?

This User-Mode Linux sounds like a great opportunity for hosting this site. I currently pay around $50/month to host this site, and there's two things that are frustrating:

  • I only get 5 GB of bandwidth, and I pay the same as my provider for any extra - I usually pay $30 extra per month for bandwidth.
  • I get a max of 20 connections per mysql instance. While this should be plenty, it does seem to cause this site to crash, and I'm not motivated enough to dig into Roller/Tomcat and figure out why.

I do have a cable internet connection, so I could host this site myself, but my upload speed is only 241 KB. For you folks that do use UML, does anyone have experience with running Java (i.e. Tomcat or Roller) and MySQL?

Posted in Java at Nov 23 2003, 09:22:02 PM MST 9 Comments

RE: Compressing and Caching in your webapps

Jayson Falkner writes about two Filters everyone should have in their webapps: one for compression (via gzip) and one for caching. I try to add a CompressionFilter to all the apps I write, but I don't have a CacheFilter. So my question is: should I add Jayson's CacheFilter to AppFuse or should I use OSCache? I haven't got to Dave's chapter yet on performance and caching (in JSP 2.0), so I haven't read his opinion - what's your opinion? I like Jayson's solution because I can add 3 new classses with no additional JARs - AppFuse already has 21 jars (Struts, Hibernate, JSTL + a few other taglibs).

Posted in Java at Nov 21 2003, 11:57:41 AM MST 4 Comments