JSF 2.0 makes AJAX pretty easy - but it can't hide everything from you...
It's tempting to just add a few AJAX tags into your page, and not worry too
much about interactions - here's one example of a problem you may run into.
Let's say you've got a page with an input text, and a command button - like
this:
1 2 3 4
5
Now, we decide to add an ajax tag:
1 2 3 4
5 6
Can you spot what's wrong with this example? When we push the button, we're
also blurring the inputText. That means that the ajax request is sent - but
then, almost immediately, that request is canceled as the whole page is
reloaded.
Is this a bad thing? For this simple example, not so much. There's going to
be a... (more)
Even though it's considered bad practice, it's often handy to eval code in
JavaScript. And in my case, it was simply necessary, since the JSF
specification requires eval of scripts. And it's also necessary to execute
those evaluated scripts in the global scope. It's not as easy as it first
looks.
For our first naive implementation, we'd simply used eval(src) in our first
pass at the implementation.
This is utterly wrong, and to understand why, you'll need to understand
scopes. JavaScript has what you can think of as two different scopes -
function scope, where you're executin... (more)
IntelliJ has shipped their new Maia EAP, with support for many Java EE 6
features, including
... (more)
Mojarra just went Beta, and the JSF spec just passed the JCP vote. If you
haven't looked at JSF in a while, it's time to take another look.
... (more)
Mojarra just went Beta, and the JSF spec just passed the JCP vote. If you
haven't looked at JSF in a while, it's time to take another look.
... (more)