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.

What's new in Tomcat 5

Want to know what's different between Tomcat 4 and Tomcat 5? If so, you should check out this article. I haven't read it (yet), but I hope to soon. Today, I was planning on working from home, plowing through my stuffed head and headache with the power of DayQuil. However, Julie had to run into work (she stayed home with Abbie yesterday, who is also sick). So Abbie and I are going to be sickos together all morning. The problem is that Abbie doesn't know she's sick - she's still happy as a pig in sh*t and wrecking the place. I'd better go and stop her...

Oh wait - Telletubbies just came on - she's mesmerized, that gives me a half hour. I'd love to work on AppFuse, there's never been more stuff I'd like to integrate. Here's a list of stuff waiting for SF's CVS to get it's act together:

  • Start integrating Spring.
  • Various bug fixes as reported by users.
  • Charles' persistent cookie strategy.
  • WebTest patch to work with Ant 1.6.0.
  • Figure out how to run AppFuse on JBoss - thanks to Rick Hightower and Brian Topping (on the roller-user mailing list) this should be pretty easy.
  • Figure out how to run AppFuse on Orion - I got an e-mail yesterday with some hints, so this shouldn't be too hard either.

As far as SourceForge's CVS, if you were to checkout AppFuse right now, you'd get the latest code, but you'd also get a bunch of files I deleted ages ago. I submitted a bug - here is the response I received:

This issue (file present both Attic and non-Attic) would have been caused by a file removal between the time of our full repository sync and the update sync; or by outdated data being present after our initial sync (due to a sync bug) -- both possible cases with our recent systems upgrade. We are presently in the process of generating a list of such duplicates (using a set of scripts we wrote) and will perform a clean-up of this issue once the script run completes. Additional information will be posted to this request no later than 2004-01-30. Your patience is appreciated.

Back to babysitting, Abbie's getting bored with Telletubbies.

Posted in Java at Jan 29 2004, 09:21:48 AM MST Add a Comment

RE: Mock Shmocks!

After I finished reading Open Source Programming and all the of the feedback from my Mock Shmocks post, I've realized that I need to learn more about Mocks. I need to learn how to streamline my TDD process. It's just taking too long right now. So where do I go from here? AppFuse currently contains, from what I can tell, only integration tests. All the tests depend on the database or the container to run. It works great, and all of AppFuse's tests complete under 3 minutes, but obviously this time increases as the project grows. So should I remove some integration tests and replace them with unit (mock) tests? If so, which ones? Should UserDAOTest talk to the database, but LookupDAOTest only use a Mock? How do you decide which tests should be real (integration) and which tests don't need to be (mocks)?

If the answer is "create a unit tests to sit next to each one of your integration tests" - then that seems like a waste of time. Am I supposed to have 2 *Test.java classes for each real class? I need a book that'll explain all of this and make me the TDD guru I long to be.

Even if I figured out all the answers to the above questions - which package should I use? There's a whole slew of them: Mockrunner, MockObjects, EasyMock and jMock. How do you decide? It's easy when testing Java classes - you use JUnit. When you want to test servlets, you use Cactus. Why all the choices for Mock testing?

Posted in Java at Jan 28 2004, 10:18:17 PM MST 6 Comments

Tapestry vs. Struts

I've been watching the Tapestry mailing lists in hopes of picking up some tips before I start learning it. In reality, I'm waiting for Tapestry in Action, which will hopefully make it easier to learn. Today, there was a very interesting thread comparing Tapestry to Struts. It looks to me that Tapestry is easier to develop with once you get the hang of it, but apparently, it has a steep learning curve.

The Tapestry Mailing list is interesting - it seems to have a different level of users. Maybe it's just me, but they seem to be a more enlightened crowd. You could almost say the same for the WebWork mailing lists. If I compare these two lists to the questions on the Struts mailing lists - it seems like there's a bunch of idiots over there (on Struts). Don't these people know how to use Google?! To be fair to Struts, I have a theory.

If WebWork or Tapestry ever becomes as popular as Struts, they'll get their fare share of idiots too.

It's just the nature of mailing lists - it's so much easier to ask your question than to look for the answer. Which reminds me...

Don't ask dumb questions...

Posted in Java at Jan 28 2004, 09:51:15 PM MST 2 Comments

Easy IIS and Tomcat integration

