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 "matt". 1,142 entries found.

You can also try this same search on Google.

Easy Windows Authentication with Tomcat 4.x

The original blog entry by Robert Rasmussen has disappeared from the Internet (cannot find server) so I'm reproducing it here via Google's caching feature. I've made a few changes to pretty up the formatting, but that's about it.


I've been pulled into a little internal project, and one of the requirements is that users should be able to authenticate with their Windows login and password. IIS may or may not be in the picture.

Since the server is a Windows 2000 machine, this turns out to be extremely simple to do thanks to Andy Armstrong's JAAS login modules.

Once you've downloaded the login modules, set your classpath accordingly and make sure that the directory holding NTSystem.dll is in your %PATH% variable. Next, in the "Sample config" folder you'll find a tagish.login file and a java.security.sample file. The last line in the .sample file is significant, and it needs to be in your $JAVA_HOME/jre/lib/security folder (in a file named java.security). You should copy the tagish.login file there as well. If your users will always be logging into the same domain (which is the case in my situation), just set the defaultDomain property in tagish.login, like this:

NTLogin
{
    com.tagish.auth.win32.NTSystemLogin required returnNames=true returnSIDs=false defaultDomain=YOUR_DOMAIN_HERE;
};

Now, all you need to do to use Windows authentication in your webapps is to make one addition to your server.xml file (or to your specific context's definition):

<Realm className="org.apache.catalina.realm.JAASRealm" debug="99"
       appName="NTLogin"
       userClassNames="com.tagish.auth.win32.NTPrincipal"
       roleClassNames="com.tagish.auth.win32.NTPrincipal" />

I'll admit this config is slightly hokey. If you look at the Catalina JAASCallbackHandler (which is hardwired to JAASRealm), the way that I have the realm configured above pretty much counts on the User principal (in effect, the user name) being the first principal returned. This is evil, but it works. It would be nice if either Catalina allowed a pluggable CallbackHandler so that I could take advantage of the NTPrincipal.getType() method or if Andy's code returned subclasses of NTPrincipal like UserPrincipal or GroupPrincipal that I could specify in server.xml.

Once you've got this all configured, the various groups your users belong to equate to role names (so if I belong to an administrators group, my authenticated user will be in role "administrators"), and you can configure security in your webapps using these roles.


Posted in Java at Feb 17 2003, 04:11:52 PM MST 19 Comments

Comparative analysis of Struts vs. WebWork vs. Barracuda vs. Maverick?

Does anyone know of a comparative analysis of Struts, WebWork, Barracuda and Maverick. I'd love to find a paragraph or two that I could quote in my chapter on Struts. I'm not at all attempting to say that Struts is better than any of these - I just want to give a fair shake to each one. The reason I'm writing this chapter on Struts is because that's what I'm most familiar with.

Thanks,

Matt

Posted in Java at Feb 17 2003, 09:34:44 AM MST 4 Comments

Font Size Problems?

If you're having font-size problems with this site since I added the dynamic font re-sizeing, I apologize. It was a problem with the fact that I was using percentages for the base font, rather than pixels. So it set the initial font to 70px rather than 70%!! I've reset the base font to be 11px - deleting your cookies or hitting the "R" button should fix the problem. Tip o' the hat to John Cavacas (no blog from what I can tell).

Posted in General at Feb 17 2003, 09:16:41 AM MST 1 Comment

Is there an Instant Messaging API for Java?

I got to thinking on my way into work this morning - is there an Instant Messaging API for Java. I suppose it would help if there was an IM standard, just like there's an e-mail standard (SMTP). I suppose that Jabber is kinda close. Here's why I'm interested. There's a few things I get e-mails on now that are simply "notifications." For instance, Log4j errors, Anthill build notifications and comment notifications from this site. I'd love to be able to program these to call a more configurable messaging system - so I could set it to send me IM's or possibly even SMS messages (the problem with SMS is it costs $$ now). I suppose I could setup a Jabber server and use their API to send messages, but I'm hoping this is already done for me. It'd be slick to parse an e-mail address and based on whether it's @hotmail, @msn, @yahoo or @aol, it'd send it through the appropriate gateway. Anyone know of an API that makes with as easy as sending e-mail with JavaMail?

Posted in Java at Feb 13 2003, 03:07:45 PM MST 2 Comments

RE: Where's the $$ in Java

Danno Ferrin asks "Where's the $$ at in Java?" I don't think I have the answer to this, but I can say that the money has certainly declined in the last year. I wanted to comment on this post, because I think I've found myself an interesting niche. There seem to be few Java Developers that know UI Development stuff like CSS, HTML and JavaScript. When I say know, I mean really know it in the sense that they could construct a good looking web page from scratch. On most of the projects I've been on, sure there have been UI Developers, but that's all they knew was CSS, HTML and JavaScript - they didn't know much Java (if any at all). I'm not saying it's impossible for developers to know both Java and UI Technologies, just that it's rare. So if you want to create a niche for yourself as a Java Developer - learn the UI stuff. If you're a UI Developer, learn the Java stuff. It can't hurt can it?

Posted in Java at Feb 13 2003, 01:22:28 PM MST 2 Comments

Javascript Libraries

I feel the need to post a link to Matt Kruse's JavaScript Toolbox. I needed some JavaScript to move <option>'s from one <select> to another, and I found it via Google in about 10 seconds. I also use Matt's Calendar Popup JavaScript stuff, so his great work is familiar to me. To be fair and provide a fair shake to other great JavaScript libraries, here are a few others I've heard of and sometimes used:

If you know of others, please comment with links and your experience.

Posted in The Web at Feb 12 2003, 07:14:36 AM MST 1 Comment

Client-side Sorting with the DOM

I'm amazed at how easy it is to sort an HTML table with the DOM and JavaScript. I whipped up a quick modification of Porter's Sort Table Rows demo. The basic enhancements I made where removing the <a>'s from the table headers, and just adding an onclick handler to the <th>'s. I also added indicators to display the the current column/direction that's sorted. Seems to work in most of the browsers too! On Windows 2000, this includes IE6, IE5.5, Opera 7 and Phoenix 0.5. On OS X, the latest versions of Safari, Chimera, IE, Mozilla and Netscape. It doesn't work on OmniWeb, and the cursor: pointer doesn't work on the <th>'s in IE/Mac and IE5.5/Win. Anyway, you can checkout the demo or download with the relevant HTML, .gif and .js files. I've also included it below for your convenience.

I'd love to add this sort of capability to the display tag library.

Posted in The Web at Feb 11 2003, 12:54:38 PM MST 8 Comments

The war in Iraq

I don't believe it's started yet, but "The war in Iraq" was the only title I could think of. Anyway, I haven't been too concerned with it up to this point. I don't know that I support it, but I don't want to be the victim of chemical or nuclear warfare either. However, it became pretty personal today when I received an e-mail from one of my best friends.

For those of you who didn't already know, I was recently activated and deployed to Kuwait on the seventh of February. Obviously I had to withdraw from school and could be here for up to a year. However, this is very unlikely and I'm speculating and hoping that out unit will be sent home in either May or June.
....
I'm stationed at Al Jaber Air Base approximately 45 miles northwest of Kuwait City. As you can imagine the base in a very busy place right now with units from all four service braches present, along with a small contingency of British troops. I can't disclose too much information about the resources in place or our mission, but I can tell you the base is well fortified and protected. I'm sorry I didn't get in touch with some of you before I left. I had a very limited amount of time between the time I was notified and actually deployed, and was very busy taking care of personal affairs.

Yikes! Now I really hope we don't go to war!

Posted in General at Feb 10 2003, 09:48:28 PM MST 2 Comments

Is it possible to lock files with CVS?

I don't think this is possible, but since a co-worker asked - I'm relaying the question to you, the experts. Using CVS, it is possible to "checkout" a file for editing, and to lock it on the CVS server, so no one else can check it in. If this feature exists, I'd love to use it. Also, if anyone knows how to hookup sending e-mails for commits on a barebones CVS install, enlighten me. SourceForge makes it easy using synchmail, but Google doesn't even know about this tool - must be a SF script.

Update: Anthony has given me some good tips in the comments of this post. I've had some success in getting e-mail notification setup, but I'm still having some issues. To configure it, I checked out CVSROOT, and edited the loginfo file, adding the following line:

^project /usr/bin/mailx -c $USER -s "[cvs-commit] %{sVv}" [email protected]

When I get in a file, I get:

Checking in build.properties;
/export/home/cvsr/project/build.properties,v  <--  build.properties
new revision: 1.7; previous revision: 1.6
done
1.6... User unknown
1.7... User unknown
build.properties... User unknown
/export/home/mattra/dead.letter... Saved message in /export/home/mattra/dead.letter

I do receive the e-mail, but it's addressed to 1.6@cvsserver, 1.7@cvsserver, build.properties@cvsserver and [email protected]. I'm sure it's an easy fix, comments are appreciated.

Update 2: Our SysAdmin solved the e-mail issue with the following lines in loginfo:

^project /usr/bin/mailx -s '[cvs-commit] %{sVv}' [email protected]
^server_config /usr/bin/mailx -r [email protected] -s '[cvs-commit] %{sVv}' [email protected]

I'm no UNIX expert, so that's why I'm posting this here - that way I can use it the next time I need to set this up. Alternative approaches are welcome and encouraged!

Posted in Java at Feb 07 2003, 07:23:56 AM MST 6 Comments

Anthill, this site crashing and XSL

Anthill rocks. Once I got our CVS server configured to allow pserver authentication from localhost, it took less than 5 minutes to configure automated builds with our build.xml file. Next steps - running tests and deploying. I got deployment pretty much done today and all I have to do is add the tests as parameters to Anthill's build process. The only thing that worries me about Anthill is that they have an open-source version and a pay-for-it version. No company wants to pay for anything these days, and I'm afraid all the good stuff will end up in the pay-for-it version. To be honest, that's fine with me, since all the stuff I need right now is in the open-source version.

In case you haven't noticed, this site has been crashing daily and I only discover it when I actually check it. I'm definitely overdue for a Roller upgrade - especially considering the last one was in the October or November of last year. I want to contribute before I upgrade though, so it might be awhile. The problem I'm experiencing right now is OutOfMemory errors, so Keith wrote a perl script to check catalina.out for this string, and if it's there, it restarts Tomcat. Hopefully this will help me out until I upgrade Roller.

This morning, I did a little XSL for one of my moonlighting projects - and I was disappointed to find that there's no ends-with function in the current XSL spec. There's starts-with and contains, but no ends-with. I used contains in the end to check if a filename contains .avi, and if so, then use HTML for Windows Media Player, rather than QuickTime Player. Seems to work good enough for now.

Posted in Java at Feb 06 2003, 10:30:32 PM MST 2 Comments