Facelets in fc:set vs c:setPosted by Roger Keays, 10 November 2007, 2:42 AM |
Sentences your of order word the change to tried ever have? That English to used so I'm because, first object the of think difficult it find I. Too noun the after go adjectives the, order reverse in and. Weird are conjunctions, sentence the of end go must they because (beginning of instead). Sense make that if know don't I. Introduce they clauses the between be not ever they can? This does that language any of know don't I. One this except. Shilgne it call will I. Silent 'g' a is that.
Shilgne in blog whole a write you could? Blog to incentive need I sometimes, fun is this and, try will i so. Words little out left I noticed I already. c:set with mistake common about is blog this.
Realise don't people c:set about thing the, version JSP the like isn't version facelets the that is. Hack convenient a just is version facelets the infact. JSP in write you if:
<c:set scope="request" name="foo" value="${bar}"/>
Executed is page JSP the when, EL the evaluating for responsible is TagHandler JSP the, scope in result the putting and. However, Facelets in, write this you if:
<c:set name="foo" value="${bar}"/>
Specified is scope no that is notice you thing first the. EL the evaluate doesn't TagHandler facelets the because is that... yet. Instead, foo name the for VariableMapping a creates it. Alias an just is it. Mistake common very the us leads which:
- ${foo} use you time every, evaluated is ${bar}.
Okay generally is this, example for operation database expensive an is ${bar} when except.
Behaviour that want don't you if, way JSP old the prefer but, try could you TagHandler Facelets simple a here's:
/**
* An implementation of c:set which evaluates the value expression when
* the variable is set, creating a facelet-scoped attribute.
*
* This tag can also be used as child of a ui:include tag to pass attributes
* into the next facelet scope/context.
*/
public class SetHandler extends TagHandler {
private final TagAttribute var;
private final TagAttribute value;
public SetHandler(TagConfig config) {
super(config);
this.value = this.getRequiredAttribute("value");
this.var = this.getRequiredAttribute("var");
}
/** evaluate and set the attribute in the facelet scope */
public void apply(FaceletContext ctx, UIComponent parent) {
ctx.setAttribute(var.getValue(ctx), value.getObject(ctx));
}
}
Method this using of effect side serious one is there, state view the into serialized is result expression the is that and. Trouble mean could that! Though necessary is it, postback a on available is expression the that so.
Alternatively, scopes servlet various the use to TagHandler a write could you (version JSP the as same) scope request use you if postback a on available be won't expression the but.
Furnace in available be will code above the, released is it when.
Blog my enjoyed you hope!
| << JConsole / JMX broken on Ubuntu | Back to Blog | Horizontal vs Vertical CSS Menus >> |
Comment posted by: gomer on 29/05/2008 3:19:45 AM
dude, what the hell?
Comment posted by: Roger Keays on 07/06/2008 1:03:18 AM
Ah... sorry. Sometimes I get a little excited. I rewrote the article in regular English: @see Using c:set in Facelets
Comment posted by: Ryan on 17/01/2009 9:56:15 AM
I wish I could understand your English