-
1. Re: access faces-config.xml in a java bean
gavin.king Jan 21, 2007 2:23 PM (in response to holgerprause)Try using navigation rules in pages.xml. Then you can access them via the Pages built-in component.
-
2. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 10:17 AM (in response to holgerprause)Halo, thx for the answer i have 2 questions on this.
1)
Why the seam developers decided to introduce a new workflow config file
(pages.xml) instead using the jsf approach (faces-config.xml), are there any
real advantages on this ? (i have about 50 navigation rules in faces-config.xml, would be a pain to migrate them)
2) Is there a short example with pages.xml and how to acces them with the build in component your mentionend ?
Thank your very much,
Holger -
3. Re: access faces-config.xml in a java bean
pmuir Jan 22, 2007 11:06 AM (in response to holgerprause)Take a look at 5.1.1.2 in the 1.1.1.GA reference manual - it has the advantages and how to use them.
It looks to me like Pages.getPage(viewId).getNavigations should be allow you access to navigation rules. -
4. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 11:45 AM (in response to holgerprause)thx for the tip, ill put some time on it and take a look at it right now.
If i got any problem, can i post in this thread again?
thx very much(this is really the only bulletin board where ppl understand what i want and help me),
Bye,
Holger -
5. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 7:17 PM (in response to holgerprause)i read the manual and looked at the example in seam jboss-seam-1.1.0.GA
one thing i noticed:
the navigation rules are defined in a file called navigation.xml, the fine grained stuff in pages.xml and the rest in faces-config.xml
This makes sense to me.
Now.
As i understood gavin i should move that rules to pages.xml (have to redefine them course the syntax in pages.xml is different to "traditional" navigation rules)
Then i can access the via the build in pages component
But all i need is to access the navigation rules defined in navigation.xml.
Will that build in component allow me this ?
Thx very much,
holger -
6. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 7:50 PM (in response to holgerprause)Hello i a curently trying to migrate the naivagation rule but somehow i making a mistake but cant see it(rule has no effect).
rule from faces-config.xml (working)
<navigation-rule>
<navigation-case>
<from-outcome>loginsuccess</from-outcome>
<to-view-id>/welcome.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
rule in pages.xml (not working)
<!-- login -->
<rule if-outcome="loginsuccess">
<redirect view-id="/welcome.xhtml" />
when i deploy the application i get the log "reading pages.xml" so i am prettysure i should take effect, but i dont.
Any clue what i am doing wrong? -
7. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 7:52 PM (in response to holgerprause)i have to correct the code above the code in pages.xml is:
<!DOCTYPE pages PUBLIC
"-//JBoss/Seam Pages Configuration DTD 1.1//EN"
"http://jboss.com/products/seam/pages-1.1.dtd">
<!-- login -->
<rule if-outcome="loginsuccess">
<redirect view-id="/welcome.xhtml" /> -
8. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 8:05 PM (in response to holgerprause)ok i found potential mistake change to code blow -still no effect
(have problems posting xml code)
-
pages
page
navigation
<!-- login -->
rule if-outcome="loginsuccess"
redirect view-id="/welcome.xhtml" /
/rule
/navigation
/page
/pages -
9. Re: access faces-config.xml in a java bean
gavin.king Jan 22, 2007 8:22 PM (in response to holgerprause)You need to use code tags when posting code here.
Use:<page view-id="*"> <navigation> <rule if-outcome="loginsuccess"> <redirect view-id="/welcome.xhtml"/> </rule> </navigation> </page>
-
10. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 8:38 PM (in response to holgerprause)Hello, i also had the same idea, giving the page element a view id in my case
"/index.xhtml"
I tried the code u posted ,but it still has no effect.
I am using jboss-seam-1.1.0.GA, the pages.xml is deployed correctly (like in the examples), somewhere i got a log "no events.xml defined" , i hope it has nothing to do with the pages.xml.
Thx again , in worst case i still can parse faces-config.xml
Bye,
Holger -
11. Re: access faces-config.xml in a java bean
gavin.king Jan 22, 2007 8:40 PM (in response to holgerprause)You must be using Seam 1.1.1!
-
12. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 8:45 PM (in response to holgerprause)Oh ok, i didnt knew.
(Didnt even noticed seam 1.1.1 is out, from public donwload area your cant donwload http://labs.jboss.com/portal/jbossseam/download/index.html)
Well ill try to udate to Seam 1.1.1.
In the case i dont post here in this thread again, i got it working.
Thx very much,
Holger -
13. Re: access faces-config.xml in a java bean
holgerprause Jan 22, 2007 9:26 PM (in response to holgerprause)ok the navigation rule defined in pages.xml take effect!
Great!
Only 1 final problem
how can i inject that component?
Thx,
Holger -
14. Re: access faces-config.xml in a java bean
gavin.king Jan 22, 2007 9:32 PM (in response to holgerprause)Pages.instance(), or @In("org.jboss.seam.core.pages"). It does not have a short name yet.