You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 29 Members of 4060 |
| Forum: Seam Users |
30. Jun 2008, 23:10 CET | Link |
I was wondering if anyone was aware of a way to check for whether the facelets.DEVELOPMENT has been set to true or false in web.xml? I'd like to use this as a cue to determine whether to use the minified versions of the ExtJS library or not. So for instance something like the following would be ideal:
<h:outputText rendered="#{facelets.DEVELOPMENT">
<script type="text/javascript" src="/js/ext-all-debug.js"</script>
</h:outputText>
<h:outputText rendered="#{!facelets.DEVELOPMENT">
<script type="text/javascript" src="/js/ext-all.js"</script>
</h:outputText>
Any thoughts or suggestions?
I believe this will work
#{facesContext.externalContext.getInitParameter('facelets.DEVELOPMENT')}you can probably make a factory out of it in components.xml so it can be shorter
<factory name="isFaceletDevelopment" auto-create="true" value="#{facesContext.externalContext.getInitParameter('facelets.DEVELOPMENT')}"/>I am pretty sure the first code snippet will work, not sure about the factory so you'll need to play with it.
Thanks for the help. The first snippet did work but the factory did not. Oh well. At least I have a better way of controlling what gets shown and when.
Actually, that does work. Just didn't realize that components.xml wasn't hot deployable.