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 "css". 327 entries found.

You can also try this same search on Google.

Using DWR with Spring and Hibernate

For the past few weeks, I've been developing an application using Struts, Spring, Hibernate and the DWR project for my XmlHttpRequest framework. As you might remember, I used JSON-RPC for Ajax stuff on my last project. I found DWR to be much more full-featured and easier to use. This post is meant to capture some issues I encountered so others won't have to jump the hurdles that I did. For those of you that get bored quickly, here's a movie (QuickTime) of the app's Ajax features.

I've been using version 0.4 of DWR, and I haven't had a chance to try out version 0.5. When I first started using it, I ran into a ThreadDeath problem that was easily resolved by changing a log.debug message to System.out.println. I tried to reproduce this issue yesterday and couldn't, so who knows what that was all about. As far as configuring DWR in your webapp, that's pretty easy to do, and well documented. See the project's documentation or this Spring MVC HowTo.

Here are a few things I remember from my development experience.

  • The examples are great, especially how to dynamically edit a table.
  • When developing, make sure to set the "debug" init-param to "true". This allows you to go to http://location:8080/yourapp/dwr and see a screen that allows you to call methods on your exposed classes.
  • In WEB-INF/dwr.xml, you need to specify a converter for each POJO you want to expose to your UI via JavaScript. I started out by converting a whole package, but found this to be *extremely* slow (we have a package of around 50 DTOs). So I changed it to be only the DTOs I was using. This turned out to take about 30 seconds to do the conversion, and was again unacceptable. The problem turned out to be that the converter was invoking all the lazy-loaded children for each DTO. My final solution was to create a NameValue object and only convert that. Then in my Spring bean, I populate it from DAOs and DTOs. I'm using Spring's OSIVF for Hibernate to ensure that DWR doesn't invoke lazy-loading.
  • I had to override a few of DWR's JavaScript functions in util.js b/c they didn't work for me. I changed showById() and toggleDisplay() to use style.display='' instead of style.display='block' b/c this is what I've always used and block doesn't work that well. I also changed useLoadingMessage() to have a cleaner-looking load message.
  • I used the Fade Anything Technique in this project and found that IE likes to have full 6-digit hex values for colors in CSS rules. The shorter 3-digit hex values simply don't work in IE.
  • Using "test" buttons that only showed up for my username proved to be a great way to test the UI and the Ajax stuff. These buttons called a number of JavaScript functions to drive the UI and wait between invoking different functions using window.setTimeout.

All in all, using DWR was a great experience and I definitely plan to use it more in my projects. The client loves the app - especially since it's wicked fast and seems to work like a desktop app.

Posted in Java at Apr 28 2005, 02:10:26 PM MDT 31 Comments

Very cool search with XMLHttpRequest

From fiftyfoureleven.com, I learned about forgetfoo.com - which is doing some very cool stuff with XMLHttpRequest. Be sure to check out the calendar, comments and naked picture of Britney Spears.

While we're on the topic of cool stuff, I also learned about this cross-browser Nifty Corners component. Should we call a set of CSS+JavaScript files a component I think so, what else would you call it?

Posted in Java at Apr 13 2005, 11:13:55 AM MDT 4 Comments

What's next in my career?

I've been pretty fortunate in my career so far. A few years ago, I was attending Web Designer conferences, learning more about HTML, Photoshop and Flash. At those conferences, I admired the speakers, the relationships they had with other speakers and how they really seemed to be enjoying the "speaking lifestyle." I thought to myself, "that's what I want to do."

Fast forward to today and I feel like I've accomplished everything I ever wanted to in my career. Now I'm experiencing an interesting state of mind. I don't really know what I want to do next. I'm certainly enjoying being a consultant and getting new gigs every 3-6 months, but I know if you want to make any real money as a consultant, you have to travel. When I say "real money", I mean $200-$300/hour, which equates to $400K-$600K/year. The problem with consulting is I don't want to travel. At all.

So I can continue being a consultant, making pretty good money, but I'm yearning for something more. I don't know what the "more" is, but I feel like I should have a plan for the next 5-10 years. I've had a couple of good offers for full-time jobs recently. The problem is that full-time employment generally doesn't appeal to me. The main reason is because I don't want to take a 50% pay cut. The second reason is because I tend to take 2-3 months off per year, and finally - I never seem to be that interested in the hiring company's mission statement.

The 2-3 months off is probably a misnomer because many of those weeks are for conferences, but I doubt I'd find a company that'd send me to conferences and pay for it.