I found a nice installer for integrating IIS and Tomcat today. It uses the Isapi redirector jk 2.02. My current client is a Windows shop - so stuff like this is nice. I did find that I had to install Tomcat using the .exe installer, vs. extracting a .zip file. I also had tried to get the 1.2.5 version of the connector working manually - so in the end, I had to blow away both Tomcat and IIS to get this sucker to work. But if you're setting up a brand new machine, I imagine this installer will come in quite handy.

Posted in Java at Jan 27 2004, 03:37:00 PM MST Add a Comment

[Review] Java Open Source Programming

Book Cover Today I finished reading Java Open Source Programming. It took me one week to read - and I only read about an hour a day. This book is nice to read - you can breeze through 20 pages in no time. I appreciate a quick-read technical book. I enjoyed the simplicity of this book, especially since I'm such a rookie at WebWork, SiteMesh and Mock Objects. I knew most of the Hibernate and XDoclet stuff, but I did manage to pick up a few tricks, and since it's the only book on Hibernate (that I know of), I'll refer to it when I need to do components or proxies. Overall, this book made WebWork and SiteMesh look like great technologies and I'm excited to start using them.

The sample app, PetSoar, continues the "call your persistence layer from your action class" that I've seen in all WebWork sample apps. I still don't know if this is a good idea, but since Actions aren't tied to the web, maybe it is. This means you put your business logic in your controllers (a.k.a. actions). Kinda breaks the whole controllers should only be controllers mantra, but whatever floats your boat. To be honest, in AppFuse, all the Managers (a.k.a. business layer) do is transfer POJOs to ActionForms, and then back again. The Managers are were my business logic should go, but I often find it easier to put it in my actions. I sense a paradigm shift - will the WebWork version of AppFuse only contain a "dao" layer and a "web" layer? Who knows - only time will tell.

One interesting thing I picked up is the different way that Dependency Injection (a.k.a. Inversion of Control) is handled in WebWork compared to how its handled in Spring. In Spring, all you need to do is add a setter (and local variable) to prepare a class for IoC. When using WebWork, you have to create an Interface that has the setter defined, and then your Action must implement that interface. If Spring can do it without an interface, why can't WebWork?

All in all, I enjoyed this book - though it didn't peak my interest as much as J2EE Design and Development. I think that's probably because Spring solves some issues I've had with AppFuse (binding interfaces and implementations), whereas this book doesn't really solve anything for me. As a WebWork newbie though, I do feel this is a good read. I also found myself saying "Wow, that's cool" a fair amount of times (re: SiteMesh and WebWork).

I was disappointed that i18n was not covered at all. I tend to always prepare my Struts apps for i18n (extracting text into a .properties file). However, in most cases, a 2nd translation has never been put in place. So, I bitch about the lack of i18n coverage, and I write my apps with i18n in mind, but it's never been used in any of the apps I've written. Maybe I should just quit doing i18n in my apps - it'd probably save an hour a week of development time.

So it comes down to this - if you don't know anything about WebWork, this book is a worthwhile read. If you know WebWork - I'm sure you'll be disappointed because it is written for newbies.

Next up, upgrading my programmer certification to 1.4 with the Sun Certified Programmer & Developer for Java 2 Study Guide.

Posted in Java at Jan 25 2004, 01:29:19 PM MST 7 Comments

Anyone else having trouble with SourceForge's CVS?

SourceForge's CVS repositories have been acting up since yesterday - at least for me. I just did a clean checkout of AppFuse and I got version 1.0. WTF? Even ViewCVS shows that my latest code is there. Wierd.

Posted in Java at Jan 23 2004, 10:32:16 AM MST 2 Comments

A few thoughts on AppFuse

I've been thinking about how to structure AppFuse for the upcoming Spring and iBatis enhancements. These enhancements shouldn't require any directory structure changes. However, I've received some suggestions to change the common, ejb and web directory structure to be a little more inline with the tiers. So it would become something more like database, business and web (or dao, service and web). After thinking about this for the last couple of days, it seems to make sense. I picked up the notion of common from Erik Hatcher's JavaDevWithAnt, which I borrowed heavily from when creating AppFuse. Erik used common because this represented classes that would be included in both the web tier and the EJB tier. But since I (currently) don't plan on every adding EJBs to AppFuse, does it make sense? Even if I did, I'd probably only use SessionBeans, and those could easily fit into the service layer. The nice thing about moving the business layer (currently in web/**/services) to it's own directory is that it will get it's own JAR (with hardly any modifications to build.xml) and can be used outside of the webapp.

