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 "java". 1,588 entries found.

You can also try this same search on Google.

Jenerator

I heard about Jenerator on the mailing list this morning. Sounds cool.

The Jenerator Version 0.9 is a code generator (Licensed under the Academic Free License version 1.1) and hosted on SourceForge, which takes meta information from different mediums, applies XSL templates and generates code. Unlike other code generators, which use JavaDoc custom tags to define and describe what is to be generated, Jenerator uses XML based Descriptor files.

It's got a heck of a list of features too: supports regeneration, EJBs, VOs, Unit Tests for JUnit and Cactus, Ant's build file, JDO source descriptor, and Servlets. While all this sounds good, I probably won't even download it - I'm just not interested as I really like how XDoclet works right now. I might change my mind in a few weeks, but I've learned too much to give it up now.

Posted in Java at Dec 13 2002, 02:47:53 AM MST Add a 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

Another Hibernate Example

Konstantin Priblouda has put together a small demo showing hibernate in action:

  • XDoclet generated mappings & service descriptor for JBoss (.sar file) - these were mentioned by Marc Fleury at his presentation. The basically are Service ARchives and allow for pluggability/removeability in JBoss.
  • Session bean accessing hibernate.
  • Small client.

Posted in Java at Dec 13 2002, 12:08:33 AM MST Add a Comment

Eclipse Plugins and Hibernate

I found a new site with a list of Eclipse plugins tonight. I was hoping that the Ant View plugin could solve my Ant problems in Eclipse, but I can't seem to figure out what it does. I gave it the ol' 30 seconds of investigation - maybe I should read the documentation. The problem I'm having now is (after swapping Ant 1.4 jars for 1.5.1) is:

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.

Hmmm, works fine from Cygwin, and Eclipse (2.0.2) has tools.jar and rt.jar in the classpath. Must be time to download a nightly build.

There was a lot of talk today in the java.blogs community about Hibernate. I'm happy to see this as it feels like I just bought a new car and everyone is saying it's the best car on the road. I decided to use Hibernate based on Dave's implementation in Ag. It looked easy enough, so I figured - why not?! It turns out, at the same time, that the XDoclet folks were in the midst of creating a new hibernate module in CVS. In fact, I got the hibernate module from Joel Rosi-Schwartz (I'm assuming a hibernate developer) before it was even in the XDoclet source tree.

I got to be a guinea pig in making hibernate tags work with XDoclet. I have to say that with Dave's working example, I was able to markup a POJO with hibernate/xdoclet tags and generate my persistence layer in a matter of minutes. It just worked. Kinda like Tomcat IMHO. That's how software should be. Check out my security-example if you're interested in using Hibernate with XDoclet. The readme in the source will explain how to run initial generation and tests. Currently, it generates a Struts Validator Form and VO from an Entity bean (located at src/ejb/org/apache/template/User.java). Why? Because Struts Forms can only be generated from Entity Beans. This needs to change IMO. But at the same time, the EJB architecture is already in place, I just need to execute the ejb-related tasks, and I'm in business.

In other news, a couple of Struts related goodies:

  • ONJava.com has an introduction to the Validator Framework by Chuck Cavanass, an Introduction to Eclipse and Creating Reports with FOP. I used FOP on a project last year around this time and it's super slick. It's basically using XSL to generate PDF and RTF from an XML file. I highly recommend using something like RTF2FO to generate an XSL Template from a Word document.
  • Struts Kick Start is now shipping from Amazon. I'd buy all the Struts books just to say you have them. I've got three ;) Haven't read any. Damn, I wish I had the time! Reading Erik Hatcher's Java Development with Ant was one of the smartest things I did this year. Actually, the smartest thing I did was get my wife pregnant yeah baby
  • I downloaded TogetherSoft's Control Center to do some UML Modeling for the Struts Chapter, and found that they use Struts on their site. Nice...

Posted in Java at Dec 12 2002, 05:37:04 PM MST 22 Comments

Struts Books are Hot!

I found on the Struts website that the top 2 Java books sold at Amazon.com this month are Ted's Struts in Action and Chuck's Programming Jakarta Struts. You can look at the Bestselling Java Books for proof. Don't you find it strange that #3 is a Perl book though?!

Posted in Java at Dec 12 2002, 11:49:51 AM MST 2 Comments

