| java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet dinamica.Controller
Controller | public class Controller extends HttpServlet (Code) | | Central controller to dispatch all requests
recevied by a Web Application built with this framework.
This class represents the Coordinator of all activities in
the application, it is the base for the advanced MVC mechanism implemented
by this framework. This servlet should be configured in WEB.XML to intercept
requests targeting /trans/... URLs.
The application template provided with the framework includes all
the required configuration settings in WEB.XML, use that as a starting
point for your own applications.
Please read the Howto documents and technical articles included with
this framework in order to understand and master the inner working mechanisms
of the framework and the role of this servlet in particular.
Creation date: 3/10/2003
Last Update: 3/10/2003
(c) 2003 Martin Cordova
This code is released under the LGPL license
author: Martin Cordova |
Method Summary | |
void | forward(String uri, HttpServletRequest req, HttpServletResponse res) | Object | getObject(String className) PATCH 2005-01-24 - Loads class and returns new instance of this class.
Solves sporadic Class not found exceptions when running with Resin 2.1.14 + IBM JDK 1.4.2.
This method attempts to use context class loader, if fails it will use Class.forName(). | String | getPath(HttpServletRequest req) Extract path begining with /trans/... | public void | init() | String | replaceMacros(HttpServletRequest req, String xmlData) | void | saveLog(String message) | protected void | service(HttpServletRequest req, HttpServletResponse res) | void | setRequestValues(HttpServletRequest req, Config config) | Recordset | validateInput(HttpServletRequest req, Config config, Connection conn, boolean jdbcLog, PrintWriter jdbcLogPrinter) |
_fileEncoding | String _fileEncoding(Code) | | default app-level file encoding
|
_jndiPrefix | String _jndiPrefix(Code) | | JNDI prefix (java:comp/env/ or "")
|
_logFile | String _logFile(Code) | | trace log file for requests and JDBC
|
_requestEncoding | String _requestEncoding(Code) | | default app-level request encoding
|
_validationErrorAction | String _validationErrorAction(Code) | | validation error action URI
|
getObject | Object getObject(String className) throws Throwable(Code) | | PATCH 2005-01-24 - Loads class and returns new instance of this class.
Solves sporadic Class not found exceptions when running with Resin 2.1.14 + IBM JDK 1.4.2.
This method attempts to use context class loader, if fails it will use Class.forName().
Parameters: className - Name of class to load - include full package name New instance of the class throws: Throwable - (ClassNotFound exceptions) |
init | public void init() throws ServletException(Code) | | Controller initialization tasks.
Reads parameters jndi-prefix and def-datasource
and creates a default datasource object with
modular scope to be used by all threads from this servlet
|
replaceMacros | String replaceMacros(HttpServletRequest req, String xmlData) throws Throwable(Code) | | Replace markers like ${def:actionroot} in config.xml
Parameters: req - Request object Parameters: xmlData - Body of config.xml Body of config.xml with all markers replaced by the corresponding values throws: Throwable - |
saveLog | void saveLog(String message)(Code) | | Save message to filesystem, using the context parameter
log-file defined in web.xml and stored in modular variable _logFile
Parameters: message - String to append to file |
validateInput | Recordset validateInput(HttpServletRequest req, Config config, Connection conn, boolean jdbcLog, PrintWriter jdbcLogPrinter) throws Throwable(Code) | | Auto-Validate request parameters for single value
parameters - array parameters must be processed
by the business logic using the Servlet Request object
Parameters: req - Servlet Request Parameters: config - Configuration for the current Action throws: Throwable - If any validation rule is violated |
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|