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 "<a href=". 3,022 entries found.

You can also try this same search on Google.

Making your tables more accessible?

A question was asked on the display tag user list recently. Basically, the user wanted to add onmouseover and onmouseout events to the <tr>'s in a display-tag rendered table. Today, I decided to whip up a quick example of how to do this in a DOM-compliant browser. Just add an "id" attribute to your table, or use document.getElementsByTagName("table") (selecting the appropriate table in the array), and then put the following JavaScript block below your table. Of course, you must define a "tr.over" class in your CSS.

<script type="text/javascript">
    var table = document.getElementById("testTable");
    var rows = table.getElementsByTagName("tr");
    for (i=0; i < rows.length; i++) {
        rows[i].onmouseover = function() { this.className='over' };
        rows[i].onmouseout = function() { this.className='' };
    }
</script>

Now for an example:

       
       
       
       
       
       

Later: You can take this one step further and add an "onclick" event so that the user can edit the record the row is referring to. Let's pretend you have a link in the first <td> of the table. Inside this link is the recordId for that row. Adding an onclick to the row makes it easy to route the user to the details page for the record.

rows[i].onclick = function() {
    var cell = this.getElementsByTagName("td")[0];
    var link = cell.firstChild;
    var id = link.firstChild.nodeValue;
    location.href='URL to details page?recordId='+id;
    this.style.cursor="wait";
}

Posted in The Web at Apr 22 2003, 04:55:25 PM MDT 25 Comments

An iPod in my future?

iPod I'm thinking about getting an iPod. I've been using a walkman tuned to the FM stations in Denver for my ride to/from work, but it's not cutting it anymore. So the question is "Which one?" There's a Windows version and a Mac version, and supposedly the iPod is configured to only work with one machine? My Windows machine has all my music on it, and my music-downloading software, so the Windows version is probably the best candidate. Another reason for the Windows version is that my Win box never moves - it's always at home.

5 gigs or 10? I only have around 500 songs - so 5 gigs is probably a good size. With 27 gigs free on my OS X hard drive, I don't really need more space. What I'm really asking here is: Send me links of good software for the iPod. I've heard rumors that there's stuff out there that'll allow you to use it on more than one machine. Feel free to remain anonymous, or use my contact page to send me an e-mail if you don't want to comment.

Posted in Mac OS X at Apr 22 2003, 11:25:28 AM MDT 5 Comments

Roller Bugs?

I'm encountering the following bugs with Roller's 0.9.7.1 - once I make sure I can reproduce them with the latest build, and the "x2" theme, I'll enter them as bugs (then hopefully fix them).

  • News items - newsfeed.vm has some issues and won't render newsfeeds correctly. I seem to be the only one using these, but I believe a fix is still in order. This is only a bug with the new velocimacros. I had it working yesterday, and then Dave updated weblog.vm and website.vm, and now it's broken again. I reverted my newsfeeds back to the old $macros.showAllNewsfeeds.
  • Linkback - I can get linkback to work, but I can't get it to display after each day - it only shows up at the bottom of all my entries. It might be an HTML issues - I'll have to validate this site as XHTML and do a bit of cleanup to confirm this is actually a bug.
  • Joe Hewitt comments - I have the display working, but posting doesn't. Actually, the post works, but the redisplay doesn't. I'll have to post a few comments on Joe's blog to verify that his comments system works like I expect it to. Maybe I should check-in what I have working and someone else can hack around with it?

I doubt I'll get to verifying/fixing these for a few days. Today is our 3 year anniversary, tomorrow will be another ride-home-day/late arrival (last night I got home at 8:00) and Thursday night I'm going to the Jimmy Buffett concert. As for today being our anniversary - it's been an awesome 5 years since I met Julie - getting married to her was the best decision I ever made, and having Abbie was the best decision we ever made. Life just keeps getting better, what luck!

Posted in Roller at Apr 22 2003, 07:13:27 AM MDT Add a Comment

Locking Records in Webapps

