• Welcome to KonaKart Community Forum. Please login or sign up.
 

Creating a new engine

Started by mtoon, May 09, 2008, 07:23:38 pm

Previous topic - Next topic

mtoon

Is it possible to descend from the com.konakart.app.KKEng class and update the konakart_app.properties to reflect that?

i.e.:
konakart.app.engineclass=com.my.engine.class

would the kkEng variable in all the JSPs be updated from this change?

Thank you!

mtoon

I actually figured this out... 

1) Created a new class that descended from KKEng
import com.konakart.app.*;

public class FDKKEng extends KKEng  {
   
    public FDKKEng() throws com.konakart.app.KKException {
        System.out.println("FDKKEng Constructor");
    }
   
    public FDKKEng(String value) throws com.konakart.app.KKException {
        System.out.println("FDKKEng Value Constructor: "+value);
    }
   
    public String getTestValue() {
        return "Test Value";
    }

}

2) Changed the konakart.app.engineclass to the new class.
3) Added the following to the JSPs..
        <bean:define id="fdEng" name="kkEng" property="eng" type="com.myclass.FDKKEng"/>

4) New instance can be accessed in the JSP like:
        <%=fdEng.getTestValue() %>