public abstract class WebApplication extends Object
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_BEAN_NAME |
protected TextResolver[] |
textResolvers |
Modifier | Constructor and Description |
---|---|
protected |
WebApplication() |
Modifier and Type | Method and Description |
---|---|
void |
addJavascriptCall(javax.faces.context.FacesContext fc,
String function) |
void |
destroy() |
static javax.faces.component.UIComponent |
findChildComponent(javax.faces.component.UIComponent parent,
String componentId)
finds a child component with the given id that is located below the given parent component
|
javax.faces.component.UIComponent |
findComponent(javax.faces.context.FacesContext fc,
String componentId,
javax.faces.component.UIComponent nearComponent)
finds the component with the given id that is located in the same NamingContainer as a given component
|
protected abstract DataSource |
getAppDataSource(DBDatabase db) |
protected Connection |
getConnection(DBDatabase db)
returns a connection from the connection pool
|
Connection |
getConnectionForRequest(javax.faces.context.FacesContext fc,
DBDatabase db)
returns a connection for the current Request
|
Locale |
getContextLocale(javax.faces.context.FacesContext ctx)
returns the active locale for a given FacesContext
|
String |
getDefaultControlType(DataType dataType)
returns the default input control type for a given data Type
|
FacesImplementation |
getFacesImplementation()
return the interface for Implementation specific features
that are specific for Mojarra or MyFaces
|
static WebApplication |
getInstance() |
String |
getPartialSubmitComponentId(javax.faces.context.FacesContext fc)
returns the componentId for which a partial submit has been performed.
|
TextResolver |
getTextResolver(javax.faces.context.FacesContext ctx) |
TextResolver |
getTextResolver(Locale locale) |
String |
getWebRoot()
returns the web context path as returned from ServletContext.getContextPath()
|
boolean |
hasError(javax.faces.context.FacesContext fc)
checks if the current context contains an error
|
void |
init(FacesImplementation facesImpl,
javax.faces.context.FacesContext startupContext)
Init the Application
|
protected abstract void |
init(javax.servlet.ServletContext servletContext) |
protected void |
initTextResolvers(javax.faces.application.Application app) |
boolean |
isPartialSubmit(javax.faces.context.FacesContext fc)
returns true if a form input element has been partially submitted
|
void |
onChangeView(javax.faces.context.FacesContext fc,
String viewId)
handle view change
|
void |
onRequestComplete(javax.faces.context.FacesContext ctx)
handle request cleanup
|
void |
onViewNotFound(javax.faces.context.FacesContext fc,
javax.servlet.http.HttpServletRequest req)
handle view not found
|
void |
releaseAllConnections(javax.faces.context.FacesContext fc) |
void |
releaseAllConnections(javax.faces.context.FacesContext fc,
boolean commit)
releases the current request connection
|
protected void |
releaseConnection(DBDatabase db,
Connection conn,
boolean commit)
releases a connection from the connection pool
|
void |
releaseConnection(javax.faces.context.FacesContext fc,
DBDatabase db) |
void |
releaseConnection(javax.faces.context.FacesContext fc,
DBDatabase db,
boolean commit) |
public static String APPLICATION_BEAN_NAME
protected TextResolver[] textResolvers
public static WebApplication getInstance()
protected abstract void init(javax.servlet.ServletContext servletContext)
protected abstract DataSource getAppDataSource(DBDatabase db)
public final void init(FacesImplementation facesImpl, javax.faces.context.FacesContext startupContext)
servletContext
- public void destroy()
public void onRequestComplete(javax.faces.context.FacesContext ctx)
ctx
- public void onViewNotFound(javax.faces.context.FacesContext fc, javax.servlet.http.HttpServletRequest req)
fc
- HttpServletRequest
- public void onChangeView(javax.faces.context.FacesContext fc, String viewId)
fc
- viewId
- public void addJavascriptCall(javax.faces.context.FacesContext fc, String function)
public FacesImplementation getFacesImplementation()
public String getWebRoot()
public Locale getContextLocale(javax.faces.context.FacesContext ctx)
public TextResolver getTextResolver(Locale locale)
public TextResolver getTextResolver(javax.faces.context.FacesContext ctx)
public boolean hasError(javax.faces.context.FacesContext fc)
fc
- the FacesContextpublic boolean isPartialSubmit(javax.faces.context.FacesContext fc)
fc
- the Faces Contextpublic String getPartialSubmitComponentId(javax.faces.context.FacesContext fc)
fc
- the Faces Contextpublic javax.faces.component.UIComponent findComponent(javax.faces.context.FacesContext fc, String componentId, javax.faces.component.UIComponent nearComponent)
fc
- the FacesContextcomponentId
- the component idnearComponent
- a component within the same naming container from which to start the search (optional)public static javax.faces.component.UIComponent findChildComponent(javax.faces.component.UIComponent parent, String componentId)
parent
- the parentcomponentId
- the component idpublic String getDefaultControlType(DataType dataType)
dataType
- InputControlManager
protected void initTextResolvers(javax.faces.application.Application app)
protected Connection getConnection(DBDatabase db)
protected void releaseConnection(DBDatabase db, Connection conn, boolean commit)
public Connection getConnectionForRequest(javax.faces.context.FacesContext fc, DBDatabase db)
public void releaseAllConnections(javax.faces.context.FacesContext fc, boolean commit)
fc
- the FacesContextcommit
- when true changes are committed otherwise they are rolled backpublic void releaseAllConnections(javax.faces.context.FacesContext fc)
public void releaseConnection(javax.faces.context.FacesContext fc, DBDatabase db, boolean commit)
public void releaseConnection(javax.faces.context.FacesContext fc, DBDatabase db)
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.