org.tonjac.mini
Class DefaultWebApplication
java.lang.Object
org.tonjac.mini.DefaultWebApplication
- All Implemented Interfaces:
- RenderService
public class DefaultWebApplication
- extends java.lang.Object
- implements RenderService
Service mapper using .mini configurationfile that maps services to renders.
Rendering is done with org.tonjac.mini.GenericRender so you don't have
to write any render classes.Subclass this class and name your class with the
name you want to use in the URL to access your webapplication.
Example:
public class MyWebapp extends DefaultWebApplication
{ // No implementation needed, everything is done by the base class
}
accessed with the following URL:
http://yourhost:800/cgi-bin/MyWebapp.class?svc=MyService
map MyService to renders, data services and error handling and rendering in a file
called MyWebapp.class.mini:
[services]
MyService.renderName=MyRender
MyService.output=text/html; charset=UTF-8
MyService.errorRender=MyErrorRender
MyService.errorRollback=1
MyService.errorOutput=text/html; charset=UTF-8
[renders]
MyRender.renderBefore.1=MyTopRender
MyRender.renderAfter.1=MyBottomRender
MyRender.template=MyRender.html
MyRender.tableService.1=MyTableData
MyRender.tableName.1=table1
MyRender.tableService.2=MyTable2Data
MyRender.tableName.2=table2
MyRender.fieldService.1=MyFieldData
MyTopRender.template=MyTopRender.html
MyTopRender.fieldService.1=MyTopData
MyBottomRender.template=MyBottomRender.html
MyBottomRender.fieldService.1=MyBottomData
MyErrorRender.template=Error.html
MyErrorRender.fieldService.1=org.tonjac.mini.DefaultErrorData
- Author:
- Toni Thomsson
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultWebApplication
public DefaultWebApplication()
execute
public RenderServiceReply execute(Session session,
java.util.Properties params)
throws java.lang.Exception
- Called by Mini when the webapp is called from the browser
- Specified by:
execute in interface RenderService
- Parameters:
session - Sessionparams - CGI parameters
- Returns:
- Rendered service reply
- Throws:
java.lang.Exception