|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet com.taursys.servlet.ServletApp
ServletApp functions as a main servlet which dispatches requests to registered ServletForms. This ServletApp uses a ServletFormFactory to create, recycle, pool and parse url's for ServletForms.
You should override the init method to register the virtual path's and ServletForms' package names for your application. You should also set the ServletFormFactory's defaultClassLoader if mapperxml.jar is in a common path rather than part of your application distribution.
The ServletApp routes all doPost requests to the doGet methdod.
Below is an example of typical implementation:
public class MyMainServlet extends ServletApp { public void init(ServletConfig config) throws ServletException { super.init(config); getFactory().addPackage("/","com.taursys.examples.simpleweb"); getFactory().setDefaultFormName("com.taursys.examples.simpleweb.ShowHidePage"); getFactory().setDefaultClassLoader(getClass().getClassLoader()); // Set default logging Debug.setLoggerAdapter(new SimpleLogger(Debug.DEBUG)); } }
Constructor Summary | |
ServletApp()
|
Method Summary | |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes the HTTP Get request by dispatching it to a ServletForm. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process the HTTP Post request by invoking the doGet method. |
ServletFormFactory |
getFactory()
Gets the ServletFormFactory for this ServletApp. |
void |
setFactory(ServletFormFactory factory)
Sets the ServletFormFactory for this ServletApp. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ServletApp()
Method Detail |
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public ServletFormFactory getFactory()
public void setFactory(ServletFormFactory factory)
factory
- to use for this ServletApp
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |