|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjet.servlet.JetContext
public class JetContext
Class providing new context object
Field Summary | |
---|---|
private JetAction |
action
Holds the current jetAction |
private java.util.TreeMap |
attributes
Holds the attributes set on this context |
private boolean |
contentTypeSet
|
private JetData |
data
Holds the current JetData |
private JetForm |
form
Holds the current jet action form |
static java.lang.String |
KEY
Provids key for session context |
private JetRenderer |
renderer
renderer to use |
private JetRequest |
request
Holds the http request |
private JetResponse |
response
Holds the http response object |
private JetServlet |
servlet
Holds the servlet wrapper object |
Constructor Summary | |
---|---|
JetContext()
Constrcutor() |
|
JetContext(JetServlet servlet,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Constructor(identifier) |
Method Summary | |
---|---|
java.lang.Object |
clone()
Method to support cloning |
void |
dispatch(java.lang.String url)
|
JetAction |
getActionByUrl(java.lang.String url)
returns action for the given url |
java.lang.Object |
getAttribute(java.lang.String key)
Returns a JetContext attribute |
java.util.Iterator |
getAttributeNames()
Returns the attribute names as Iteration |
java.util.TreeMap |
getAttributes()
Returns all attributes of this context |
java.lang.String |
getContextPath()
Returns the context path |
JetForm |
getFormByID(java.lang.String formId)
Returns the JetForm object to the url |
JetForm |
getFormByUrl(java.lang.String jetActionUrl)
Returns the JetForm object to the url |
java.lang.String |
getIdentifier()
Returns the identifier |
JetAction |
getJetAction()
Returns the JetAction |
JetData |
getJetData()
Returns the JetData |
JetForm |
getJetForm()
Returns the form for the action called |
JetRenderer |
getRenderer()
Method to get Renderer to use |
JetRequest |
getRequest()
Returns the servlet request object |
JetResponse |
getResponse()
Returns the response object |
JetServlet |
getServlet()
Returns the JetServlet object |
javax.servlet.ServletConfig |
getServletConfig()
Returns the servlet config |
javax.servlet.ServletContext |
getServletContext()
Returns the Servlet context object |
javax.servlet.http.HttpSession |
getSession()
Returns the session object |
javax.servlet.http.HttpSession |
getSession(boolean create)
Returns http session and if no one exists, creates one |
freemarker.template.Configuration |
getTemplateEngine()
returns the servlet template engine |
void |
init(JetServlet servlet,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
init method to set all necessary objects |
protected boolean |
isContentTypeSet()
|
protected boolean |
isSessionDebug()
indocates if the servlet context is in debug modus |
protected void |
pushBackAction(Poolable p)
Method to return used actions |
void |
pushBackForm(Poolable p)
Method to return use forms |
void |
redirect(java.lang.String url)
|
void |
render(byte[] bytes)
Method to render byte array |
void |
render(byte[] bytes,
java.lang.String conntentType)
Method to render byte array |
void |
render(JetData data,
java.lang.String templatename)
Method to render a template to response |
void |
render(JetData data,
java.lang.String templatename,
java.lang.String contentType)
Method to render a template to response |
void |
reset()
Method to reset the context |
void |
sendError(int i)
|
void |
sendError(int i,
java.lang.String x)
|
void |
sendRedirect(java.lang.String url)
|
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Set an attribute with the given value to the given key |
void |
setAttributes(java.util.TreeMap attrs)
Set attributes this context |
protected void |
setContentTypeSet(boolean contentTypeSet)
|
void |
setJetAction(JetAction action)
Set the action |
void |
setJetData(JetData data)
Set the data structure |
void |
setJetForm(JetForm form)
Set the action form |
private void |
setRequest(JetRequest request)
Set the request object |
private void |
setResponse(JetResponse response)
Set the reponse object |
void |
setServlet(JetServlet servlet)
Set the servlet |
protected void |
setSessionDebug(boolean debug)
Set the debug flag |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEY
private boolean contentTypeSet
private JetServlet servlet
private JetAction action
private JetForm form
private JetRenderer renderer
private JetData data
private JetRequest request
private JetResponse response
private java.util.TreeMap attributes
Constructor Detail |
---|
public JetContext()
public JetContext(JetServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
servlet
- servletrequest
- request objectresponse
- response object
java.io.IOException
Method Detail |
---|
public void init(JetServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
servlet
- servletrequest
- request objectresponse
- response object
java.io.IOException
public JetServlet getServlet()
public JetAction getJetAction()
public JetData getJetData()
public JetForm getJetForm()
public javax.servlet.ServletContext getServletContext()
public javax.servlet.ServletConfig getServletConfig()
public void setServlet(JetServlet servlet)
servlet
- servletpublic void setJetAction(JetAction action)
action
- actionpublic void setJetForm(JetForm form)
form
- public void setJetData(JetData data)
data
- datapublic JetRequest getRequest()
public javax.servlet.http.HttpSession getSession()
HttpServletRequest.getSession(boolean)
public javax.servlet.http.HttpSession getSession(boolean create)
HttpServletRequest.getSession(boolean)
public freemarker.template.Configuration getTemplateEngine()
public java.lang.String getContextPath()
HttpServletRequest.getContextPath()
private void setRequest(JetRequest request)
request
- requestpublic JetResponse getResponse()
private void setResponse(JetResponse response)
response
- reponsepublic java.lang.Object getAttribute(java.lang.String key)
key
- key
public java.util.TreeMap getAttributes()
public void setAttributes(java.util.TreeMap attrs)
attrs
- attributepublic void setAttribute(java.lang.String key, java.lang.Object value)
key
- keyvalue
- valuepublic java.util.Iterator getAttributeNames()
protected boolean isSessionDebug()
protected void setSessionDebug(boolean debug)
debug
- debug flagpublic java.lang.String getIdentifier()
getIdentifier
in interface Identifiable
public java.lang.Object clone()
clone
in class java.lang.Object
public void reset()
reset
in interface Resetable
public final void render(JetData data, java.lang.String templatename) throws JetActionException, java.io.IOException
data
- the TreeMap with data structure to usetemplatename
- the name of the template to render
JetActionException,IOException
JetActionException
java.io.IOException
public final void render(JetData data, java.lang.String templatename, java.lang.String contentType) throws JetActionException, java.io.IOException
data
- the TreeMap with data structure to usetemplatename
- the name of the template to render
JetActionException,IOException
JetActionException
java.io.IOException
public final void render(byte[] bytes) throws java.io.IOException
bytes
- the bytes to render
java.io.IOException
public final void render(byte[] bytes, java.lang.String conntentType) throws java.io.IOException
bytes
- the bytes to render
java.io.IOException
public JetForm getFormByUrl(java.lang.String jetActionUrl) throws NotFoundException
jetActionUrl
- url
NotFoundException
public JetForm getFormByID(java.lang.String formId) throws NotFoundException
formId
- identifier
NotFoundException
public JetAction getActionByUrl(java.lang.String url) throws JetActionException
url
- teh url
JetActionException
protected void pushBackAction(Poolable p)
public void pushBackForm(Poolable p)
public JetRenderer getRenderer()
protected boolean isContentTypeSet()
protected void setContentTypeSet(boolean contentTypeSet)
public void sendRedirect(java.lang.String url) throws java.io.IOException
java.io.IOException
public void sendError(int i, java.lang.String x) throws java.io.IOException
java.io.IOException
public void sendError(int i) throws java.io.IOException
java.io.IOException
public void redirect(java.lang.String url) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void dispatch(java.lang.String url) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |