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.

JSF and Apache Axis at DJUG

I attended tonight's DJUG Meeting. The meeting was informative and well attended, but it was way too long. I just got home and it's a bit after 11:00. To put it in perspective, I arrived at 6:00. That's 4 1/2 hours of Java love. Elections contributed to the delay, as well as David Geary's 2 1/2 hour JSF presentation.

The basic concepts meeting covered Apache Axis, presented by Scott Davis. He showed us how easy it was to use Axis to create a web service and how to call it from the command line. The biggest highlight of his presentation (for me) was Keynote - his presentation software. It had wicked transitions and the slides looked awesome (good purchase Scott). Other cool software noted during Scott's preso was CodeTek's Virtual Desktop.

Next up was David Geary for a presentation on JSF. This guy has quite a resume: worked for Sun from 1994-97, member of the JSF and JSTL Expert Groups, author of 6 books, designed and implemented the Struts Template library (2nd committer to Struts after Craig). Books coming soon from David: Core JavaServer Faces, Core Rave, and Extreme Struts. Extreme Struts sounds very much like the Struts chapter I wrote for Pro JSP - XDoclet, StrutsTestCase, JUnit, Tiles and Validator. If you're looking for documentation on AppFuse or Struts-Resume, you'll find it in this book. If you don't remember, I wrote these apps for my chapters.

Most folks reading this blog probably know what JSF is. If you don't, it's a Java-based framework for building web applications. It is designed to replace Struts, but that probably won't happen until well after it's 1.0 release (March, Beta in December). JSF was also written to compete with .NET's WebForms, kinda like how JSP was developed to compete with ASP.

Sun's Project Rave is what supposedly will make JSF easy. Can Rave really be that much better than Eclipse or IDEA? Good luck Sun, those are two killer IDEs that are going to be very difficult to beat. And besides, has Sun ever produced any good applications? iPlanet sucks, so does Forte - comparing both to the other options out there.

