December 08 2008
PrettyFaces 1.1.0 Released
A new release of the PrettyFaces JSF extension for Bookmarkable/Pretty URLs is now availible for download. This release includes several new features.
Read the rest of this entry »
A new release of the PrettyFaces JSF extension for Bookmarkable/Pretty URLs is now availible for download. This release includes several new features.
Read the rest of this entry »
We’ve gotten a good number of comments from Lincoln’s latest post on Spring Security and JSF. A few comments have asked for further code samples on how to get this example working.
We created a runnable project for this example, and it can be downloaded here.
Everyone seems to be going through hell to get a fully functional JSF login page working with Spring Security (formerly Acegi,) and yes, I did too, but there’s an EASY way to make this happen. And get this:
First, the solution. Afterwards, the dirty details. (Spring 2.5.2 was used for this example.)
You can find a downloadable working example here.
In a JSF Reference Implementation, passing global faces messages between pages doesn’t work. It’s not designed that way “out of the box.” Fortunately there is a way to do this, which will even support redirects between pages, forwards through a RequestDispatcher, and also through standard JSF navigation cases.
There is a 5 minute solution to this problem.
(View this issue on the JBoss tracker here. Keep reading, there is a fix… download fix)
When using the a4j:form component, the data=”#{managedBean.property}” the properties defined in the data element list are supposed to be available after the a4j event in the data JavaScript variable; however, with <a4j:form> the attribute is not correctly causing the JavaScript data variable to be populated.
Read the rest of this entry »
Today’s subject is a well commented square root approximation method. Imagine that this method is buried deep in a very messy Java class. How can we make sure that this code is reusable and that our comments don’t become out of date as our code changes?
/** * Approximate the square root of n, to within the specified tolerance, * using the Newton-Raphson method. This method takes two arguments: * @param Double n The number to be square-rooted * @param Double tolerance the error tolerance * @return Double result of square root operation */ public Double approximateSquareRoot(Double n, Double tolerance) { Double root = n / 2; while (Math.abs(root - (n / root)) > tolerance) { root = 0.5 * (root + (n / root)); } return root; }
Getting started with Hibernate can be tricky, but here’s a step-by-step tutorial that explains exactly what needs to be done to enable your application for hibernate. This chapter covers very basic mapping and persistence.
So I’m sure I’m not alone here, when I say that Hibernate can be frustrating, difficult to learn, and may even feel like to use it means to give up on some design principles that have been proven by many.
When you first begin, it feels like there are holes, inconsistencies, and problems that send you running home to the familiar behavior of plain SQL. But, I don’t think it’s time to give up on Hibernate yet.
Keep in mind that I am a relatively new Hibernate user, I consider myself somewhat experienced with software development, design patterns, principles, and best practices. If this sounds like you, read on…