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 "form". 326 entries found.

You can also try this same search on Google.

Upgrading to Roller 0.9.7

I'm starting the upgrade to Roller 0.9.7. Don't stand by with too much earnest - if I get interrupted by Julie and Abbie - they have priority. I'll let you know when I'm done.

Later: I might as well keep a record of what I do to upgrade so it'll be easier next time - and maybe I'll eventually write a script to do it all.

1. I dumped the mysql database from this site using mysqldump. I then created a database locally and imported it.

2. I ran the 0.9.6 to 0.9.7 upgrade script for mysql. I encountered a few errors as I was partially on 0.9.7 already.

3. I edited the log4j.properties file to e-mail me errors and to cut down on Velocity and Hibernate logging. I also got rid of the "R" appender, as that was writing a roller.log file that is essentially the same as Tomcat's log file. I also added timestamping to the log messages.

# Properties for configuring Log4j for this application
# This is the configuring for logging displayed in the Application Server
log4j.rootCategory=INFO, stdout, mail

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %C{1}.%M(%L) | %m%n

# Configuration for receiving e-mails when ERROR messages occur.
log4j.appender.mail=org.apache.log4j.net.SMTPAppender
[email protected]
[email protected]
log4j.appender.mail.SMTPHost=localhost
log4j.appender.mail.Threshold=ERROR
log4j.appender.mail.BufferSize=1
log4j.appender.mail.Subject=[www] Roller Application Error

log4j.appender.mail.layout=org.apache.log4j.PatternLayout
log4j.appender.mail.layout.ConversionPattern=%d [%t] %c %x - %m%n

# If programmed properly the most messages would be at DEBUG 
# and the least at FATAL.

# Options are: DEBUG, INFO, WARN, ERROR, FATAL
log4j.logger.org.roller=ERROR
log4j.logger.org.apache.velocity=ERROR
log4j.logger.org.apache.commons=ERROR
log4j.logger.org.apache.struts=ERROR

# All hibernate log output of "info" level or higher goes to stdout.
# For more verbose logging, change the "info" to "debug" on the last line.
log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=ERROR
log4j.logger.net.sf.hibernate=ERROR

4. Whoa! There's a new look to the index.jsp page. I corrected a small bug in the link around the combined rss badge.

5. I changed oscache.properties to have a "cache.path" that was prudent for my installation.

6. Added home.jsp and changed "main" forward in struts-config.xml to have a path="/home.jsp" so users will be directed to this page, rather than the index.jsp.

7. Onto synchronizing my current web.xml with the new one. Added <welcome-file-list>, <error-page>'s and security settings for my private weblog. Sweet, JSTL has been added so I don't have to add these taglibs or jars. I changed the <form-error-page> to "/login.jsp?error=true". Funny thing is, I never see the login page anymore since I'm using the "Remember Me" feature.

8. Added all custom images from my about page to the "images" directory. Also moved my custom favicon.ico from backed up directory to new roller installation directory.

9. Next, I synched up the settings from my roller-config.xml file with the new one. FYI, e-mailing comments is off by default.

10. Now I guess I need to convert all my pages to use the new macros. I'll do this after upgrading the codebase here. It's kindof a pain to upgrade the codebase, as you've already seen. One of my problems is I have symlinks all over the place in my "roller" directory, so rather than re-creating them, I just upload a .jar of roller, unzip it, and cp -r roller/* webapps/roller/. over my last installation. Crossing my fingers now.

After upgrading code: It looks like I changed the wrong forward, rather than "main", I should've changed "home.page" to home.jsp. I'll let you know if I spot anything crazy while attempting to do my macro migration.

Update: After the macro migration, the only issue I've found (so far) is that #showWebsiteTitle() adds spaces on both ends, and since I'm writing this using JavaScript (for the title image), it's screwing things up. I reverted back to $macros.showWebsiteTitle() and everything works as expected. Now I just have to figure out how to get trackback setup. I tried this, but it didn't work for me. Also, I can't seem to get #showAllNewsfeeds(true 1) to work.

Posted in Roller at Apr 20 2003, 11:10:26 AM MDT 3 Comments

A Good Job vs. Good Pay

I did the interview with the University of Miami this morning. I was interviewed by a roundtable of folks and the questions weren't too bad - there were some fun ones and some technical ones (i.e. the classic, "what's the difference b/w an interface and an abstract class"). The people sounded very cool and it'd probably be a great team to work on. The pay, however, is not very good at all. However, they said they'd try to work on that. The itneresting thing I've learned is that the best paying jobs are usually the worst jobs. At least that's how it's been for me. I don't know if people just expect more from you, and portray this in the form of micro-management or what, but it sucks to have a job you don't like.

My current job? I love it. Not only because we're using all the cool technologies I like (Ant, Struts, Hibernate, XDoclet, etc.), but also because the people are very cool. Our 8:30 a.m. meetings are actually fun to attend. We poke fun at each other and there's lots of laughter in the room. Today has been an especially good day - I got club level seats to the Rockies Game (baseball) tonight, and also got invited to a pre-release viewing of Matrix Reloaded. Now those are what I call benefits! And, unfortunately, I'm also making the same rate I made six months after I graduated from college. Back then, I couldn't believe how much I was making, and now it's enough to support Julie, Abbie and I (and I'm the only one who works), so it's not too bad.

The problem is the gig at U of M pays around 1/2 of what I'm making now. It'd be an awesome job though. It sounds like they have great people and I'm sure the perks are good (maybe free tuition for my masters?). Look at me talking like I already got the job - I probably just jinxed myself - especially since I gave them the URL to this site. Oh well, if you guys are reading - it sounds like an awesome position, but I don't know if I can support my family on that salary. In fact, I've had such little luck finding a decent paying job in Florida, Julie has started considering a non-move. That is, we might stay in Denver. Jobs here seem to be picking up, and my current contract doesn't seem to have any end in site. They're even talking about putting us on a project developing mobile apps in Java.

Miami is calling though, especially on this cold April afternoon. Now I'm off to freeze my ass off at the Rockies' game. Good thing they're club level seats so we can just sit inside if it's too cold.

Posted in General at Apr 18 2003, 04:35:00 PM MDT 2 Comments

MailTo: Links

I created a mailto: link today for our app at work. I used this page and Hiveware's Enkoder Form to hide the e-mail address from spammers. I even added a little browser information - since clicking on the link will send an e-mail to the help desk. Pretty cool - view source to see how I made the link below work.



Posted in The Web at Apr 16 2003, 01:05:01 PM MDT Add a Comment

Blogging motivated by Broadband?

It is my personal little theory that most bloggers have high-bandwidth internet connections. I am seriously de-motivated from surfing and blogging on a dial-up connection. Even worse, our dial-up connection has been on the fritz, and with no connection - I don't even try. I don't even care to read anyone's blogs and I'm starting to wonder if blogging is all that it's cracked up to be. java.blogs is not even interesting to me anymore. I've got to get my internet connection fixed! I'm talking like a crazy man! ;-)

The good news is our ISP called Julie this morning and we're scheduled for an upgrade on the 14th. They also (finally) admitted that there have been sporadic internet connection issues in our area. They've been so damn arrogant this whole time that it "wasn't their problem" - it's nice to see them admit fault. My mom is in town all week at a conference and my dad is flying in on Wednesday, so I'd expect a pretty light week of blogging until next Monday (the 14th).

Posted in Roller at Apr 07 2003, 11:25:33 AM MDT 1 Comment

[ANNOUNCE] Struts Resume and AppFuse 0.7 Released!

There's nothing like tootin' your own horn. What's even worse is checking all this stuff into CVS and then uploading it on a dial-up connection. Anyway, here it is - the latest and greatest version of struts-resume and (finally) a version of appfuse. AppFuse is basically struts-resume w/o any resume stuff. There's not much new that's visible for struts-resume, the only real things are User Administration (no add, just list/delete/assign roles) and a smart-menu that stays expanded based on your previous selections. Here is a full list of what's new in 0.7 (both apps):

