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.

i18n - synching up Struts and JSTL

As he did with Roller, Jaap van der Molen made some enhancements to AppFuse to fully support internationalization. He also translated all the existing keys to Dutch. What a guy, eh?!

After I installed this enhanced version of AppFuse, I noticed a few quirks. Namely that my default language was Dutch. To me, this meant that my browser's local must be Dutch. However, since it wasn't, I knew there had to be an issue. After a bit of Googling, I found my answer. It turns out that if you don't specify the language on your default properties file, JSTL won't pick it up - and it defaults to the first one with a language specified. This means that you must have ApplicationResources_en.properties instead of ApplicationResources.properties. Also, another quirk is that you need to synch up Struts locale-setting and JSTL's locale-setting. To do this, I added the following method to my ActionFilter.java class:

    // keep JSTL and Struts Locale's in synch
    Locale locale = (Locale) session.getAttribute(Globals.LOCALE_KEY);
    if (locale == null) {
        locale = request.getLocale();
    }
    if (request.getParameter("locale") != null) {
        locale = new Locale(request.getParameter("locale"));
    }
    session.setAttribute(Globals.LOCALE_KEY, locale);
    Config.set(session, Config.FMT_LOCALE, locale);

Even with all these "hacks" - Mozilla and Safari handle this stuff differently on the Mac. Jaap says that everything works fine on Windows w/o these hacks, so maybe it's just an OS X thing. Regardless, to make things easier, I've added the ability for users to switch between languages by clicking on their language of choice.

There's nothing like adding a new feature to something you're about to demo! I'm on in 45 minutes - the butterflies are fluttering like mad...

Posted in Java at Apr 15 2004, 12:42:00 PM MDT 9 Comments

MySQL Conference - Day 2

JBoss and MySQL
I'm sitting in Mark Fleury's session on MySQL and JBoss Integration. I'll try and record the things I learn in this session. The first thing that Mark mentions is how they own many popular open source projects: Hibernate, Tomcat, etc. - because they employ the lead developers on those projects.

JBoss Numbers
A standard in the market: #1 in development - more than 4 million downloads in last two years alone. A standard for System Integrators: #2 in growth - CRN survey puts JBoss certified consultant at #2 fastest growing certification with large system integrators. A standard in the market: #3 in production - JDJ survey: 70% of users to go Deployment. BZResearch survey. 13% in 2002, 27% in 2003, largest growth of all servers (IBM at 40% and BEA at 34%).

"Federated" Projects
JBoss AS, Hibernate, Tomcat, JBossIDE (Eclipse integration, XDoclet driven development, debugging), JBossCache (distributed data), JGroups (reliable multicast and cluster communication), Nukes (portal and CMS), JBossAOP and Javassist (bytecode manipulation library).

Cache and ORM: Scalability for MySQL
Keep your data in a MySQL instance. Put an ORM (Hibernate) layer on top of it. Replicate the data with cache infrastructure. Cache is King.

Mark is now talking about Hibernate and what it's useful for. I'm guessing that a lot of folks in this session are either interested in JBoss or Hibernate. He's talking about RDBs and what they do well. Next I'm guessing he'll talk about Hibernate and all its features. No need for me to regurgitate that information here - since I suspect a lot you are familiar with Hibernate. If not - what the hell are you waiting for? ;-) If you can't use Hibernate b/c you're standardized on SQL, you should at least use iBATIS. BTW - did you know that BEA's Page Flow demo app is a re-written version of Clinton's JPetstore? If you're standardized on JDBC, you might want to use Spring's JDBC support - which solves many of the problems with JDBC (try/catches, closing connections, etc.).

What is JBossCache?
A transactional replicated cache for JBoss with and without AOP. A cache for frequently accessed elements: Stateful Session Beans, HttpSession. Caches are used in a number of places in JBoss - this one provides a central cache service (MBean interface).

AOP Cache
Java is very dumb - Mark hopes the next OO language we use (in 10 years) is more event-driven (i.e. triggers in Java). This is possible today with AOP. In the example below, Joe's state is automatically transactional and replicated. State replicated, synchronized at transaction commit/rollback.

tree.start(); // kick start tree cache
tree.putObject("/aop/joe", joe); // add aop sanctioned object

tx.begin();
joe.setAge(41);
joe.getAddress().setZip(95124);
tx.commit();

Mark says, "HQL - soon to be EJB 3.0 QL". Interesting quote, eh?

PHP PostNuke - wasn't scalable when they first installed it because it hit the database all the time for security information. The Zend PHP didn't have the notion of global variables - so there wasn't a way to build a cache. According to the PHP guys, MySQL was the cache. JBoss re-wrote it all J2EE and now their server is at 5% utilization with an average of 500 concurrent users. Forums are a port of PHP BB - which is a very nice forum software package IMO. Personally, I'd prefer to use PHP BB over JBoss Nukes since most ISPs offer PHP out-of-the-box. I'm guessing that JBoss Nukes only runs on JBoss. Also, PHP BB is much cleaner and prettier out of the box. I'm a sucker for good looking webapps. ;-)

BTW, Jeremy Zawodny (Yahoo guy) has a number of links that might of interest for this conference. For your convenience, here's the best link: the 2004 MySQL Users Conference blog aggregator.

Posted in Java at Apr 15 2004, 08:30:58 AM MDT 7 Comments