On Monday, I was discussing this with a potential employer/client - and it hit me. I think I need to share my career aspirations with a full-time employer's to make it work. Since I'm at a point where I I don't know what my goals/desires are - it's pretty tough for me to see myself working for anyone but myself. What I do know is that it would drastically help if starting the company was my idea. The problem with this is I don't really have the motivation to start my own company right now. Sure I have Raible Designs and all, but to make real money as a non-consultant, I think you have to have a product. I could hire a bunch of consultants, but I don't really want to manage people - it seems like it'd be more fun to develop, ship and support product(s). Then I wouldn't have to travel at least.

This is all to say that I don't know what I'll do next in my career. Heck, I don't even know what I want to do. One things for sure though - my current gig is one of the best I've ever had. Awesome team, good rate, great location and super-easy commute. I think I'd be a fool to quit before my contract ends at the end of the year.

What are your career aspirations for the next 5 years? The next 10?

Posted in General at Mar 30 2005, 10:58:30 PM MST 21 Comments

Trim Spaces in your JSP's HTML

One of the annoying things about JSPs is all of the dynamic (non-rendered) parts of the page still produce line breaks. This means that if you do a view-source, you'll likely see large blocks of whitespace.

The good news is you can get rid of this whitespace if you're using Tomcat 5.5.x. Just locate the "jsp" servlet in $CATALINA_HOME/conf/web.xml and add the following <init-param>:

    <init-param>
        <param-name>trimSpaces</param-name>
        <param-value>true</param-value>
    </init-param>

I tested it and it works great. This begs the question - why isn't this on by default? Source: Struts Mailing List.

Update: JSP 2.1 adds the ability to trim whitespaces.

Posted in Java at Mar 23 2005, 10:24:58 PM MST 39 Comments

Round Squares with CSS

Want to create squares with rounded corners - and only use CSS? If so, you might want to checkout the CSS Rounded Box Generator. Source: CSS Beauty.

Posted in The Web at Mar 23 2005, 09:35:05 AM MST 2 Comments

Tapestry is the best Java framework available today

David Geary:

So what's the best Java-based framework available today? It's a very close call, IMO, but I'd have to give the nod to Tapestry at the moment. I really like Tapestry's pure separation of HTML and components and the ability to create custom components without any Java code. That gives it an edge on JSF, which, like Tapestry is one of what I refer to as 3rd generation WAFs, that support components and a server-side event model.

He goes on to say that he'll likely continue to use JSF (with Shale) because it pays the bills and will dethrone Struts as the most popular - which will obviously lead to more gigs. I especially like this part of his post:

After I get client-side validation and file uploads added to Shale I want to turn my attention to Tiles integration, AJAX support and exploring Tapestry-like views that strictly separate HTML and component definitions. For me, those are the most exciting areas of Shale.

I agree that JSF definitely needs Tapestry-like HTML Templates. Shale definitely sounds cool, but I find it funny that it takes yet another framework to make JSF usable. ;-) Hopefully Shale will prove a lot of ideas worthwhile and end up as features in JSF 2.0.

Posted in Java at Mar 21 2005, 09:00:52 AM MST 9 Comments

[Microsoft] Day 1 Afternoon

At lunch, I got to meet Scoble, which was pretty cool. He was wearing a blue Firefox shirt for those that are interested. During lunch, he and his co-worker talked about Channel 9 and what they're doing with it. Channel 9 is named "Channel 9" because this is the channel that United (the airline) uses to allow passengers to listen in on the pilot's conversations. It's supposed to be an avenue for folks to listen in on what's going on at Microsoft.

Now we're sitting in a talk titled Developer Community Outreach Efforts. The speaker is named Sanjay. He's the VP of Worldwide Developer Evangelists, of which there are around 1000. Sanjay believes that MSDN is way too large. It does have a lots of interop and migration content for those that are interested.

Sanjay's trying to get ideas from us on what they can do better. The general feeling from the room seems to be "why should we help you", "what's in it for us" and "why do you care now, but not before". It's a tough room for sure. I don't seem much point in this whole talk. A lot of folks are telling this guy what he (and Microsoft) can do to become better to be better citizens to the programmer community at large. A lot of the conversation is centered on accepting open-source and providing a clearer message about the platform (should be inclusive, not exclusive).

SQL 2005 and the Developer

Now we have a guy (missed his name) that's talking about how SQL Server 2005 will allow you to expose web services directly from your database, without IIS involved. Apparently, it exposes queries and stored procedures as web services using a native Windows DLL.

