May 4th, 2013 by Daniel Sachse

Migrating from PrettyFaces to Rewrite – Simplicity meets power

Hi Java web-developers. I hope you are already familiar with PrettyFaces. If not, I will give you a very short introduction taken from the project documentation:

PrettyFaces is:

“The open-source /url/#{rewriting} solution for Servlet, JSF, and Java EE, including features such as: page-load actions, seamless integration with faces navigation, dynamic view-id assignment, managed parameter parsing, and configuration-free compatibility with other web frameworks.”

Rewrite, on the other hand, is a URL-rewriting framework built for extendability, for use with any web-framework or pure Servlet itself, and is used for the core of PrettyFaces “4.0″ – bringing the best of both worlds… so that sounds very cool thus far, but what do we want to achieve with it? Why would we use either of these frameworks?

April 3rd, 2013 by Lincoln Baxter III

Set up an anti-spam filter for your website with mod_security and fail2ban

top apache2 cpu usage

Frequently spammers target products such as wordpress, web forum software, phpMyAdmin, and other common tools used by hobbyist and professional website administrators.

Whether you are hosting your own blog, or running a website for your company or more, it can be difficult to deal with the increasing amount of malicious web traffic seen on a daily basis, while still allowing friendly crawlers such as Google, Yahoo, and MSN search engines.

This harmful and wasteful traffic may damage your system or simply waste its resources, slowing down the site for your more welcome users. If this sounds familiar to you, but your page hits don’t seem to add up, then you may want to consider taking some of the measures outlined below in order to secure your site from harmful hacks and sluggish spam.

Lincoln Baxter, III

About the author:

Lincoln Baxter, III is a Senior Software Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge. This blog represents his personal thoughts and perspectives, not necessarily those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on promoting open-source software and making web-applications more accessible for small businesses, individuals.

February 25th, 2013 by Matyas Danter

Setting up Google OAuth2 with Java

oauth_logo

For all of you who are trying to figure out how to integrate with Google’s single sign-on functionality (like I’ve done for my own startup at tripgather.com), this article might be for you. I’ve taken the liberty of condensing all of the actual logic required to perform OAuth Google login, and provided it as a class and a JSP (seen below). In order to follow along better, I suggest cloning the example GitHub repository, and deploying to the application to your server of choice.

About the author:

Matyas Danter is a Senior Associate at LiquidHub currently working at a large financial institution as a Production Support Specialist. He is interested in cryptography, software development awesomeness, and enterprise web applications.

January 4th, 2013 by Lincoln Baxter III

JavaScript is the new Perl

perl_logo javascript_logo_unofficial

I don’t think we will see a “winner” of the browser-language wars any time soon, but there will be a winner. JavaScript hype is still through the roof, and with the discovery of a dynamic language in the browser actually works decently between late browsers, people are thoroughly excited; however, I’d akin this to people discovering Perl during the advent of C and C++. Does it work? Yes. Is it pretty? Not by a long shot.

Don’t get me wrong, I love Perl – I think it’s an incredibly powerful and fun language that now suffers from the bad reputation it acquired before gaining true object-oriented features – but, those who hate Perl hate it because it’s “too hard to maintain” and too “strange.” So if you want to talk about a strange language, look at JavaScript – it’s like Perl times ten. At least Perl has a consistent type inferencing and enforceable namespacing! (I think you’d have a hard time arguing that enforceable namespacing is a bad thing… global variable collisions can result in some pretty nasty bugs, particularly because it is easy to never see the downstream impact.)

Point being? As someone who has already gone through several language hypes and paradigm shifts in Computer Science (even in my relatively short 14 year experience,) JavaScript is a lot like Perl – extremely powerful, but a potential maintenance nightmare if one is not extremely diligent – and while I do like both languages, JavaScript just waiting for the next technology to come around and make it look like Perl does today: pervasive, but lacking enterprise adoption on large applications.

Lincoln Baxter, III

About the author:

Lincoln Baxter, III is a Senior Software Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge. This blog represents his personal thoughts and perspectives, not necessarily those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on promoting open-source software and making web-applications more accessible for small businesses, individuals.

December 24th, 2012 by Lincoln Baxter III

2013 Holiday technology recap and predictions

christmas_wreath

Happy holidays, I hope everyone is relaxing and having a great time with their families and loved ones. To help see out the last year, and ring in the new one, I’ve prepared a (hopefully relaxing) article on some trends we’ve seen in 2012, and what that could mean for us in the next year and years to come. So if you want to take a break from the holiday din, then head over to JAXEnter and check out my article. The technologies I discuss are Rewrite, OCPsoft’s own, and Errai, by Red Hat.

Be safe, and I’ll see you all in the new year, ~Lincoln

Lincoln Baxter, III

About the author:

Lincoln Baxter, III is a Senior Software Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge. This blog represents his personal thoughts and perspectives, not necessarily those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on promoting open-source software and making web-applications more accessible for small businesses, individuals.

December 5th, 2012 by Lincoln Baxter III

[announcement] Guide to translate PrettyTime to your native language

If you’ve ever looked for social-style date formatting for Java, to create timestamps like, “2 minutes from now” or “3 months ago,” PrettyTime is probably the tool you’ve ended up with, and as you might know, it supports over 25 languages and dialects – a great number to be sure. But what happens when you come across one of the over 4500 living languages that are not supported?

Well, then it’s time to do some translation, and in order to help you manage this task, we’ve created a guide to help you get through as quickly and easily as possible. When you’re done, you might even want to submit your translation back to us so that everyone else can benefit from your hard work. The guide covers this, too. It takes only a minute or so to read the guide and get started! Let us know how you do.

Lincoln Baxter, III

About the author:

Lincoln Baxter, III is a Senior Software Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge. This blog represents his personal thoughts and perspectives, not necessarily those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on promoting open-source software and making web-applications more accessible for small businesses, individuals.

November 2nd, 2012 by Lincoln Baxter III

[video] GWT and Errai UI Quickstart

I wish I had a magic GWT + Errai quickstart tutorial for you. But in fact, I do! Check out this video, and the tutorial below, to start your adventure with client side HTML5 templating in GWT!

Lincoln Baxter, III

About the author:

Lincoln Baxter, III is a Senior Software Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge. This blog represents his personal thoughts and perspectives, not necessarily those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on promoting open-source software and making web-applications more accessible for small businesses, individuals.

October 8th, 2012 by Team

[podcast] Lincoln Baxter and Kito Mann on Java

Join Lincoln Baxter of OCPsoft and Kito Mann of Virtua, Inc. as they discuss several emerging projects in Java. The transcript and MP3 can be found at Virtua’s site. This podcast was recorded at JAXConf in San Francisco, 2012.

September 19th, 2012 by Lincoln Baxter III

How to @Inject Enum values into CDI beans

I was recently asked how to Inject a Java Enum into a bean constructor using CDI. This turns out to be a fairly interesting situation, because enums are not usually available for Injection.

Lincoln Baxter, III

About the author:

Lincoln Baxter, III is a Senior Software Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge. This blog represents his personal thoughts and perspectives, not necessarily those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on promoting open-source software and making web-applications more accessible for small businesses, individuals.

September 18th, 2012 by Lincoln Baxter III

New tutorial: Regular expressions

Do you love regular expressions as much as I do?

Well even if you don’t, I am pleased to announce a new tutorial: “OCPsoft’s guide to Regular Expressions.” As part of an ongoing initiative to promote awareness of regular expressions, and how they are used both as a general technology, but also specifically as applied to the Java programming language, we will be continuing to add new example-based guides to this course.

Please feel free to post questions and comments if there are topics or specific problems that you would like to see addressed. We will do our best to answer your questions and share the knowledge!

Check out the tutorial.

Enjoy!
~Lincoln

Lincoln Baxter, III

About the author:

Lincoln Baxter, III is a Senior Software Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge. This blog represents his personal thoughts and perspectives, not necessarily those of his employer.

He is a founder of OCPsoft, the author of PrettyFaces and Rewrite, the leading URL-rewriting extensions for Servlet, Java EE, and Java web frameworks; he is also the author of PrettyTime, social-style date and timestamp formatting for Java. When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on promoting open-source software and making web-applications more accessible for small businesses, individuals.