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 "roller". 153 entries found.

You can also try this same search on Google.

What should I learn next?

I received an e-mail a few minutes ago from an old friend. We used to work together at eDeploy, which has finally gone out of business, 2.5 years after they closed their doors. This was my last full time job and was also my favorite job of all time. I rode my bike to work, got to learn Java, wore shorts all the time, and thoroughly enjoyed our Friday lunches.

His questions were fairly simple:

  • What is the best way to find a Java job/contract in Denver?
  • Since you've had a lot more exposure to what technologies are being used more than others, is there somethings that I should brush up on while I've got the time off (i.e. struts, xslt, EJBs, . . .)?

I wrote a long answer and thought others might be able to benefit from it - so here it is (please add your own advice as you see fit):

What I'd recommend is to subscribe to the following local mailing lists:

RMIUG Jobs: RMIUG Jobs: http://rmiug.org/html/email_lists.html
DJUG Jobs: http://www.denverjug.org/resources/mailinglist.html

They get a fair amount of jobs that come across the wire, and I actually got 2 gigs last year through the RMIUG list. Struts is definitely one of the hottest skills, but I continue to get a lot of calls as a UI/Java Developer. Having the ability to write clean and pretty HTML as well write Java seems to be rare. To complement Struts, I'd focus on JSTL and JSP 2.0. You can't go wrong learning more about Ant and JUnit - I think a lot of people know JUnit, but not many put it on their resume.

You could check out my AppFuse application which uses all of these, as well as Hibernate (another hot one) for the persistence layer.

I started writing AppFuse when I wrote a couple chapters for Pro JSP last year. I use it on all my projects and it really helps accelerate the whole JSP/Struts/JUnit/Tomcat development cycle.

I'd also recommend reading a couple of really great books:

Java Development with Ant: a truly awesome book
Pro JSP: of course ;-)
J2EE Design and Development: I'm reading it right now

EJBs are a thing of the past - you might be able to get a gig doing them, but they're definitely waning. Rod Johnson (author of the 3rd book) wrote the Spring Framework as part of the book, and it's a pretty slick framework for taking the ugly out of J2EE. The project is getting a lot of press, and I hope to use Spring pretty soon to bind all my components together in AppFuse.

Above all else, I recommend starting to read weblogs (a.k.a. blogs), and if you like it, start your own. The best place to start reading them is JavaBlogs, JRoller and Java.net. I'm a committer on the open source project (Roller Weblogger) that runs JRoller. It's some damn slick blogging software. I host my site at KGBInternet for a measly $20/month and I get my own instance of Tomcat to screw up. Reading blogs is definitely the best way to stay on the bleeding edge of Java (and any other industry for that matter).

Posted in Java at Jan 09 2004, 12:38:04 PM MST 1 Comment

The Battle of the GZip Filters

When I first added a Compression/GZip filter to AppFuse, I used the one from Roller, which I believe Lance found in this book. This has worked fairly well since I added it in July last year. When I discovered that there were issues with it on Resin, I chaulked it up as "no big deal" since I don't use Resin anyway. But yesterday, when I discovered that it stopped my apps from displaying my 403 <error-code> page, that was the last straw. I remembered seeing the "Two Servlet Filters Every Web Application Should Have" article on ONJava.com about a different implementation, so decided to download the source and try it out.

I quickly discovered that this Filter does work on Resin, so that's quite a bonus. I've had issues getting Roller to work on Resin with the Filter enabled, so I might have to replace Roller's CompressionFilter. However, I did still have to change a few things to convince this Filter to satisfy my needs.

