Products
About Guided Tour Online Demo Trial Version Requirements
Resources
Documents Configuration examples TagLib Reference Useful Links
Customer Support
Updates Forums Contact Services
Sales
Licensing Sales FAQ Buy Online
 
 
 
buy online   |   about us   |   german version  

» 1. Registration of the Painterfactory

The registration of the Painterfactory takes place first. It defines which design the user interface will get. This can be done across the application in the init()-method of the Frontcontroler-Servlet.1 Here, we select the standard design that the DefaultPainter offers us.2

import javax.servlet.ServletException

import org.apache.struts.action.ActionServlet;
import com.cc.framework.ui.painter.PainterFactory
import com.cc.framework.ui.painter.def.DefPainterFactory;
import com.cc.framework.ui.painter.html.HtmlPainterFactory;

public class MyFrontController extends ActionServlet {


    public void init() throws ServletException {

        super.init();

        // Register all Painter Factories
        // with the preferred GUI-Layout
        // In this case we only use the Default-Layout.
        PainterFactory.registerApplicationPainter (
            getServletContext(), DefPainterFactory.instance());
        PainterFactory.registerApplicationPainter (
            getServletContext(), HtmlPainterFactory.instance());
    }
}

*1) If it has to be possible for the individual user to choose between different interface designs, then additional PainterFactorys are registered in the user session. This is done mostly in the LoginAction with PainterFactory.registerSessionPainter() in the session Scope.

*2) Additional designs (PainterFactories) are included in the kit of the Professional Edition, or you can develop them yourself.

back   |   continue to step 2

Impressum | This product includes software developed by the Java Apache Project
Tours
ListControl TreeControl TreeListControl TabSetControl Form Tags MenuControl Print version Configuration