[JBoss Seam] - Re: Redirecting into view that is inside a directory
by pbrewer_uk
If I understand correctly, then I should explain how navigation rules are supposed to work. This is how your current setup will work: Your /index.jsp will redirect to /home.seam which, in turn will map to a file in your war called /home.xhtml which will then be rendered on the front-end. (Note no navigation rule is involved here.)
The navigation rules are supposed to be used as action outcomes: looking at the seam booking example, there is a login action method that returns an outcome of either "login" or "main" these outcomes are then mapped, in the faces-config.xml file (see below), to views.
Seam also introduces the concept of stateful navigation through the use of Pageflows. Have a look at the seam reference for more info on this.
LoginAction.java extract...
| public String login()
| {
| List<User> results = em.createQuery("select u from User u where u.username=:username and u.password=:password")
| .setParameter("username", user.getUsername())
| .setParameter("password", user.getPassword())
| .getResultList();
|
| if ( results.size()==0 )
| {
| FacesMessages.instance().add("Invalid login");
| return "login";
| }
| else
| {
| user = results.get(0);
| Contexts.getSessionContext().set("loggedIn", true);
| FacesMessages.instance().add("Welcome, #{user.name}");
| return "main";
| }
|
| }
|
faces-config.xml extract...
| <navigation-rule>
|
| <navigation-case>
| <from-outcome>login</from-outcome>
| <to-view-id>/home.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>register</from-outcome>
| <to-view-id>/register.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>password</from-outcome>
| <to-view-id>/password.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>main</from-outcome>
| <to-view-id>/main.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| <navigation-case>
| <from-outcome>hotel</from-outcome>
| <to-view-id>/hotel.xhtml</to-view-id>
| <redirect />
| </navigation-case>
|
| </navigation-rule>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994238#3994238
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994238
19 years, 4 months
[JBoss Seam] - Re: Seam 1.1.5 & SeamSecurity...
by sherkan777
I got another question....it is posible to run those SeamSecurity example?
When I deploy project I get an Error:
| 15:42:47,234 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
| 15:42:47,250 ERROR [[/seam-security]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.NullPointerException
| at org.jboss.seam.util.Conversions$FlatPropertyValue.isExpression(Conversions.java:240)
| at org.jboss.seam.Component.getInitialValue(Component.java:357)
| at org.jboss.seam.Component.initInitializers(Component.java:341)
| at org.jboss.seam.Component.<init>(Component.java:248)
| at org.jboss.seam.Component.<init>(Component.java:193)
|
I think Seam needs somethink : java.lang.NullPointerException
I got jboss-seam.jar in ear file and
el-api.jar
el-ri.jar
jsf-facelets.jar int WEB-INF/lib
jboss-seam.jar is form Beta 1 version.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994236#3994236
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994236
19 years, 4 months