package e4s.tutorial; import e4s.html.*; import e4s.servlet.*; import java.io.*; import java.util.*; import java.text.*; /** * Handling object parameters from one CGI call to another. * * {@tutorial Example_ObjectParameters} */ public class Example_ObjectParameters extends E4ModuleImplementation { public static E4Method objectParameterHandling = null; public static E4Method receivedParameters = null; public void objectParameterHandling(HTML html) { BODY body = html.BODY(); A href = body.A(receivedParameters); PersonObject person = new PersonObject(); person.m_name = "Robert"; person.m_age = 35; person.m_gender = true; href.addParameterObj(person,"PERSON"); href.print("[click here to continue]"); } public void receivedParameters(HTML html, E4CgiParams params) { BODY body = html.BODY(); body.println("The native parameter table looks like:"); TABLE table = body.TABLE(); table.setBorder(); table.setCellspacing(0,0); table.setBgColor(new E4Color(0xA0,0xA0,0xA0)); table.setBorderColor(E4Color.RED); params.toTable(table); PersonObject person = new PersonObject(); params.get(person,"PERSON"); body.P(); body.println("The PersonObject variable now looks like:"); body.BR(); body.println(person.toString()); } }