Our tester, Roberto, started working at my day job today. This means that I've been hacking and interacting with Bugzilla all day. It's great to have someone to validate our code meets the requirements (BTW, all our requirements are kept in Bugzilla - how's that for dynamic requirements?!) So, as far as satisfying my desire to be a productive American, today has been a good day. After I ride home (~20 miles) tonight, I'll feel on top of the world. Anyway, back to the point of this post.

One of the bugs that Roberto entered was that a user could login using two separate browser sessions (same user), and blah, blah, blah. I'm sure anyone who's worked with webapps has seen this. You open a page up in both browsers, click "Save" in the first, and then "Save" in the second. The second browser overwrites the first one's changes. I've seen this bug many times, but I've never solved it, nor even tried.

I'm curious to know if any of you have solved this? I think Hibernate has a way of locking an object - but will that solve this issue? I'm willing to implement a quick solution, otherwise, I'll argue the bugs validity until I'm blue in the face. Hmmm, I wonder if I can simply use Struts' Tokens feature to solve this problem? Please hook me up if you've solved this problem in your webapps.

Posted in Java at Apr 21 2003, 05:07:24 PM MDT 4 Comments

[ANNOUNCE] Hibernate 2.0rc1

Powered By HIBERNATE Hibernate2 is now functionally complete! Get it at the usual place. The release notes are below.

Hibernate Changelog
===================
Changes in version 2.0 beta 5 (21.4.2003)
-----------------------------------------
* Informix support (Steve Molitor)
* fixed a bug parsing "select new ... " queries
* deprecated "object" type in favor of  mappings
* added Session.contains()
* added extra DBCP config options (?)
* SessionFactory.close() now unbinds from JNDI
* added Session.evict()
* got rid of an unnecessary SQL DELETE issued when an empty collection was dereferenced
* where attribute of collection mappings no longer ignored for deletion
* improved logging
* support polymorphic associations to "embedded" composite id classes
* various bugfixes to collection filter parameter binding
* fixed some problems with proxies introduced in earlier beta versions
* fixed bug with self-reference in the case of identity column id generation
* added hibernate.cglib.use_reflection_optimizer property
* added nonstrict-read-write cache
* fixed an SQL-generation bug in new Criteria API
* added CompositeUserType
* sequence and table id generators now aware of default-schema
* added update and insert attributes to  element
* fixed a bug with expressions like elements(foo.bar.baz) in where clause
* more efficient Set initialization (two-phase load)
* removed support for hibernate.query.imports and added  mapping element
* fixed problem in DBCP connection validation and added new config properties

I'm proud to say that this blog is now Powered By Hibernate (thanks to Dave of course)!

Posted in Java at Apr 21 2003, 05:51:32 AM MDT Add a Comment

Cool idea - highlight entries by category with CSS

This sounds like a cool idea - and should be easy to get working with Roller. However, I'm stumped on making this work. Hopefully someone can help me out with the following macro:

#foreach( $entry in $entries )
#if ($entry.getCategory().startsWith("Java"))
<div style="border-left: 2px solid red">
#else
<div style="border-left: 2px solid blue">
#end

Once I get this working, making my category menu use the same colors will be a great way to indicate which categories I've posted to.

Posted in Roller at Apr 20 2003, 05:45:03 PM MDT 1 Comment

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

No Dice on Comments

I tried Dave's suggestion for comments, but no dice. Here's what I have:

   #set( $comments = $entry.comments )
   <comments>
   #foreach( $comment in $comments )
   <comment id="$comment.id">
      <author>$comment.name</author> 
      <email />
      <url />
      <timestamp>$comment.postTime</timestamp>
      <body>
         $comment.content
      </body>
   </comment>
   #end
   </comments>

It looks like this Velocity template expects to be a part of something great that exposes the $entry variable. Is it possible to simply pass in an entryid and have the XML generated for that. That's what I really want.

BTW, isn't it lovely how it tries to process the template above? Doesn't seem to for Dave - oh well.

Posted in Roller at Apr 18 2003, 02:43:21 PM MDT 2 Comments

Cool Java Certification Site

Are you thinking about getting your Java Programmer 1.4 Certification? I am. I found JavaCertificate.com today via java.blogs. Definitely looks like a great resource for strudying. I don't know when I'll do it - probably when I get a few days to cram. I took the beta without studying and almost passed, so the "real thing" shouldn't be too bad.

Posted in Java at Apr 17 2003, 04:10:48 PM MDT 1 Comment

What's coming in XHTML 2.0

Mark Pilgrim has written an excellent introductory tutorial -- the first of several to come -- that is ostensibly about elements dropped from XHTML 2 (and what replaces them). But the piece works equally well as a general primer on how to make the transition from old-school presentational markup to modern, structural stuff. We've bookmarked this piece and look forward to reading next month's follow-up. [Zeldman]

From the article...

There are several key elements and attributes that are slated to be dropped from XHTML 2.

  1. <br /> has been dropped, replaced by <l>...</l>.
  2. The inline style attribute has been dropped, but there are still plenty of ways to define styles.
  3. <img /> has been dropped, replaced by <object>...</object>. As we'll see in next month's article, this may present some serious migration difficulties.
  4. HTML forms have been dropped, replaced by XForms. This is such a major change that it also deserves its own article.

Posted in The Web at Apr 17 2003, 02:57:54 PM MDT Add a Comment