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 "young russian teenboy model pre teen". 788 entries found.

You can also try this same search on Google.

Macromedia Flex 1.0 Released

Macromedia has released Flex 1.0. Flex is basically a server plugin that allows you to write XML to render flash. Here's the marketing lingo from their product page:

Flex is a presentation server installed on top of a J2EE application server or servlet container, a rich library of user interface components, an XML-based markup language used to declaratively lay out these components, and an object-oriented programming language which handles user interactions with the application. The result is a Rich Internet Application rendered using Flash Player and developed using industry standards and a development paradigm familiar to developers.

The major problem with Flex is its price.

Flex presentation server pricing starts at $12,000 for two CPUs and includes annual maintenance.

Macromedia's take on this seems to be "its an evolutionary step in web application design and development" - so $12K is a small drop in the bucket. Sun claims the same for JSF, but you don't see a hefty price tag on that sucker. What Macromedia doesn't seem to realize is that its important to market to developers. If you can inspire the developers to love your product - it's only natural that it will gain more traction. With a price of 12K and no free trial (CD by mail) - good luck on getting developer support.

Of course, as an independent consultant, I probably have a scewed perspective. Maybe the corporate drones like getting their development platform and tools shoved down their throat.

Posted in Java at Mar 29 2004, 07:36:10 AM MST 9 Comments

Carpal Tunnel

When I finished hacking away on Roller this past Saturday, my fingers hurt from typing so much. Who knows why, I didn't add that much code. Must've been all the keystrokes to run Ant, start Tomcat, and test stuff. Yeah, we need more tests - but those won't help tweak CSS. Yesterday, all I did was review Hibernate in Action, so no coding, but a fair amount of typing. By the time I went on a bike ride yesterday afternoon - my left hand's left-most fingers were curled up naturally and my forearm was aching. Carpal Tunnel has set in quite nicely in my left forearm. I can still type, as evidenced by this post - but it definitely hurts and it seems like I could do some serious damage if I keep it up.

Herein lies the problem. I took this week off from my regular gig to concentrate on the Spring book. So I need to be typing like a madman all week - but my body is not cooperating. Rather, it's trying to tell me something - "you're not cut out for this this much coding/typing." So what should I do? I've had these same symptoms before - and when I did, I got a massage and took a couple of days off. That's a bit difficult this week with my livelihood depending on a pain-free left arm/wrist/fingers. I've booked a 10:00 massage - let's hope that gets me through the week. I definitely need a longer-term solution though. It'd be nice to write this book w/o typing, just talking.

Related: Carpal Tunnel in March 2006.

Posted in General at Mar 22 2004, 08:22:23 AM MST 13 Comments

A Day with Roller

I put a whole sh*tload of hours into Roller today - around 14 to be precise! My main goals where to get password encryption enabled and Remember Me re-implemented as a more secure feature. I managed to accomplish both and did so much typing in the process that my fingers hurt.

Other things I managed to accomplish:

  • Added ability to put a period (.) in a page name. Also modified BasePageServlet to set contentType appropriately for those "pages" ending in .xml, .js and .css. This should allow pages to be created for CSS and JavaScript, and then included in your pages with <link> and <script>.
  • Moved Calendar in Weblog editor to top right (was at bottom left) - making it easier to view and navigate to different days.
  • Fixed comments and spam stuff that Lance added.
  • Fixed pop-up Calendar on Weblog Edit screen to be properly positioned in IE and Mozilla.
  • Added up and down arrow buttons to allow expanding and contracting (taller and shorter) of weblog textarea. Persisted user's preference with a cookie.
  • Various UI enhancements to make the Editor UI look good in both IE and Mozilla (on Windows XP).

Phew - I'm ready for a beer! You can checkout our demo instance if you'd like to try out the latest code.

Posted in Roller at Mar 20 2004, 10:14:00 PM MST 24 Comments

One Year Ago - Wrox goes under

Pro JSP, Third EditionI was on vacation at my sister's when I found out. I'd just finished the final edits on my chapters and it was time to party. But then, one year ago today, I read (via weblogs) that Wrox was going under. Today, it's nice to look back and see that Pro JSP did get published.

You'd think after 6 months, we'd start to see some royalties. Nope. Nothing. Maybe it's not selling enough copies for the authors to get our $5/year cut. ;-)

Posted in Java at Mar 15 2004, 11:10:00 AM MST 10 Comments

2006 Dodge Charger, Dukes and VW Buses