Here are a few things I discovered about this GZIPFilter vs. Roller's CompressionFilter:

  • Don't download the GZIPFilter from the article. There is a newer version of the code. Not much has changed, save for an almost completely re-written GZipResponseStream.java file. This one supposedly does better handling of large files.
  • This Filter has the same problem I experienced with Roller's CompressionFilter: JSP pages don't finish rendering when running my Canoo WebTests. I'm assuming that this is because the buffer hasn't finished spitting out HTML. I ended up writing a new isGZIPSupported() method (in GZIPFilter.java) to do the check for GZip support. This allows my webtests to run smoothly by disabling the filter for HttpUnit.
  • This Filter shares another issue that I found in the CompressionFilter yesterday. When my webapp returns an HttpServletResponse.SC_FORBIDDEN error code (from trying to access a method that denies the users role), the Filter suppresses the error and the user is not served up the 403 error page defined in my web.xml. To fix this, I overrode sendError() in GZIPResponseWrapper.java and added a check for this error code in the getWriter() method.

Overall, I'm pleased with this code because I love the concept of GZip Filtering, and now it's not causing any conflicts in my app or targeted appservers.

GZIPFilter.isGZIPSupported(HttpServletRequest):

    private boolean isGZIPSupported(HttpServletRequest req) {
        String browserEncodings = req.getHeader("accept-encoding");
        boolean supported =
            ((browserEncodings != null&&
            (browserEncodings.indexOf("gzip"!= -1));

        String userAgent = req.getHeader("user-agent");

        if (userAgent.startsWith("httpunit")) {
            if (log.isDebugEnabled()) {
                log.debug("httpunit detected, disabling filter...");
            }

            return false;
        else {
            return supported;
        }
    }

GZIPResponseWrapper.sendError(int, java.lang.String):

    public void sendError(int error, String messagethrows IOException {
        super.sendError(error, message);
        this.error = error;

        if (log.isDebugEnabled()) {
            log.debug("sending error: " + error + " [" + message + "]");
        }
    }

GZIPResponseWrapper.getWriter():

    public PrintWriter getWriter() throws IOException {
        // If access denied, don't create new stream or write because
        // it causes the web.xml's 403 page to not render
        if (this.error == HttpServletResponse.SC_FORBIDDEN) {
            return super.getWriter();
        }

        if (writer != null) {
            return (writer);
        }

Posted in Java at Jan 09 2004, 11:30:43 AM MST 15 Comments

Missed that one - XDoclet 1.2 Released

I must've been asleep at the wheel the week before Christmas - XDoclet 1.2 Final got released (already blogged here) and I didn't notice.

I integrated OSCache's Filter into my project today and needed to order the <filter-mapping>s in my project so cacheFilter comes first. I stumbed upon the order attribute, but it appears to be XDoclet2-only feature. XDoclet 1.2 just seems to ignore it. Oh well, I guess I'll just resort to putting all my filter-mappings in an XDoclet fragment (metadata/web/filter-mappings.xml) like Roller does.

On another note, it was easy to integrate oscache since Hibernate 2.1.x ships with oscache.jar (I wonder which version it is?). If you're using AppFuse 1.2, it's in there and I encourage you to look into using it. I got inspired after reading Dave's Improving Web Application Performance and Scalability chapter in Pro JSP. I finished reading it earlier this week, and have found that it's a great reference for JSTL (and probably JSP 2.0 when I start using it).

Posted in Java at Dec 30 2003, 12:43:46 PM MST Add a Comment

Hibernate's AdminApp - a demo of WW2 and Hibernate

After looking at Hibernate's AdminApp, as well as other WW2 apps - I've noticed something. WW2 developers don't seem to give a rats ass about referencing their POJOs in their Actions, or using Hibernate directly in their actions. At first glance, I think to myself, "boy that sure makes things easier." But then again - doesn't that tightly couple your web layer to your persistence layer?

I can understand the POJO reference in Actions - I'm about to give up on doing a parent/child relationship with Hibernate where the children are converted to ActionForms and then converted back (Hibernate loves to tell me "a different object with the same identifier value was already associated with the session: 1").

It would be SO much easier (with this particular problem) if I could just toss up POJOs to my view. The thought of importing "persistence.User" into my Action makes me cringe though. I don't know why, it just does. I need to get out of this patterns mindset I've been in for the last couple of years and get back to what really matters - simple, easy to learn, and fast to develop. I'm tired of banging my head against the wall with Struts and Hibernate.... I've been doing it for two days. It's not Hibernate, and it's not Struts, it's me... (thud, thud, thud).

Posted in Java at Dec 17 2003, 02:35:09 PM MST 15 Comments

DB2 with Hibernate and Tomcat

At my current project, we're using AppFuse for our baseline and (currently) Tomcat and MySQL for our databases. Soon we'll be migrating to DB2 for our database. I'm assuming everything will work smoothly with Hibernate, but there's probably some Ant things I will need to modify. For instance, with MySQL, I currently create a new database with the following script:

create database if not exists appfuse;
grant all privileges on appfuse.* to test@"%" identified by "test";
grant all privileges on appfuse.* to test@localhost identified by "test";

Is this possible with DB2? It's no biggie if it isn't - at my Comcast gig earlier in the year, we tied AppFuse/Hibernate into Oracle and simply didn't use the db-create nor db-init (creates tables) tasks. I use Hibernate's <schemaexport> task to create the tables - hopefully this will work in DB2. As for Tomcat, has anyone successfully configured DB2 with Tomcat's DBCP? We'll eventually be migrating to Websphere 5, hopefully it's not a big leap from Tomcat 4.1.27.

I haven't done any research on this yet, just wanted to put out some feelers and get any helpful advice before I start banging my head against the wall (hopefully I won't have to).

Posted in Java at Dec 08 2003, 10:01:55 AM MST 6 Comments

[JSPWiki] Sweet Java/HTML/XML syntax coloring

I found a very nice plugin for JSPWiki this morning: the Java to HTML converter.

This tool converts Java source code (files and snipplets) to HTML, RTF, TeX and XHTML with syntax highlighting. It is Open source under the GPL.

I've found that it works for Java, XML and HTML. Here's a couple of examples (I've hooked it into Roller's JSPWiki support):

Java


/**
@return Returns the id.
* @hibernate.id column="id"
*  generator-class="native" unsaved-value="null"
*/

public Long getId() {
    return this.id;
}

HTML


<html>
  <head>
    <title>HTML Test</title>
  </head>
  <body></body>
</html>

XML



<?xml version="1.0"?>

<!DOCENGINE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
    <class
        name="org.appfuse.persistence.User"
        table="app_user">

        <id
            name="id"
            column="id"
            type="java.lang.Long"
            unsaved-value="null"
        >
            <generator class="native">
            </generator>
        </id>

    </class>

</hibernate-mapping>

The one thing I don't like is that it centers the code using <center>, adding "center table {width: 100%}" to your stylesheet fixes the issue. I also tried to upgrade Roller's JSPWiki.jar to 2.1.86-alpha (to get XHTML support), but I was getting all kinds of stacktraces from OSCache and it just didn't work. Java2Html also has an Ant Task to convert Java source to HTML. Java2HTML has the same thing, but this new one supports different styles.

NOTE: The above syntax coloring produces invalid XHTML, so this site won't validate for awhile.

Posted in Java at Dec 05 2003, 01:02:08 PM MST 4 Comments

[ANN] Apache Tomcat 5.0.16 Stable Released

I guess it happened yesterday, beginning upgrade at 3:10 MST... Done at 3:15 - let me know if you see any issues.

Later: There's issues all right. First thing is that the flag to allow symlinks used to be adding the following in your <Context> tag:

<Resources
  className="org.apache.naming.resources.FileDirContext"
  allowLinking="true" caseSensitive="true" />

And with 5.0.16, this doesn't work. Adding allowLinking="true" on your <Context> does allow symlinks, and should have been this way the whole time IMO. I also got a good ol' OutOfMemory error and I have a sneak suspicion it's not Roller (though Roller does though an exception when I do Weblog → Edit:

ERROR 2003-12-04 15:54:07,948 | HibernateStrategy:query | During QUERY
net.sf.hibernate.QueryException: could not resolve property type: weblogEntryId [select p from p in
class org.roller.pojos.RefererData where p.weblogEntryId=? and not title is null and not excerpt is
null order by p.totalHits desc]

Maybe this has something to do with the fact that my referers are not getting cleaned out every night. Anyway, back to my sneaky suspicion of OOM errors. I have two domains hosted on this site - raible.net and raibledesigns.com. The first just redirects to my family blog, but that's not the point. What I'm seeing in Tomcat's logs is that it tries to load all apps for both domains - and it pukes on a few. Time to play around with server.xml and see if I can get raible.net to just load it's own context.

Solution Found: You have to configure 2 different appBase's for each host.

Posted in Java at Dec 04 2003, 03:09:01 PM MST Add a Comment

User-Mode Linux ~ should I switch my ISP?

This User-Mode Linux sounds like a great opportunity for hosting this site. I currently pay around $50/month to host this site, and there's two things that are frustrating:

  • I only get 5 GB of bandwidth, and I pay the same as my provider for any extra - I usually pay $30 extra per month for bandwidth.
  • I get a max of 20 connections per mysql instance. While this should be plenty, it does seem to cause this site to crash, and I'm not motivated enough to dig into Roller/Tomcat and figure out why.

I do have a cable internet connection, so I could host this site myself, but my upload speed is only 241 KB. For you folks that do use UML, does anyone have experience with running Java (i.e. Tomcat or Roller) and MySQL?

Posted in Java at Nov 23 2003, 09:22:02 PM MST 9 Comments

RE: Compressing and Caching in your webapps

Jayson Falkner writes about two Filters everyone should have in their webapps: one for compression (via gzip) and one for caching. I try to add a CompressionFilter to all the apps I write, but I don't have a CacheFilter. So my question is: should I add Jayson's CacheFilter to AppFuse or should I use OSCache? I haven't got to Dave's chapter yet on performance and caching (in JSP 2.0), so I haven't read his opinion - what's your opinion? I like Jayson's solution because I can add 3 new classses with no additional JARs - AppFuse already has 21 jars (Struts, Hibernate, JSTL + a few other taglibs).

Posted in Java at Nov 21 2003, 11:57:41 AM MST 4 Comments

Setting up my Fedora box with Out-of-the-Box

Rather than spending hours trying to recover my Red Hat 9 disk, I built a new disk/box with Fedora. For all I know, the RH 9 one is still recoverable, but I'm an upgrade junkie so I couldn't help myself. Setting up DHCP with Dynamic DNS was a bit of a pain, even when I followed this howto. I believe I ended up re-installing bind and everything worked (this was a 2 a.m. last night, so my memory is a big foggy).

The only thing I haven't been able to get running (so far) is my USB Printer, details on hpoj mailing list. It was easy to setup my OfficeJet G85 on RH 9.

As for setting up my dev environment, it was a breeze using Out-of-the-Box. However, out of the box the installer didn't work. I had to install "gd-devel" (a dependency of viewcvs) and then everything installed just fine. Hat tip to Eric Weidner (of EJB Solutions) for the tip. I was able to select the applications I wanted and get all of the following installed and running: MySQL, PostgreSQL, Apache, Tomcat, mod_jk2 (to connect apache and tomcat), Roller, Scarab, CVS, Java, Ant and ViewCVS. I'm sure I installed more, but these are the mains ones I was looking for.

While the installer for OBox takes a while to run (on 1.5 GB RAM with 1.5 GHz = 30 minutes), the beauty of OBox is that it configures everything for you and starts all the services. The one thing that is disappointing (or maybe it's good) is that it didn't setup any environment variables - no $CATALINA_HOME, $ANT_HOME, etc. No biggie, I can set those up myself.

I might just have to burn a CD of OBox for future clients. It'd be nice to show up with my development environment on CD and ready to go. One bug I did find was that the mod_jk2 install configures mappings for all the struts example apps (which I didn't install).

Posted in Java at Nov 21 2003, 12:55:55 AM MST Add a Comment