I could go on and on about what I learned at this presentation, so let me just give you a brief synopsis. JSF generates JavaScript for you for event handling. The JSP tags are long and ugly, but they're named this way (i.e. <h:selectone_menu>) to distinguish a component (selectone) from a renderer (menu). David said he complained about this immensely when he joined the Expert Group, but now sees the point. No XML attributes are used in faces-config.xml - it's all entities. Reminds me of web.xml, lots of typing for not much information (what a pain - today's tool suck at deployment descriptors). JSF has no client-side validation - looks like Commons Validator will be around for quite some time. Especially since JSF requires you to specify your validation after each component in the JSP (vs. declaratively using the Validator). JSF EA4 does not work with Tiles - they're working vigorously to fix this. You can specify your navigation-rules separate from you actions in faces-config.xml (very cool feature).

If you know JSPs and Servlets, it's much easier to learn Struts (and presumably other webapp frameworks). If you know Swing, it'll be much easier to learn JSF. To me, this seems wrong. Some of the examples given tonight had HTML in .java files (for custom renderers). Are we reverting back to Servlets? Is Sun making a mistake with JSF? How is it better than WebWork or Struts? It seems to me to be an over-designed product developed by a bunch of Swing addicts.

My first impression of JSF is that it's going to be harder to teach to newbies (vs. Struts). Everyone says it's a standard so the tools vendors will come through and make it easy. The tools vendors haven't done shit for JSP and JSTL IMO, so how is JSF different? It's a good idea, it just needs to be simplified - a lot. KISS.

Posted in Java at Oct 08 2003, 11:24:35 PM MDT 1 Comment

New Gig starts November 3rd

I gave my notice on Monday and will be starting a new gig on November 3rd. My reasons are simple: I can bill for the commute (45 minutes each way), I can work from home 1-2 days per week, mentoring/teaching opportunities and the biggest - they want me to help them build a Resume Entry application. Sweet - I'm hoping to use Struts Resume as a baseline. If they agree to use Struts Resume, we'll have half the project done on my first day! The hard parts will be getting it to run on WebSphere and DB2 - their platforms (that I've never worked with). They're hiring me as a mentor on Java and Eclipse and also expect me to cut a fair amount of code. It'll be cool to have mentor as part of my job description. It's also a government agency, which means 40 hour weeks and no weekends. If anyone has gotten WebSphere running on OS X, hooka brutha up!

I gave my current gig a 4 week notice because I want to help them roll out the first phase of websites, and verify that architecture I helped them build actually works. They're looking to replace me with someone that has similar skills. They're located in Lafayette, Colorado - and it really is a fun place to work. Here's the most important things to know for this position: Struts, Ant, JSP and Tomcat. Let me know if you're interested.

Posted in Java at Oct 08 2003, 04:00:47 PM MDT 2 Comments

IDEA seems dumb

I'm going to rant about my issues with IDEA here because it always gets to so much praise in blogs. I like the fact that it opens quickly on OS X. However, every other time I open it, after it spends 10-20 seconds "loading project files," then synchronized local VCS and then the dialog hangs and I can't get rid of "storing local CVS." Closing IDEA fixes the problem usually. Secondly - and this is a new one - I just created/opened a new project (Canoo's WebTest) and it can't find import java.util.Map; What the? You can't find "java" files even though I told you my JDK was in "/usr" (which it should've detected anyway). It's highly likely that I'm the dumb one, but at this very moment it seems that IDEA gets to wear the dunce cap.

Posted in Java at Oct 08 2003, 09:27:54 AM MDT 9 Comments

What's the best way to test Tag Libraries?

I know of two tag libraries that are in dire need of unit tests - the displaytag and struts-menu. Both have no tests. I've looked briefly at TagUnit, but aren't you just writing JSPs (with custom tags) to test JSPs? I'd rather have an Ant/JUnit driven solution. Also, are there HTML versions of the user guides for TagUnit (Simon ;-)? I hate PDFs.

So my question is - how do you test your tag libraries?

Posted in Java at Oct 07 2003, 10:28:26 AM MDT 7 Comments

Monitor Connections in SQL Server

Does anyone know how to monitor the number of Connections in SQL Server? In MySQL, I use "mysqladmin processlist", but there doesn't seem to be such a utility for SQL Server. I need to make sure that my connections are getting closed properly.

Posted in Java at Oct 06 2003, 04:54:46 PM MDT 4 Comments

Java Infested Week

This week looks to be highly Java infested for me. This is a good thing and I hope to learn a lot. Tomorrow, I'm teaching a JSP class at a local company, so I'll probably learn some tips and tricks with JSPs from the students in the class. Wednesday, the Denver Java Users Group has a presentation on JavaServer Faces. Thursday, James is coming to the Boulder JUG to talk about Effective Object Orientation. I'll be attending both. Finally, on Friday, I'm joining Julie, Abbie and rest of her family in Evansville, Indiana for Julie's Grandpa's (a.k.a. "Paw") Birthday. I'm on a late Friday night flight, and it's long, so I plan on knocking out JSP 2.0. Then again, airplanes tend to put me to sleep. Combine that with a book on technology and I may just end up getting some good rest for the party on Saturday.

It's a good time to be a Java Developer in Silicon Mountain.

Posted in Java at Oct 06 2003, 08:11:49 AM MDT Add a Comment

Dynamic Queries with Hibernate

I have a client that wants the ability to search on all columns in all tables in their database. So far, I've been able to get all the columns, and their friendly labels by getting all the *Form.* keys in my ApplicationResources.properties file. I still need to sort them alphabetically, but that's another issue. Now I have the following UI pretty much done:

I'm happy with the UI, but I'm struggling with getting Hibernate to return my desired results. I'm able to dynamically select the table/column to search on because of values in my "tables/columns" drop-down. However, many of these tables have Id fields - for status fields, type fields, etc. (basically drop-downs). When searching, this is a pain because users are likely to search on "Active" rather than "1". Because of this, my first issue is how do I make the status field's friendly name a part of my POJO (with Hibernate)?

My 2nd issue is regarding Hibernate's Expression API. I want to be able to pass in the criteria (=, contains, <, >), propertyName and value and get my results. However, it seems that the second half of the comparison must be the same datatype as the field. This means if you're searching on "contract amount", and its a Double, I need to do a Double.valueOf(searchTerm). Basically, I'm looking for an easy way to do this:

  Criteria filter = ses.createCriteria(clazz); 
  
  // determine type of expression - I'd love to figure 
  // out a cleaner way to do this but there's only 
  // 5 possible types, so I don't mind typing the 5
  // if statements
  if (expression.equals("=")) { 
    // How do I convert these to the fields' type at run-time?
    // Sure I could do a bunch of if statements again, but it seems ugly.
    filter.add(Expression.eq(field, Double.valueOf(value))); 
  }
 
  List results = filter.list();

Any advice is appreciated - especially considering I estimated this task to take 4-5 hours and I'm going on 8.

Posted in Java at Oct 05 2003, 10:39:29 AM MDT 11 Comments

Time to hook up the Senior J2EE Developers in Denver

This is nuts - I'm getting at least one call or e-mail per day from recruiters and/or friends in Denver. Rather than posting these positions here (with Rates), if you're a Senior J2EE Developer in Denver, let me know. I'm going to start a list of folks with skills like mine so I can hook some brutha's up! I have 2 right now - both for J2EE/Web stuff.

Here are my requirements to get on my list:

  • Must know Ant, meaning you've written a build.xml file before. Having read Java Development with Ant is a huge plus.
  • Blogging is a plus - it means you're interested in Java and sharing your ideas (implying that you think outside of work).
  • You've used Eclipse or IDEA and use one or the other on a regular basis. This implies that you know a good IDE can improve your productivity.
  • Must know XHTML and CSS. I do, and I said skills like mine.
  • You're able to checkout AppFuse from CVS, build it and run "test-all" with success. README.txt is your friend.

I reserve the right to delete any of your e-mails and resumes, and to hook my friends up over other folks. I don't want to get a flood of e-mails, I'm just trying to hook up good folks with good jobs. If I can get the rates, I'll let you know what they are.

Posted in Java at Oct 03 2003, 12:08:47 PM MDT 9 Comments

Simple "workaround" for exporting with the displaytag using Tiles

I figured out an easy "workaround" to the fact that the displaytag's export feature (to XML, CSV, and Excel) doesn't work when using Tiles. The happens because the response has already been committed by Tiles (when including previous JSPs) and the displaytag is unable to set the contentType. Here's my workaround:

In struts-config.xml, create a local forward that goes directly to the JSP:

  <forward name="exportList" path="/WEB-INF/pages/userList.jsp"/>

Then in your Action, add a little logic to see if you should forward to the definition or to the list:

  // if exportType is a parameter, forward directly to JSP
  if (request.getParameter("exportType") != null) {
    if (log.isDebugEnabled()) {
      log.debug("export detected, forwarding directly to list jsp");
    }

    return mapping.findForward("exportList");
  } else {
    // return a forward to the user list definition
    return mapping.findForward("list");
  }

Tested with displaytag 0.8.5 on Windows XP and Tomcat 4.1.27. Enjoy!

Update: This workaround will not work with displaytag 1.0b1. There is another solution using a Filter, so we'll try to incorporate that into the 1.0 release.

Posted in Java at Oct 02 2003, 09:58:41 PM MDT 1 Comment

Packaging Velocity

I've made a number of changes to struts-menu this week, and it now supports the ability to render menus via Velocity templates. This allows for easy customization and basically allows for you to create any type of navigation system you want (i.e. drop-downs, tabs, plain ol' links) etc. One of the issues I'm wrestling with is how should I package Velocity with the distribution. Usually, to integrate struts-menu into a Struts-based application, you only need to include struts-menu.jar. Now, if you want to use Velocity for your menus, you must include velocity.jar and velocity-tools.jar in your application's WEB-INF/lib. I think most users will accept this.

However, in the example app, there's a velocity.properties file and a couple example templates. This seems like an opportunity for many users to forget to include these - so I'm wondering what's the best way to package these. Should I put velocity.properties in the source tree, and initialize my VelocityMenuDisplayer using that? Should I do a check to see if the user has their own velocity.properites in WEB-INF/classes for an optional override?

Another question is should I put the sample templates (simple.html and coolmenus.html so far) in the source tree, and then use Velocity to load them from the struts-menu.jar file? Or should I package them in a menu-templates.jar file?

Basically, it all boils down to this question: If you have a project (.jar) that depends on Velocity and plugs into web applications - what is the best way to distribute your Velocity settings?

BTW, I hope to make an effort to decouple this library from Struts someday - shouldn't be too hard.

Posted in Java at Oct 02 2003, 03:38:32 PM MDT 3 Comments