XDoclet and EJBs

I saw the following on the xdoclet-user mailing list today:

Chapters from Manning's "EJB Cookbook", by Ben Sullins and Mark Whipple will be made available on TheServerSide for public review. A chapter on "Code generation" is now available for download. "Code generation" presents the most common uses of XDoclet, an open source tool, tightly integrated with Ant, that lets you generate source code or other files.

Also, I just received the following e-mail from a fellow Denverite, Mike Clark:

Subject: Nice Blog

Hi Matt!

I've been enjoying reading your blog for a while and meaning to introduce myself since we both live in Denver. I'm speaking at the DJUG in April, so perhaps we can meet each other there.

By the way, my weblog is at: http://www.clarkware.com/cgi/blosxom.

Nice - gotta like e-mails like that!! Apparently, Mike is the Author of BitterEJB and also has some chapters for review at TSS:

If you're into JMS and message-driven beans, my "Bitter Messages" chapter is up for review on TheServerSide. As always, any feedback you might have is greatly appreciated!

Posted in Java at Dec 12 2002, 08:45:19 AM MST Add a Comment

How Hot are your Topics?

I noticed the "hot" links over at java.blogs this afternoon. They show who has the most read topics for a particular day - at least on that website. I had 2 of the top 3 yesterday! If that's not motivation for better writing, I don't know what is. But is this really a popularity contest? Are we trying to boost our Google/Java.Blog rankings? Probably not, but it sure won't hurt when you're out looking for a new job!

That being said, I interviewed for a J2EE developer position this morning. The project sounds pretty cool - using Struts, Servlets, JSPs and such to create a web front end to an Oracle database. The guy who interviewed me seemed very smart and would be great to work for - he's chosen J2EE as an architecture and wants to run the production system on Tomcat. Nice! All the stuff I've been working with for the past year and a half. He's probably reading this right now (I sent him the url to my blog), so hopefully this post helps me out. ;-)

Another reason for writing this post is to let you know that there is another open position on this project. Required Skills: HTML, XHTML programming. Any Java/J2EE, LDAP or Apache/Tomcat skills would be a bonus to complement the team. If you're interested and you live in Denver, let me know, and I'll send you the recruiter's e-mail. I believe the contract is for 3-6 months.

Posted in Java at Dec 12 2002, 07:58:24 AM MST Add a Comment

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

The TVC Framework

Here's an interesting new extension for Struts:

The TVC Framework uses the Struts framework to create HTML tables with functionality that includes paging, sorting, filtering of data, and data validation.

This joins the ranks of Ed's <display:*> tag library and Yuriy's html table tag library. I've always like the display tag library as it's easy to setup and use - just pass it an ArrayList of beans and you're off! The TVC Framework seems to offer some cool functionality, but you have to pay $995 for the good stuff :(. Of course, if you're trying to code similar functionality on your own, you'd probably save your self some money if you bought it.

Posted in Java at Dec 11 2002, 04:20:36 AM MST 3 Comments

Forcing SSL on a JSP

I'm trying to replicate the behavior that occurs when you set CONFIDENTIAL to confidential in web.xml. If I do this, when I hit the index.jsp page of my webapp, I am automatically redirected to https://localhost/myappname. However, I have a different SSL port setup for testing, and I'd like to only switch on one page, the index.jsp page. So I've added the following scriplet to my index.jsp and it works great in Mozilla, but fails in IE. IE prompts me with the certificate information, and then gives a "Cannot Find Server" error. Any ideas?

<%
// TODO: Make this into a tag library
Boolean secureLogin = (Boolean)application.getAttribute(Constants.SECURE_LOGIN);
System.out.println("secureLogin: " + secureLogin);
if (secureLogin.booleanValue()) {
    // make sure we're using https
    if (request.getScheme().equals("http")) {
        String redirectString = SslUtil.getRedirectString(request,
                                                          application,
                                                          true);
        
        System.out.println("redirecting to: " + response.encodeRedirectURL(redirectString)); 
        %>
        <logic:redirect href="<%=response.encodeRedirectURL(redirectString)%>"/>                                                    
        <%
    }
}
%>

Everything looks the same in Tomcat's log when using either browser.

Posted in Java at Dec 10 2002, 10:10:25 AM MST Add a Comment