Our first Application

As you can see we just need add a Java Class named for example as HomeController and it will be able to call though URL arguments

The Index function may or not has those arguments if you wish you just can define it as Index()


// Code01 - Hello world in JxMVC 1.0
//
package jxmvc.controllers;

import jxmvc.*;
import jxmvc.base.*;

public class HomeController extends JxController
{
    // EntryPoint - Minimal Controller
    //
    public void Index()
    {
        view.print( "I'm in index() func" );

        // render a JSP with void func()
        // view.Load( "myJspFile" );
    }
}
                    


Reading Post values

It has implemented anti XSS & SQL Injection Routines for safe, avoiding ciberijection codes.


// Code02 - Reading values & send it to JSP
//
package jxmvc.controllers;

import jxmvc.*;
import jxmvc.base.*;

public class HomeController extends JxController
{
    ...

    public IAction Login()
    {
        // storing in model & local XSS safe reading
        //
        model.SetVar( "user", LxPost( "user" ) );
        
        // return View( "dlg/login" );
        return Layer( "panel", "innLogin" );
    }
}