Starting in JSF 2.0 (JSR-314) a feature was added called ProjectStage. This is an attribute that signifies the stage where the project is running:
Development
, UnitTest
, SystemTest
, or Production
. The idea is that if the code knows where it is running, it can plan better. As an example, in a production environment certain optimizations could occur during startup that would cause better overal performance. However, these optimizations during start up is a problem during development because during development there is a lot more shutting down and starting up of the server.
There are two ways to specify the ProjectStage:
web.xml
and JNDI. The problem with using web.xml
is that you need to update or override it as you go move from one environment to the next. JNDI is configured on the application server, so it is the ideal place to configure ProjectStage.
In WebLogic (11g), you can not add custom resources to JNDI. So, out of the box, you can not specify ProjectStage in JNDI.
In a previous post, I described Weblogic JNDI Custom Resource Configuration, which is a project where I configure JNDI in WebLogic using Startup Classes.
Adding ProjectStage to JNDI
Name: | jsf-stage |
Class Name: | com.idmworks.weblogic.jndiconfiguration.StringInitializer |
Arguments: | jsf/master/ProjectStage=Development |
Failure is Fatal | unticked |
Run Before Application Deployments | unticked |
Run Before Application Activations | ticked |
This will configure
jsf/master/ProjectStage
to store the value of "Development"Add Resource to web.xml
In the previous step, "Development" was added to the global name space as
jsf/master/ProjectStage
. The JSF JSR Documentation states that it looks for the ProjectStage at java:comp/env/jsf/ProjectStage
which is the local namespace. In order to define it in the local name space, we need to specify it in web.xml
.<web-app version="2.5" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- ... other configuration removed ... --> <resource-ref> <res-ref-name>jsf/ProjectStage</res-ref-name> <res-type>java.lang.String</res-type> <res-auth>Container</res-auth> </resource-ref> <!-- ... other configuration removed ... --> </web-app>
Add Resource to weblogic.xml
In the previous step, we allocated the place holder for
java:comp/env/jsf/ProjectStage
, we now need to map the global location to the local place holder:<weblogic-web-app xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.bea.com/ns/weblogic/90" xsi:schemalocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd"> <!-- ... other configuration removed ... --> <resource-description> <res-ref-name>jsf/ProjectStage</res-ref-name> <jndi-name>jsf/master/ProjectStage</jndi-name> </resource-description> </weblogic-web-app>
Verify ProjectStage
Below is a small snippet of code that you can add to any facelet to check what the current projectStage is set to
Stage: #{facesContext.application.projectStage}
Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeleteWeblogic Training in Chennai
They are becomes a more and more interesting from the starting lines until the end.
ReplyDeleteweblogic tutorial
Thanks For Clearing All My Doubts Through Your Website Post.You Cleared All My Doubts.Coming To Our Self We Provide Commercial Kitchen Equipment Parts Through Out US At Very Affordable Prices And Also We Offer Same Day Shipping In US.We Offer Only Genuine Products.Really Thanks For Posting.
ReplyDeleteThis Blog is very helpful and useful,came to know that i should be strong in my basics and this blog helps me to improve it,Urgent Care Centers Services Provided by Us.Thanks For Posting.I Am refereed by my friend to this blog and i also want to refer my other friends to this blog.
ReplyDeleteGood article. It is very useful for me to learn and understand easily USMLE Thanks for posting.
ReplyDeleteThis Blog Provides Very Useful and Important Information. I just Want to share this blog with my friends and family members. Tibco Certification Training
ReplyDeleteIn Love With This Blog Which is providing Such an Important and useful Information...
ReplyDeleteVisakhapatnam Real Estate
very nice and informative blog provided by us...
ReplyDeleteVijay Devarakonda Height
coin haber - koin haber - kripto para haberleri - coin haber - instagram video indir - instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir - instagram takipçi satın al
ReplyDelete
ReplyDeleteExcellent blog. Lots of useful information here, thanks for your effort!
Real Estate Plots in Vizag
ReplyDeleteVery Informative blog thank you for sharing. Keep sharing.
Best software training institute in Chennai. Make your career development the best by learning software courses.
devops training in chennai
cloud computing courses in chennai
Docker classes in Chennai
I believe there are many more pleasurable opportunities ahead for
ReplyDeleteindividuals that looked at your site.
dba course in chennai
java training institute in chennai
mmorpg oyunlar
ReplyDeleteinstagram takipçi satın al
tiktok jeton hilesi
Tiktok jeton hilesi
Saç ekimi antalya
instagram takipçi satın al
instagram takipçi
metin2 pvp serverler
İnstagram takipçi satın al
perde modelleri
ReplyDeletesms onay
MOBİL ÖDEME BOZDURMA
nft nasıl alinir
Ankara evden eve nakliyat
trafik sigortası
dedektör
WEB SİTE KURMAK
aşk kitapları
Very Informative blog thank you for sharing. Keep sharing, It is so detailed and well formatted that i enjoyed reading it as well as get some new information too.
ReplyDelete