Ben asked about benchmarks for SQL 2005, specifically against MySQL and PostgreSQL. The MS guy says that these vendors will need to do the "standard" TCP benchmarks, and do the comparisons there. We all know that SQL Server would get their asses kicked, and that's why they don't do any direct comparisons. While we're on the subject of SQL Server, why are most SQL Server databases so screwed up? In my experience, SQL Server DBAs tend to be over-optimization freaks that are stored-procedure happy and don't know much about making a database application-friendly. Maybe it's because all you need is a SQL Server DBA Certification to get the job - and your knowledge is based on a book, not experience.

Next topic: Access. Access is not going away. "SQL Express" is supposedly the target replacement for Access. It's throttled to prevent users from using it for a full-blown database. "You can never write a bad query for SQL Server." This is a direct quote, and the guy's reasoning is because the optimizer will change the query to be performant. Sounds like a bunch of hoo-ey to me.

Today, you can write extended stored procedures in C++ with SQL Server. This code is not sandboxed, and can pretty much to whatever it wants. In SQL 2005, you can do this with C# and use VS.NET to write the code and debug it. Apparently, they have a whitepaper on SQL CLR vs. ADO.NET and when to use one over the other.

Product Development Process with Iain McDonald (Director, Windows Server)

Iain is from Australia, which naturally makes him fun to listen to, just because of his accent. The purpose of this talk is to explain how they do things. Cross-org at Microsoft means that that development is spread across 7 businesses, each organized under own leadership with individuals p&ls.

  • Business Solutions
  • Home & Entertainment
  • Information Worker
  • Mobile & Embedded Devices
  • MSN
  • Server & Tools
  • Windows Client

Each group has a lifecycle model that they try to follow. Microsoft has thee different stages: Product Definition, Product Development and then Product Servicing. I'm willing to bet their product development cycle follows the waterfall approach (confirmed: "How agile are we? We suck."). Actually, this brings up something I heard last night from one of the Microsoft Evengelists. Apparently, each developer has two QA folks that write tests (read: code) against their code.

Suite of Project Tools

  • Feature Inventory Tool: an inventory of features and their dependencies, tracks when the features will merge into the main branch.
  • Checkpoint Express: tracks all compliance throughout the project, requires sign-off prior to product being shipped.
  • Basics: list of fundamentals that product is expected/required to meet, examples include performance and manageability.
  • Change Management: uses an infopath form with links to the feature inventory tool and bug tracking database (product studio).

Iain admits that security in 2000 was an afterthought and the security guys were seen as some mangy dogs over in the corner. Bad RAM causes 20% of Windows crashes - who knew?! Bad RAM on OS X has certainly affected me in the past. I couldn't upgrade to Panther b/c I had 3rd party RAM in my PowerBook.

Microsoft is in a competitive battle against other companies, not the free world. No corporation in their right mind is going to download and install a free version of Linux - most are going to buy a distribution from companies like Red Hat or Novell. Iain claims that there's no way you can install Linux (at a corporation) for less money than Windows Server. It sounds to me like MSFT is willing to give you some discounts on Windows Server if you're thinking of buying Linux.

Break time. I'm definitely bored, but happy to have some time to work on AppFuse. Some guy asked me in the hall why I haven't asked more questions. I told him because I don't develop for Windows. For the most part, none of this stuff matters to me.

Windows Architecture

Now we're listening to two guys talk about Windows and how it's developed. Windows XP and Windows 2003 Server are two separate code bases. It's a nightmare to maintain b/c they have to patch one code base and the other one as well. Longhorn is componentized, so it should be easier to build client, embedded and server products. Someone asked about legal vs. technical reasons behind the componentization. Apparently, it's all for technical reasons, and they have to separate Windows Media Player for the EU, but that's about it. 40% of blue screens are from device drivers, and Longhorn has done a lot to handle this and reduce crashes.

This talk centered on XAML, WinFX and Longhorn - what they are, what they do and when they're scheduled for release. <Yawn/> While it has been a boring day (for me) technically, I do have to admit that the speakers have been great. They're dynamic and enthusiastic, which is more important IMO than good technical content. They also seem to be very open (as a whole) to ideas and criticisms. I think I'm just a bad audience member.

OK - here's something that's interesting. We're talking about IE 7 and its features. The top priorities are to stop spyware, fishing and any other security issues. #2 is tabs and #3 is CSS compliance. These priorities are based on user feedback and sound like good choices to me.

