I'm replacing part of a struts web application with Seam and I'm having some 
strange problems with pages.xml

Problem one: I have a pages.xml that runs an action on pageload that grabs some 
request values and stores them in a session scoped Seam component so that I can 
use them later. However, when I preform any action on said page that would 
navigate me to a new page, the action defined for this page runs again. Since 
the request parameters are now lost, this results in all the values in my bean 
being nulled out, and my application throws null pointer exceptions.

pages.xml

   <page view-id="/ben/infozap.xhtml" 
action="#{infozapAction.createInfoZapDTO}"/>


InfoZap action:
@Stateless
@Name("infozapAction")
@Interceptors(SeamInterceptor.class)
public class InfozapActionImpl implements InfozapAction
{
    @RequestParameter
    String[] schoolList;
    
    @RequestParameter
    String productAreaID;
    
    @RequestParameter
    String infozapType;
    
    @RequestParameter
    String productTypeID;
    
    @Out
    private InfoZapDTO izdto;
    
    //@In(create=true) 
    //private Redirect redirect;
            
    public void createInfoZapDTO()
    {
        izdto = new InfoZapDTO();
        
        if(schoolList != null)
        {
            izdto.setSchoolList(schoolList);
        }
        
        if(productAreaID != null)
        {
            izdto.setProductAreaID(productAreaID);
        }
        
        if(infozapType != null)
        {
            izdto.setInfozapType(infozapType);
        }
        
        if(productTypeID != null)
        {
            izdto.setProductTypeID(productTypeID);
        }
        //redirect.setViewId("/ben/infozap.jsf");
        //redirect.execute();
    }    
}

infozap.xhtml
...
<h:commandButton action="#{someActionClass.someAction}"/>
...

Problem two: In light of the above, I made a dummy page and edited the URL 
pattern in pages.xml to fire my action when the dummy page is navigated to. I 
edited the action to redirect to the correct page after it grabs the request 
values. I can see in my code that the method is fired, but even though I 
outject the member variable, after the redirect, it's no longer available

pages.xml

   <page view-id="/ben/test.xhtml" action="#{infozapAction.createInfoZapDTO}"/>


InfoZap action:
same as above with redirect lines uncommented

Any help would be greatly appreciated.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3956646#3956646

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956646


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to