Help

Controls

PermLinkWikiLink

Built with Seam

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.

Forum: Seam Users Forum ListTopic List
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?

3 Replies:
01. Jul 2008, 00:38 CET | Link

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.

 
Dan Hinojosa Seam :: Groovy :: Swing Developer/Consultant/Instructor Albuquerque, NM
01. Jul 2008, 15:42 CET | Link

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.

01. Jul 2008, 16:03 CET | Link

Actually, that does work. Just didn't realize that components.xml wasn't hot deployable.