Posted in Java at Mar 17 2005, 12:40:56 AM MST 4 Comments

Microsoft's Agenda at the Competitive Influentials Summit

They said I could blog everything about the conference I'm going to tomorrow, so let's see how far they're willing to go. ;-) A lot of folks have asked me what the agenda is, and until now - I've had no clue. However, today I was sent an e-mail and I'm happy to let y'all know what's going to happen. One thing I noticed is that the Word document's title was "Competitive Influentials Summit". Heh - I guess I'm an "influential" now.

I'm really looking forward to this event. I think we're really going to get wined and dined, and maybe even learn something. It'll be the first time in my life that someone will be picking me up from the airport with a "Raible" sign. I'm leaving at noon on Thursday to do a little St. Patty's day celebrating with my sister (it's her birthday), so I'll miss the "Open Source and Microsoft" session. Hopefully someone else will blog that so we see what they're thinking.

Wednesday, March 16
Time Topic
7:30am-8:00am Registration/ Breakfast
8:00am-8:30am Welcome Keynote
8:30am-9:00am Attendee Introductions
9:00am-10:00am Improving Security at Microsoft by changing the process
10:00am-11:00am Microsoft Messaging Futures Using Indigo
11:00am-11:15am Break
11:15am-12:15pm Programming Language Design Panel: Jim Miller/Jim Hugunin/Herb Sutter
12:15pm-1:00pm Lunch / Channel9.MSDN.com Discussion
1:00pm-2:00pm Developer Community Outreach Efforts
2:00pm-3:00pm SQL 2005 and the Developer
3:00pm-4:00pm Product Development Process
4:00pm-4:15pm Break
4:15pm-5:45pm Windows Architecture
5:45pm-10:00pm Shuttles depart for Teatro ZinZanni
Thursday, March 17
Time Topic
7:30am-8:00am Welcome / Breakfast
8:00am-9:00am Morning Keynote
9:00am-10:00am .NET CLR Architecture
10:00am-10:15am Break
10:15am-11:15am ASP.NET 2.0
11:15am-12:15pm VS.NET 2005
12:15pm-1:45pm Lunch / Microsoft Research and Innovation
1:45pm-2:45pm Smart Client Futures
2:45pm-3:45pm Guidance Through Patterns and Practices
3:45pm-4:00pm Break
4:00pm-5:00pm Open Source and Microsoft
5:00pm-6:00pm Company Store Visit
6:00pm Shuttle departs for Willows Lodge
7:00pm-10:00pm Evening Event at Red Hook Brewery
Friday, March 18
Time Topic
8:00am-8:45am Welcome / Breakfast
8:45am-9:15am Closing Keynote
9:15am-10:15am Windows CE and Mobility
10:15am-10:30am Break
10:30am-11:30am Visual StudioTeam System
11:30pm-12:00pm Closing Remarks
12:00pm Lunch / Departure for airport/hotel

Posted in Java at Mar 14 2005, 12:53:52 PM MST 7 Comments

[TSSS] Days 1 and 2