2006 Charger Heard on the radio this morning: Dodge is bringing back the Dodge Charger in 2006. Remember the General Lee from the Dukes of Hazzard? That's a Charger and here are pictures of the 2006 (or at least the concept car). "The Dukes" was one of my favorite TV shows growing up.

Since I grew up without electricity (hence, no TV), people often ask me if I've seen certain shows. I had friends, I watched TV at their houses. Also, my grandparents (who lived 10 miles down the road) had a TV. Night Rider and Dukes of Hazzard were shows that I went out of my way to see. However, there are shows like Gilligan's Island that I've never seen.

I won't be buying a new Charger, but I do plan on restoring an old VW Bus in the near future. I restored a couple of bugs in high school and college and I really enjoyed it. Right now, I'm looking for a late '50s or early '60s 23-window bus. I plan on dropping in a Porsche 911 or 914 engine, wrapping it with some Porsche wheels, and generally enjoying the whole process. It'll probably take me 2-3 years to complete the project - but I definitely need a new hobby. Being on the computer so much just isn't healthy. Besides, kids can participate in a car restoration. Hopefully I'll be able to post pictures like this in a few years.

Posted in General at Mar 12 2004, 06:24:12 AM MST 18 Comments

Velocity Templates in RTF

For most of this week, I've been developing Velocity templates for rendering resumes in HTML and RTF (Word). Thanks for Mathias once again for showing me this was possible. The HTML part has been pretty easy, but the RTF stuff has been a bear. Mostly because I want to hide/show different sections of a person's resume based on whether they've entered information or not. In order to do this, I first created a rough draft of the RTF template in Word and then I began hand editing it with a text editor (HomeSite and BBEdit). And if you look at the RTF syntax, it's pretty damn ugly. The main thing I'm struggling with now is showing hiding rows of a table based on whether data exists or now. In HTML - it's easy - you just put your #if statement before a <tr> and you can easily hide the row. In RTF - it seems like the number of rows/columns/borders, etc. is all defined at the beginning of the table - but I can't really read the syntax well enough to understand it.

Therefore, my question is - does anyone know RTF well enough to tell me how I can hide a row? Is there something in the beginning of the table definition I can modify with Velocity #if statements? For now, I'm simply putting "Not Specified" text in rows where no data exists.

Finally, how about some RTF syntax I've learned in this process:

