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.

Eclipse tip o' the day

By default, Eclipse expects all its plugins to be in $ECLIPSE_HOME/plugins. This doesn't work too well for upgrading since you have to copy all of your installed plugins to Eclipse everytime you upgrade. To solve this, you can place all your plugins in an external direct and point to them using a link file. To do this, create a links directory in $ECLIPSE_HOME and create a file inside it that points to an alternate location. The name of this file doesn't seem to matter, but it must end with a ".link" extension. In this file, put a path:

path=C:\\Tools\\myplugins

Then in c:\Tools\myplugins, create an Eclipse-like directory structure so you end up with c:\Tools\myplugins\eclipse\plugins. Then drop your plugins in that directory. If you choose to use an alternate workspace as well, upgrading Eclipse will be as easy as copying in your links folder. BTW, here's more information on upgrading Eclipse.

Posted in Java at Aug 25 2004, 07:35:52 PM MDT 10 Comments

Tapestry and Hibernate Tutorial

Wanna use Hibernate with your Tapestry application? Or maybe learn about Tapestry for the first time? If so, Warner has a great set of tutorials. His first tutorial on creating a CRUD application with Tapestry was exactly what I needed - right when I needed it - thanks Warner! I'm looking forward to his next tutorials, especially Spring, Hivemind and Lucene. Integrating Spring with Tapestry is pretty simple - we'll have to see how Hivemind compares.

Posted in Java at Aug 24 2004, 09:40:49 PM MDT 2 Comments

How do I customize Eclipse on-the-fly?

My task for this week is to figure out how to customize Eclipse on-the-fly? By this, I mean that we're going to install Eclipse and then programmatically add plugins and configure them. Is this possible? We'd also like to add projects to the workbench and have them be there when the user first opens Eclipse. My current technique is to do diffs on directories after I've configured/added stuff, but that's probably not a good long-term solution.

Posted in Java at Aug 24 2004, 11:22:24 AM MDT 9 Comments

Use Tapestry in AppFuse

Lee Grey shows how to integrate Tapestry into AppFuse. Good stuff Lee. I can't wait to pump out the the WebWork version of AppFuse so I can start on Tapestry integration. Then again, I do have it on the roadmap to take a break after 1.6. I hope to release 1.7 (with Tapestry) in early November. As for JSF, I think I'll wait until next year.

Posted in Java at Aug 23 2004, 08:57:36 PM MDT Add a Comment

My Tiles to SiteMesh Migration

I spent a few hours last night replacing Tiles with SiteMesh in AppFuse. I had the Struts version done in 2 hours, and most of the Spring version done in an additional hour. Then I spent another 3 hours today twiddling with things and getting it just right. During this process, I discovered a few things I thought I'd share. Keep in mind that I'm pretty much a SiteMesh rookie. Hopefully, implementing and using it in AppFuse will help me to fully understand its power.

  • SiteMesh lacks injection. Tiles allows you to inject JSP fragments into your base layout on a per-page basis. I didn't use this feature much, but I did use it to determine which menu should show up on what pages. For example, the login page would get a "projects used" menu, the signup page wouldn't have a menu, and all other pages would get the standard site menu. With SiteMesh, all of this seems to be done best with JSP includes and some <c:if> logic in your decorator. I ended up using <c:import> in my login.jsp for the login menu, importing nothing for signup, and using <c:if> statements in my decorator to see if the user was logged in. If they were, then I import the site menu and its necessary scripts and styles. In the end, this worked fine and it's probably easier for new AppFuse users to understand - so that's a good thing.
  • Injecting scripts and stylesheets. With Tiles, I was able to easily control which scripts and stylesheets were shown on each page. With SiteMesh, this is pretty easy to do by putting them in the <head> element of your page. However, what I would've really liked to see is the ability to put these in an included JSP and have them end up in the <head> of the final document. I know it's virtually impossible, but it would be cool.
  • Headings. Adding a <title> title element per-page works great using the <title> tag. However, if you want to add a heading (which I specify with an <h1> tag), you have to use a <content> tag. It would be cool if I could somehow use <h1> or <heading> in my page to indicate a heading. I ended up going with the following in each page to specify the title and heading:
    <title><fmt:message key="mainMenu.title"/></title>
    <content tag="heading"><fmt:message key="mainMenu.heading"/></content>
    There's probably an easier way to do this, but this works for now.
  • Injecting <body> ids. Using body ids to set styles on a per-page basis is a great way to control CSS. With Tiles, I set this as an attribute in tiles-config.xml and then grabbed/used it with the following JSTL code:
        <c:set var="bodyId" scope="request">
            <tiles:getAsString name="body.id" ignore="true"/>
        </c:set>

    <body<c:if test="${not empty bodyId}"> id="<c:out value="${bodyId}"/>"</c:if>>
    Yeah, it's ugly, but it works. With SiteMesh, you can easily set a body id by using <body id="name">. In fact, you don't even need to wrap your content with it, you can simpley do <body id="name"/>. I'm grabbing and using this in my decorator with the following code. This works, but it would be cool if I could check for the existence of the attribute first - so I could eliminate id="" when no body id is set.
    <body id="<decorator:getProperty property='body.id'/>">
  • Inheritance. With Tiles, you could extend page definitions and override attributes. This feature seems to be completely lacking in SiteMesh. I don't know how you could implement it, but it would be nice to have something where you could specify the parent - for instance, to use the same <head> content.
  • Error page decoration. SiteMesh seems to be incapable of decorating error pages (i.e. 404) in Tomcat 5.0.x (even if I add <dispatcher>ERROR</dispatcher> to the filter-mapping). A workaround is to use wrap the error page with a <page:applyDecorator> tag. This works, but if you specify elements in <head>, they will end up in the body of page, rather than in the decorator's header.
  • SiteMesh simplifies. Switching from Tiles to SiteMesh allowed me to delete somewhere around 8 JSPs. AppFuse has 34 after committing everything. Most of these were JSPs that sat in the root folder and had a one-liner to pull in a Tiles definition. However, it also eliminated 11 JSPs from the Spring MVC install - allowing reduction of duplication. The Spring MVC install now has 17 JSPs.

