3 Replies Latest reply on Mar 6, 2008 5:58 AM by leowenttechie

    Extend SeamApplication

    leowenttechie

      I want to extend SeamApplication class. Well writing a class extending that is not an issue :) what I am asking is how do register in my web application so that the constructor gets called.

        • 1. Re: Extend SeamApplication
          leowenttechie

          My class looks like this



          public class Application extends SeamApplication
          {
          
               public Application( Application application )
               {
                    super( application );
                    // TODO Auto-generated constructor stub
               }
               
               @Override
               public ExpressionFactory getExpressionFactory()
               {
                    return application.getExpressionFactory();
               }
          }


          • 2. Re: Extend SeamApplication
            keithnaas

            The application object is instantiated by an ApplicationFactoryand that is controlled within faces-config.xml.


            <factory>
               <application-factory>org.jboss.seam.jsf.SeamApplicationFactory</application-factory>
            </factory>
            



            What is the different behavior you are adding in the custom Application class?  Its possible it can be done without needing to override the ApplicationFactory.

            • 3. Re: Extend SeamApplication
              leowenttechie

              What I want si that to override the getExpressionFactory() method so that I can use my own ExpressionFactory instance instead of one provided by seam.


              One more thing I want context.getApplication() to return my Application directly and not SeamApplication instance on which i have to call getDelegate to get my Application instance. Because this is causing is a lot of problems from the JSF API code.
              The same thing was working properly with Seam 1.2 because all the Methods were registered there in SeamApplication.java


              One small doubt Can I declare more than one ApplicationFactory in face-config.xml?