The nice thing about isolating the web directory to web-only classes is I can use Ant to replace any Struts-specific classes with WebWork or Tapestry. To prevent AppFuse from being cluttered with too many options, it'll ship with Struts out-of-the-box. If users want WebWork for their framework, they can download a WebWork version of the web-tier and run an Ant target that will replace all the Struts stuff with WebWorks stuff. It seems like the cleanest way to do web framework switching.

Another thing that might happen to AppFuse, caused by my enthusiasm to try out everything, is that it will contain too much stuff for a basic web application. It currently has security and user management built in, which is what most webapps need. I recently added in OSCache and Clickstream. OSCache is not enabled, but most webapps can probably use it somewhere. Clickstream is a different story. For most of the webapps I've built, this is not needed at all. Most of the apps are no more than 20 screens, and it's unlikely the client will care where people go the most. Another option that deserves ripping out is the idea of Struts' submodules. I tend to rip this out as the first thing when starting a new project. File Upload is something I've used rarely, so I should probably lose that feature too.

There are also other technologies that I've thought of adding to AppFuse, namely Quartz and Lucene. However, I've only used Quartz on 1 of my last 5 projects and Lucene on 2 - so obviously these might be considered bloat for a basic webapp. I think the best thing would be to implement these in AppFuse, on my own, and then document how I did it on the wiki (for an example, see diagramming build.xml with Vizant). If folks need to use it they can add it on their own. Documentation is always good, and if I can just document how to add stuff, I can certainly reduce the bloat.

Whaddya think - is it better to include options out-of-the-box or simply document them? Should I restructure the directories to match the tiers more?

Posted in Java at Jan 23 2004, 06:58:11 AM MST 9 Comments

If you're planning on using Spring...

If you're planning on using Spring with Hibernate, Data Access with the Spring Framework is a must read. This article makes it look easy (and simpler) to use Spring's Hibernate helper classes than the regular Hibernate API. Good stuff - this kind of stuff makes integrating Spring into AppFuse look like fun. Deleting code is always fun. I wonder if MyEclipse will roll in some support for the Spring Framework? What about IDEA? Yeah, I broke down and bought a copy. I could use some "get to know your IDE" tutorials though. One thing I learned from Open Source Programming (and originally from The Pragmatic Programmer) is get to know your IDE. I could certainly use some more expertise on Eclipse and IDEA. I'm going to buy MyEclipse, a good Eclipse book and go read some IDEA documentation. Ambitious plans right before bed - sure sounds good though. Links appreciated - I want to make my IDE-life easier.

Posted in Java at Jan 22 2004, 10:21:21 PM MST 2 Comments

Tomcat 5.0.18 Released

Download or read the Release Notes. You know what bugs me about this release? The release notes suck! There's no changelog - what bugs got fixed, which ones didn't? Any new features? I suppose I could go crawling around their bug tracker and find out, but isn't this the kind of information you'd like to see with the release? Should I upgrade? Why should I upgrade - is something broke in 5.0.16 that's fixed in 5.0.18? Are there memory leaks that got fixed?

The only reason I develop on 4.1.29 these days is because my Remember Me feature works on 4.1.x, but not on 5.0.x. I could make it work on 5.0.x, but it wouldn't be as secure. I hope to implement Charles' recommended cookie strategy and then go for 5.0.x as my development platform, but that'll be a few more days.

On another note, I've implemented the Tomcat Ant tasks in AppFuse and I must say, these things are nice. The main advantage is speed, which all developers love.

Posted in Java at Jan 22 2004, 12:35:42 PM MST 3 Comments

Turn off sessions in your JSPs

One of the tips I picked up in J2EE Design and Development was to turn off automatic session-creation in your JSPs. So I tried this today on my project, and it doesn't seem to work. Basically this involved putting the following at the top of your JSPs:

<%@ page session="false"%>

I did this by adding this to my taglibs.jsp, which is included in every other JSP - so it should affect all my JSPs and prevent a session from being created on my welcome-file - right? Not according to Tomcat's Manager application - it still increments the number of sessions as I hit the welcome page with different browsers. Am I doing something wrong?

I'd love to get this working - so sessions are only created when a user logs in. Those JSPs that need a session, I'll override the default with session="true". I often see a whole bunch of sessions on the wiki and roller apps on this site - and in reality - a session should never be created, unless I login. At least I think that's how this is designed to work...

Posted in Java at Jan 22 2004, 11:23:18 AM MST 4 Comments