Features in 0.7
===============
- Upgraded to Hibernate 2.0 Beta 4.
- Upgraded to Struts 1.1 nightly build (2003.03.26) to fix Validator issue.
(http://tinyurl.com/87xa)
- Upgraded DBUnit to 1.6-dev to fix batchStatement error in Ant task.
(http://tinyurl.com/8ei2)
- Upgraded Canoo WebTest from build265 to build276.
- Upgraded XDoclet to nightly build (2003.03.28) for Hibernate 2.0
compatibility. Apache module is still customized for POJO -> ActionForms.
- Upgraded Display Tag Library to version 0.8.5.
- Renamed "test-canoo" task to "test-jsp".
- Added "db-load" as a dependency to running unit tests to get a fresh
database each time.
- In LoginServlet.java and BreadCrumbFilter.java, pre-pended contextPath
to authURL (i.e. "j_security_check") to get absolute path.
- Added User Administrator to list/edit/delete users. This feature
includes using indexedProperties on a form - still using XDoclet, but using
a subclass of UserForm, called UserFormEx to hold the getter/setters for
the indexedProperties.
- Wrote more Cactus and Canoo Tests to verify Resume editing and User
Administration functioned properly.
- Added icons to success and error messages template (common/messages.jsp).
- Implemented role-based Permissions on menu by adding
permissions="rolesAdapter" to in menu.jsp.

I've put a line through the renaming of "test-canoo" to "test-jsp" because it's in the README (part of the download) and I don't want to re-upload just because of one stinkin' line.

Tomorrow, I'm actually presenting for the Struts Training class, so I won't be able to give a full review. One of the gents who wrote Stxx will be presenting first at 8:30 MST, and then I'm up for my preso. I'm going to do some short and sweet stuff on Remember Me and XDoclet with Struts. If you're interested, you can do the labs I put together. I'll post the slides when I'm done presenting.

Posted in Java at Apr 04 2003, 11:56:25 PM MST 3 Comments

WebWork Tutorial makes it look easy

I have to admit that this webwork tutorial makes WebWork look easy. In comparing this to Struts, it seems as if the Form and Action are the same thing. I wonder if I could use BeanUtils.copyProperties(wwAction, POJO) like I am with Hibernate/Struts currently.

The funny thing is that XDoclet has made it so easy (IMO) that I don't write ActionForm's anymore. All I really write is Actions, JSPs, DAOs and Services (a.k.a. Managers). So, with my current architecture I'm using, it actually looks like more work to use WebWork's Actions than Struts Actions. Especially since I have to write my validation in my Action. The XDoclet/Validator combo makes this super simple with Struts (and would with WW if they'd adopt it ;-). The only time I've been writing forms lately is when I have a form with indexed properties. Then I create a childForm that extends the generated form and has the appropriate accessors/mutators for the indexed properties.

The one thing the article does bring to light is how much cleaner Velocity is. JSP 2.0 will make JSP's a lot easier, but Velocity looks like it's already there. The one thing that worries me about using Velocity is that, according to their homepage, they haven't had a release in 8 months and their last release was a Release Candidate. What the?! Seems like someone might be dropping the ball on that project.

Posted in Java at Mar 30 2003, 11:26:58 AM MST 6 Comments

Struts Training: Week 4

I missed last week (Week 4, PosgreSQL), but I'm back this week - ready to report. I'm presenting next week on "remember-me" and XDoclet, so I'm working frantically trying to get AppFuse up-to-snuff to use as a lab template. Hopefully, I'll have that done by tomorrow night, as well as the lab and presentation.

Today's presentation is from James Turner on Indexed Properties and Validation. Awesome - I need this in my day job's project starting next week! Good timing, eh?!

So how do you use indexed properties in Forms? Two ways: Simple arrays of strings and arrays of beans (recommended). Here's a good tip - if you're using DynaActionForms, you can access a property in JSTL using {form.map.propertyName}. I did not know that - thanks James! Lots of good stuff in this one (too much to write down), I hope this preso is available online and a demo app goes with it. To validate simple array of strings, add indexedlistProperty to your <field> in validation.xml (you must also specify the property). If you're validating beans, use property="propertyName" and indexedListProperty="beanName".

However, do you really want to require all fields of your child beans? No, probably not. You (most likely), just want to require fields if some fields are populated. Struts provides us with the requiredif validator. No JavaScript validation exists for requiredif at this time. Hmmm, I wonder if XDoclet can generate indexed validation rules. Here's an example of how to do this with the current 1.1 RC1 Release.

<form name="myForm">
  <field property="lastName" indexedListProperty="person" 
    depends="">
    <arg0 key="label.lastName"/>
  </field>
  <field property="firstName" indexedListProperty="person" 
    depends="requiredif">
    <arg0 key="label.firstName"/>
    <var>
      <var-name>field[0]</var-name>
      <var-value>lastName</var-value>
    </var>
    <var>
      <var-name>fieldIndexed[0]</var-name>
      <var-value>true</var-value>
    </var>
    <var>
      <var-name>fieldTest[0]</var-name>
      <var-value>NOTNULL</var-value>
    </var>
  </field>
  ...
</form>

Note that the [0] is NOT an indicator of which indexed property to validate. RequiredIf is powerful but ugly, so James wrote something better. Unfortunately, it's too late for 1.1 and will be added for the 1.2 release. Sounds like most folks that use the Validator will be using a nightly build for awhile ;-). The new validator is called "validwhen," and looks as follows:

<field property="firstName"
  indexedListProperty="dependents"
  depends="validwhen">
  <arg0 key="dependentListForm.firstName.label"/>
  <var>
    <var-name>test</var-name>
    <var-value>((dependents[].lastName == null) or
                (dependents[].firstName != null))
    </var-value>
  </var>
</field>

Fricken sweet! James is sending me the code - cool! This will make my life soooooo much easier next week. Status of Struts 1.1 from James: they're working on getting the commons packages to a release state. Slides from today will be available at strutskickstart.com later this afternoon.

Posted in Java at Mar 29 2003, 09:32:28 AM MST 4 Comments

Struts Upgrade: 1.1 RC1 to Nightly Build (20030326)

I decided to upgrade from Struts 1.1 RC1 to a nightly build this morning, hoping to get the fix for the Validator bug that requires an Internet connection. I was also hoping to solve an issue I have where Eclipse thinks that ListUtils.sum(list1, list2) is deprecated (not so according to it's JavaDocs - Ant doesn't seem to think it's deprecated either... wierd). However, instead I was greeted with a couple of new deprecation errors that you might want to know about.

  • ConvertUtils.setDefaultLong(long) has been deprecated. Again, not according to its javadocs.
  • Action.MESSAGES_KEY deprecated in favor of Globals.MESSAGES_KEY

The good news is that the Validator bug is indeed fixed and I don't have to set my proxy host/port variables for Tomcat anymore.

Posted in Java at Mar 26 2003, 11:23:24 AM MST 3 Comments

Home, Next, Previous Bar in Opera, Mozilla

I discovered this one by accident today, but I think it's a pretty cool feature. This site (wonder if it's using gallery) has the following HTML in the <head> of its photo album pages.

<link rel="start" href="index.html" title="Home" />
<link rel="prev" href="index2.html" title="Back" />
<link rel="next" href="index4.html" title="Next" />

In Opera 7, an Opera-based bar magically appears at the top of the page, with the "Home", "Previous", and "Next" buttons enabled. Same thing on Mozilla, but only if you have the Site Navigation Bar enabled (View -> Show/Hide -> Site Navigation Bar). I also discovered that you can change the location/display of the Opera Navigation Bar at View -> Navigation Bar. I've verified that this does not work on the following browsers: IE/Win, Camino, Safari, Phoenix.

So what's the big deal - why are you writing about this? Because I think it gives a nice way to integrate workflow into a web application. You could probably put JavaScript in the "href" attribute's value to submit a form and guide a user to the next step in the process. Of course, you should still add appropriate buttons/links to your pages, but it's a nice UI for replicating choices for your users.

Posted in The Web at Mar 21 2003, 12:52:48 PM MST Add a Comment

Struts Training: Week 3

I just signed in for 3rd week here in Struts Training. I'm coming to you live from Chelan, WA. So on with what Ted has to say.

Ted's talking about persistence in Struts: Transaction Script vs. Domain Model.

Transaction Script - organizes business logic by procedure. Great choice for small applications with simple logic. For example, online auction, public search engine or an address book.

Domain Model - an object model of the domain. Has a rich variety of objects that incorporate both data and behavior. Ted mentions that the Domain Model is better for larger applications. For example, managing inventory for an online auction might require using the domain model.

What Ted is doing is using the Domain Model to separate Struts from his Actions - so that he passes around a DomainRequest, DomainResponse, and gets his form from a factory. To me, this looks like a good way to make your Struts layer a lot more complicated! ;-) At the same time, Ted is getting this information from Martin Fowler's Patterns (in Enterprise Architecture, ISBN 0321127420) book, so maybe I should move to the domain model. Naahh, I think I'll keep using the Transaction Script method - it's probably easier for folks to learn and would definitely be easier for rookies to maintain.

Onto Hibernate and how it works:

- POJO beans, encourages fine-grained
- Utilizes "persistence by descriptor"
- Provides DBA-friendly text queries
- Plays well with others
- Buffet-style implementation

IMO, if you're not using Hibernate, you should know why. If you're starting a new project, it's worth looking at. If you're using it, but not using XDoclet - you should be. XDoclet is the best way to avoid DD Hell (quoted from Erik Hatcher).

I didn't know that Hibernate supported a version - did you? Apparently you can specify that a property is a version and Hibernate will use it as you'd expect. Don't see that I have a need for that, but possibly. Would a struts-resume user ever want to keep old versions of their resume? I like to keep old versions of mine, but I have to admit, I never look at them again.

<version name="version" />

Ted just touched on how Hibernate can generate your database schema for you. This is a very powerful feature IMO - especially with struts-resume. It makes it nice for an example app. For instance, with struts-resume, you can run "ant setup-db" and it'll drop tables and re-create your db schema for you.

A student asks about the bottom-up approach - what if you already have a database. My advice? Try looking at Middlegen, its Hibernate Plugin in designed to create an XDoclet-enabled POJO from a database schema. There's also the Reverse Schema Generator that is included with Hibernate. I've used this one and it works great. I've never used Middlegen, but I should be considering that I tag the generated POJO up with XDoclet tags.

Interesting: Ted just mentioned that Gavin (Hibernate's Lead Developer) is working on a book for Manning. It is on Object Relational persistence and it uses Hibernate for its example apps. Erik Hatcher, at his preso on Wednesday, also mentioned that an XDoclet in Action book will be published soon by Manning. He even showed us the book's cover - so I'm assuming it will be published soon.

Hibernate's Fashionable Friends: XDoclet, Commons Logging, Commons DBCP, DynaBeans and Turbine Caching.

To learn more about this Hibernate, checkout:

· AgileData Website (Scott Ambler)
· Hibernate Homepage
· Struts Application Site (Hibernate example and Struts Resume both use Hibernate with Struts)

Vic still likes RowSets and SQL better. I'm guessing this is because he's a SQL expert. The nice thing about Hibernate is that it's query language (HQL) is very much like SQL and allows you to do complex joins. At least, to my knowledge, I've never done any fancy joins in the HQL, just in the mapping (*.hbm.xml) files.

Quote from Ted: This is the year of JUnit books. Watch for them this summer..

Now Ted is covering StrutsTestCase, a JUnit extension that hooks into Struts and Cactus. IMO, it's an awesome way to test Struts Actions - even easier than testing a servlet with Cactus.

Another book: JUnit in Action (Manning) by Vincent Massol and Ted. To be published this summer. Vincent is the lead developer on Cactus, so I expect this to be a great book. Right now, I wish I had written my first book for Manning rather than Wrox. :-(

The one bad part about today's session is that I had to use a calling card to dial in and at $0.35/minute, I'm up to about $25! I should probably sign off soon and save some cash...

Tapestry - are you using it? A student asks about it and Ted mentions that he views it as a presentation framework like Velocity. I've heard lots of good things about it, but have never used it. Ted admits that he uses Velocity and gave up on using JSPs a while ago.

Good stuff - thanks Ted, I'm signing off (the QA session is still in progress).

Posted in Java at Mar 15 2003, 08:37:28 AM MST 1 Comment