I'm sitting in the EJB3 BOF right now. The room is packed, but it seems most folks are uninterested and the moderators are just talking amongst themselves. Seems like a good time to blog since this BOF doesn't interest me whatsoever. Yesterday, I arrived at 8:00, took a cab to the Imperial Palace (where we're staying) and then headed over to Caesar's for the conference. I registered, assured we could drink beer during the sessions, and attended the (rather dry) keynote. Hani has a good synopsis of this talk.

After the keynote, I went to Patrick and Jason's WebWork talk for about 10 minutes. I soon realized it was an intro to WebWork and left to try and learn something. I went to Craig McClanahan's talk on "The Development of Web Application APIs and Standards for Java." His talk was pretty good, and covered "de facto" versus "de jure" standards. De facto standards are ones that evolve from the community through widespread usage, whereas de jure standards are imposed on the community (like JSF). Again, Hani has the full scoop on this talk.

Next, I went to Dion and Ben's talk on Ajax applications. They talked about XHTML/CSS and how XMLHttpRequest makes rich client-side applications possible. I think the whole Ajax thing is pretty funny. It's something that's been available for several years and my guess is most folks just didn't know about it. I've been using XMLHttpRequest for a couple of years now, and it's interesting to see it become popular all of a sudden. It's quite nice actually. I've been writing HTML/JavaScript for over 10 years, so I find Ajax development pretty easy. I hope to add support for Ajax-type features in AppFuse before this summer.

I wonder when/if the community will realize the power XSL processing in the browser? Since we're all developing XHTML applications now, our pages are XML and we could easily start leveraging client-side XSLT to do some pretty cool stuff. With a client-side XSL sheet, you could do page decoration (like SiteMesh) just by adding one line to your pages. For example:

<?xml-stylesheet type="text/xsl" href="styles/global.xsl"?>

The only problem with client-side XSLT is your pages have to be well-formed XML or everything bombs. With HTML, if you screw something up, chances are the browser will still render it correctly.

After the Ajax review, I had lunch and headed down to the Casino for some beers and gambling. I came back in time for Rod's "Why J2EE Projects Fail." It was a good talk, but there wasn't any revolutionary or new information provided. After his talk, I was motivated to learn more about Web Services Security, but instead opted for beers with Crazy Bob, JIRA Mike and Neon Dion. A couple of beers turned into several, and I found myself having dinner with the SourceBeat guys (Bill, Matt and Jim) a couple hours later. Steak and Lobster was my plate of choice and it tasted quite good. The rest of the night was spent gambling, drinking and harassing Pai Gow Poker dealers. We had breakfast around 2 and made it to bed by 3. Total cost of the trip so far: $300.

I slept in until noon today, after which Jim and I headed back to the conference for some lunch and afternoon sessions. Lunch was good and followed by Oracle demoing JDeveloper and coding EJB3 and JSF with it. I've often wondered about the cost of Oracle's ADF JSF implementation and actually got an answer from one of the attendees. I think he was an Oracle employee but he basically said you have to buy at least 1 copy of JDeveloper ($999) and you get a runtime license for ADF Faces as part of that. That sucks because Oracle's implementation looks like one of the most full-featured ones available. Why should I have to buy a tool I'll never use just to use ADF Faces?

After lunch, we attended Rod's "Advanced Spring Framework" and Craig's "JSF: Dead on Arrival or Raging Success". Rod's Spring presentation covered some advanced Spring features: autowiring, inner-beans, lists, instantiation choices, factory beans and template bean definitions. The presentation was good, and I was pleasantly surprised to find I knew most of the things he covered. Colin spoke about using JDK 5 annotations for transaction demarcation and Keith talked about Spring Web Flow. The Spring Web Flow stuff looks cool, especially since the other framework developers are listening and liking what they see. Craig even mentioned that he'll probably ditch what he's put together in Shale and use Spring Web Flow instead.

Craig's talk about JSF was rather boring, but most of these sessions are (mainly because there isn't a whole lot of new information). Craig did manage to pimp Java Studio Creator a bit. I find JSC demos to be quite funny since it hides so much code with code-folding. In the demo, Craig showed us a 10-line Java class that made JSF (and JSC) look like good stuff. Jim and I noticed code-folding was turned on and the class was actually 120 lines long! This is more of a problem with JSC then JSF IMO. The one nice thing about this talk was learning that a JSF 2.0 BOF is tonight. The main goal of the BOF is to see what the community wants in 2.0. I hope to attend and express a desire for HTML templates like Tapestry has.

Tonight kinda sucks because all the good BOFs (Spring, Tapestry and JSF 2.0) are at the same time (7:30). I'm hoping to hop around between them and get some good networking in. After the BOFs, OpenSymphony is hosting an open bar - so that should be a good time. Hopefully we can scare up a few free carbombs. For more blogs and coverage of the conference, see the TSSS 2005 blogger list.

Posted in Java at Mar 04 2005, 05:33:59 PM MST Add a Comment

Hibernate vs. iBATIS

There's an interesting thread taking place on the iBATIS User Mailing List. The basic jist of the responses are: Hibernate works well when you control the data model, iBATIS works well when you need to integrate with an existing database. I've said this for a couple years now, and I still believe it. Furthermore, I've found that when working with iBATIS, I tend to know what's going on a lot more. After all, it's just SQL. From all the questions on the AppFuse mailing list, it seems like a lot of Hibernate users are constantly trying to get Hibernate to "work its magic" and handle all their relationships for them.

I wonder if newbies would be better of using iBATIS? Using iBATIS, there isn't a whole lot of magic, and you get full control over the SQL - which would likely be easier to understand. Maybe I should create a "newbie" version of AppFuse - where the frameworks uses are the easiest to learn or most documented. It'd probably be Struts+Spring+iBATIS, or maybe just Spring+iBATIS so I could sell more copies of Spring Live. ;-)

Posted in Java at Feb 28 2005, 07:10:25 AM MST 38 Comments