So there you have it. AppFuse now uses SiteMesh instead of Tiles! I'm sure the implementation will get cleaner and more refined as more folks use it. I'm looking forward to deleting some chunks out of AppFuse's tutorials because SiteMesh makes page development so much easier. The hardest part of SiteMesh is setting up the infrastructure. Once you're got that done, you hardly ever touch it again.

Next task: WebWork integration.

Posted in Java at Aug 21 2004, 11:50:50 PM MDT 14 Comments

One thing's for sure

The Java Community certainly does care about JSF. Regardless of whether folks like it or hate it - there's definitely a lot of opinions! Who woulda thunk a simple blog entry would get so much traffic? Wierd.

You know it's a late night when Erik posts before you go to bed...

Posted in Java at Aug 20 2004, 04:52:09 AM MDT 10 Comments

FindBugs

I ran FindBugs on AppFuse last night and found/fixed a number of issues as a result. I'm now down to only a handful left - most of them being "Class is Serializable, but doesn't define serialVersionUID". I tried to generate one using serialver, but I couldn't it to work after numerous attempts. My issues seemed to be classpath related: it wanted the servlet api in my classpath, and once I'd add that, it could find my class. I'll have to try the SerialVer Ant Tasks. Fixing this issue would be nice, but I doubt it's really affecting appfuse-based applications. The other bug is "Inconsistent synchronization" in UserCounterListener.contextInitialized() method. Any tips on solving this one are appreciated.

Posted in Java at Aug 19 2004, 09:46:50 AM MDT 15 Comments

Should I ditch Tiles in AppFuse?

I've haven't been developing applications with AppFuse since May. Instead, I've been using Equinox. One of the main things in Equinox I've grown to love is SiteMesh. It's worked in all the webapps I've written, which utilize frameworks like Struts, Spring MVC, WebWork, Tapestry and JSF. Tiles will only work in 3 of those.

I think it's time to make an executive decision on AppFuse and ditch Tiles in place of SiteMesh. It's faster and easier to develop with, and it doesn't get in your way. In fact, I didn't have to change a single line of SiteMesh-related code to support any of the aforementioned frameworks. Furthermore, using SiteMesh would also greatly reduce the duplicate between frameworks. I've thought about keeping Tiles around, but it's a pain in the ass to maintain parallel sets of documentation.

Whaddya think - any reason you can think of to keep Tiles? I can't. In fact, I think I'd cringe if I had to start my next AppFuse-based project w/o SiteMesh.

Posted in Java at Aug 18 2004, 10:11:56 AM MDT 33 Comments

Denver JUG gets a makeover

I just noticed tonight that the DJUG website got another makeover - and it looks great. Nice work Renee! Not only that, but the line-up of speakers and topics for the coming months is awesome: Dion, Mike, Bruce and yours truly. I actually enjoy DJUG meetings more than I do conference sessions. The speaker is not fixed to a certain time (though they are encouraged to be under an hour) and you get to have beers with them afterwards.

Posted in Java at Aug 17 2004, 10:59:19 PM MDT 6 Comments

Which one are you?

Which type of developer are you - Asshole or Moron? I'm a moron as far as I can tell. 8-}

I got a free copy of Mark's Dive into Python at OSCON. Apress said they'd give it to me if I agreed to post a review on Amazon. I hope Mark's writing is as good as his blog.

Posted in Java at Aug 17 2004, 11:20:13 AM MDT 2 Comments