{\f116\fs20 = Verdana 10pt Font
The document must end with " }}" (no quotes) on the same line as the last bit of text
Escape "\n" with "\\par "
{\b\f116\fs24\cf17 = Bold, Verdana, 12pt, Ocean colored Font

How's that for a bunch of useless information! ;-)

Posted in Java at Mar 11 2004, 10:51:18 AM MST 4 Comments

Replacing line breaks with HTML breaks in Velocity

Roller currently has an issue where line breaks in comments are not auto-converted to <br>'s. This problem only exists in the in-page comments and the twisty comments you see on this site. Today, I might've figured out the solution. It turns out that using Jakarta Common's StrutsUtils to replace new lines with <br>'s doesn't work:

#set($comments = $stringUtils.replace($comments, "\n", "<br />"))

However, using the String.replaceAll(new, old) in JDK 1.4 does work:

#set($comments = $comments.replaceAll("\n", "<br />"))

I figured this out on my current project and haven't tested it on Roller. Since I didn't find anything on this via Google - I though y'all might be interested.

Posted in Java at Mar 10 2004, 03:58:26 PM MST 6 Comments

[DisplayTag] Changing a row's CSS class based on values in the row.

One request I've seen on the displaytag-user list a few times is the ability to change a <tr>'s CSS class based on a certain value. While the displaytag doesn't have this feature out-of-the-box, it is possible (and fairly easy) to do. All you need to do is sprinkle a little JavaScript into the mix. Basically, the displaytag will render a well-formed HTML table - like the following:

Username First Name Last Name
mraible Matt Raible
tomcat Tomcat User

By adding an "id" attribute to your table (i.e. id="user"), your table will get an "id" attribute and now you can easily access it via the DOM. The following JavaScript will grab the table and search the first column for a value of 'mraible' - and if found, it will change the row's background color to red.

<script type="text/javascript">
<!--
    var table = document.getElementById("user");    
    var tbody = table.getElementsByTagName("tbody")[0];
    var rows = tbody.getElementsByTagName("tr");
    // add event handlers so rows light up and are clickable
    for (i=0; i < rows.length; i++) {
        var value = rows[i].getElementsByTagName("td")[0].firstChild.nodeValue;
        if (value == 'mraible') {
            rows[i].style.backgroundColor = "red";
        }
    }
//-->
</script>

You could easily change rows[i].style... to rows[i].className = if you want to assign a new CSS class. Now let's see it in action (and see if your browser supports it). This has only been tested in Safari and Mozilla on OS X.

Username First Name Last Name
mraible Matt Raible
tomcat Tomcat User

Other displaytag tips: Static Headers HowTo and Highlight and allow clicking of rows. The 2nd tip (highlighting) is available in AppFuse, in the userList.jsp page.

BTW, I also added support for the DisplayTag to render the results from JSTL's SQL Tag. I haven't committed it yet - I'm still waiting for more feedback.

Posted in Java at Mar 08 2004, 01:22:34 PM MST 10 Comments

BeanUtils.copyProperties() with Dollar amounts and Dates

A frequent issue that crops up when using Struts is how to transfer data from ActionForms to DTOs or POJOs and vise-versa. In other words, how do you get the data from your true model into Struts' Model? There are a few solutions out there, including the ActionForm-Value Object Mapper and BeanUtils.copyProperties. I've used both and (IMO) the only advantage of using BeanUtils is that Struts uses it internally and it's a bit easier to work with.

The reason I'm writing this post is to show you how to handle Dates and Doubles in your POJOs. The first step is easy - you simply need to register converters for Date and Doubles. The easiest way to do this (that I know of) is to add a static block to one of your classes. I do this in BaseManager, but it could be easily done in a BaseForm class.

    static {
        ConvertUtils.register(new CurrencyConverter(), Double.class);
        ConvertUtils.register(new DateConverter(), Date.class);

        if (log.isDebugEnabled()) {
            log.debug("Converters registered...");
        }
    }

When I use Doubles, it tends to be for dollar amounts displayed in a JSP page. Therefore, I call it a CurrencyConverter (source), and I use a DateConverter (source) for dates.

After registering these converters, the next step is to throw a little validation into the mix so that the String values (from the Form) are in an expected format. Since I'm using XDoclet to generate my Forms, it's as easy as adding a couple of tags to my POJO. Here is an example for validation Dates:

    /**
     @return Returns the startDate.
     * @struts.validator type="required"
     * @struts.validator type="date"
     * @struts.validator-var name="datePatternStrict" value="MM/dd/yyyy"
     * @hibernate.property column="start_date" not-null="true"
     */
    public Date getStartDate() {
        return startDate;
    }

And one for validating dollar amounts:

    /**
     @return Returns the startingSalary.
     * @struts.validator type="required"
     * @struts.validator type="mask" msgkey="errors.currency"
     * @struts.validator-var name="mask" value="${currency}"
     * @hibernate.property column="salary_start" not-null="true"
     */
    public Double getStartingSalary() {
        return startingSalary;
    }

For the currency validation to work, you have to add a few things to your Struts project. The first is the errors.currency to your ApplicationResources.properties file:

errors.currency=The '{0}' field should be a dollar amount.

The 2nd piece you'll need to add is the currency mask as a constant in your validation.xml file (or metadata/web/validation-global.xml if you're using XDoclet/AppFuse):

<constant>
    <constant-name>currency</constant-name>
    <constant-value>^\d{1,3}(,?\d{1,3})*\.?(\d{1,2})?$</constant-value>
</constant>

I'm not much of a regular expression expert, but I think this mask is specific to US Dollar amounts. I'd love to see a i18n version, but I haven't had a need for one (yet) - so it's not a big deal for me. The last thing you'll need to do is add a little JSTL lovin' to render your dollar amounts with the proper number of decimal places:

<fmt:formatNumber type="number" minFractionDigits="0"
    maxFractionDigits="2" value="${myForm.startingSalary}"/>

It seems that most web frameworks are getting away from a separate web model (ActionForms) and allowing you to use your POJOs in your view. This is likely to be a bit cleaner, but I'm sure they still have to use some sort of converter to get Dates/Doubles from your UI into your POJOs. The nice thing I've seen in other frameworks is that they have Date Converters built in. Why doesn't Struts? Who knows, but IMO it should be a built-in component.

Both of the Converters described in this article can be found in AppFuse.

Posted in Java at Mar 08 2004, 07:00:08 AM MST 1 Comment

[ANN] Anthill 1.7.0 Released!

I've been using Anthill for about a year now, and I think it's a kick-ass product. I don't really have any issues with the current version, but it's nice that there's a new release. If you're interested, you can view the release notes.

Posted in Java at Mar 02 2004, 09:52:51 AM MST 2 Comments