|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.servlet.JcmsServletFilter com.jalios.jcms.servlet.InitFilter
public class InitFilter
Field Summary | |
---|---|
protected String[] |
authorizedServlets
|
protected static Channel |
channel
|
protected javax.servlet.ServletContext |
context
|
protected static org.apache.log4j.Logger |
logger
|
static String |
REVISION
|
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Constructor Summary | |
---|---|
InitFilter()
|
Method Summary | |
---|---|
protected boolean |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Call the authentication manager to authenticate member. |
protected boolean |
blockSiteAccess(String uri,
String warningMsg,
String[] authJSP,
Member loggedMember,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected boolean |
checkChannelAvailability(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
Check if the channel is available and redirect to the proper JSP on error. |
protected static String |
checkLang(javax.servlet.http.HttpServletRequest request,
String lang)
Check if the given language is a valid choice for the current request. |
protected boolean |
checkSiteAccess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Check basic parameter required by JCMS to allow acces to the site: - Private Site and member not logged - URID Missing - Default Workspace missing - Default Portal missing |
protected void |
clearThreadRequest()
Clear the current HttpServletRequest from the ThreadLocal. |
protected void |
clearThreadResponse()
Clear the current HttpServletResponse from the ThreadLocal. |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
protected void |
endRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
static String |
getUserLang(javax.servlet.http.HttpServletRequest request,
Member loggedMember)
Retrieve the user lang to use for the current request given the currently loggedMember. |
static Locale |
getUserLocale(javax.servlet.http.HttpServletRequest request,
Member loggedMember)
Retrieve the Locale to use for the current request given the currently loggedMember. |
void |
init(javax.servlet.FilterConfig config)
|
protected void |
initLogging(javax.servlet.http.HttpServletRequest request)
Initialize log4j MDC and NDC with available value, that is Channel Name and unauthenticated user |
static void |
initMemberRequest(javax.servlet.http.HttpServletRequest request,
Member loggedMember,
Locale userLocale)
Initializes tracking of the given member using JcmsSessionTracker and add request attributes ("loggedMember", "userLang", "userCountry", "userLocale") used in jsp and in JcmsContext. |
static void |
initMemberRequest(javax.servlet.http.HttpServletRequest request,
Member loggedMember,
String userLang)
Deprecated. use initMemberRequest(HttpServletRequest, Member, Locale) |
protected void |
invalidateSessionIfRequested(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
static void |
invalidateSessionOnRequestEnd(javax.servlet.http.HttpServletRequest request)
Invalidate the current session, but only at the end of the request to ensure the J2EE server does not recreates a new one which is left unused if no request occurs afterward. |
protected boolean |
isPublicPath(String path)
Check if the specified path is allowed to be accessed without authentication when the site is private. |
static boolean |
isRest(javax.servlet.http.HttpServletRequest request)
|
protected boolean |
isValidJSyncFileAccess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Check if the request is a JSync file access. |
static boolean |
sessionInvalidationRequested(javax.servlet.http.HttpServletRequest request)
Check if an invalidation of the current session has been requested |
protected void |
storeBrowserInformation(javax.servlet.http.HttpServletRequest request)
Store browser in current HttpSession to be later accessible by JcmsContext and JcmsSessionTracker. |
protected void |
storeThreadRequest(javax.servlet.http.HttpServletRequest request)
Store the current HttpServletRequest in a ThreadLocal later accessible through Channel.getCurrentServletRequest() |
protected void |
storeThreadResponse(javax.servlet.http.HttpServletResponse response)
Store the current HttpServletResponse in a ThreadLocal later accessible through Channel.getCurrentServletResponse() |
static void |
updateUserLanguage(javax.servlet.http.HttpServletRequest request,
String language)
Change the language of the specified request using the new specified language |
Methods inherited from class com.jalios.jcms.servlet.JcmsServletFilter |
---|
endFilter, initJSONBridge, processFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected static final org.apache.log4j.Logger logger
protected static Channel channel
protected javax.servlet.ServletContext context
protected String[] authorizedServlets
Constructor Detail |
---|
public InitFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig config)
init
in interface javax.servlet.Filter
public void destroy()
destroy
in interface javax.servlet.Filter
public static final boolean isRest(javax.servlet.http.HttpServletRequest request)
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
protected void endRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static void invalidateSessionOnRequestEnd(javax.servlet.http.HttpServletRequest request)
request
- the current HttpServletRequestpublic static boolean sessionInvalidationRequested(javax.servlet.http.HttpServletRequest request)
request
- the current HttpServletRequest
invalidateSessionOnRequestEnd(HttpServletRequest)
was invoked, false otherwiseprotected void invalidateSessionIfRequested(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected boolean checkChannelAvailability(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException
request
- the current HttpServletRequestresponse
- the current HttpServletResponse
IOException
javax.servlet.ServletException
protected void initLogging(javax.servlet.http.HttpServletRequest request)
JcmsUtil.setLog4jMDC()
,
JcmsUtil.setLog4jNDCMemberInfo(HttpServletRequest, Member)
protected void storeThreadRequest(javax.servlet.http.HttpServletRequest request)
Channel.getCurrentServletRequest()
request
- the current HttpServletRequestprotected void clearThreadRequest()
protected void storeThreadResponse(javax.servlet.http.HttpServletResponse response)
Channel.getCurrentServletResponse()
response
- the current HttpServletResponseprotected void clearThreadResponse()
protected void storeBrowserInformation(javax.servlet.http.HttpServletRequest request)
request
- the current HttpServletRequestprotected boolean isValidJSyncFileAccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- the current HttpServletRequestresponse
- the current HttpServletResponse
protected boolean authenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
request
- the current HttpServletRequestresponse
- the current HttpServletResponse
IOException
public static void initMemberRequest(javax.servlet.http.HttpServletRequest request, Member loggedMember, String userLang)
initMemberRequest(HttpServletRequest, Member, Locale)
request
- the current HttpServletRequestloggedMember
- the Member currently loggeduserLang
- the user languagepublic static void initMemberRequest(javax.servlet.http.HttpServletRequest request, Member loggedMember, Locale userLocale)
request
- the current HttpServletRequestloggedMember
- the Member currently loggeduserLocale
- the Locale of the user for this requestpublic static void updateUserLanguage(javax.servlet.http.HttpServletRequest request, String language)
request
- the current request to changelanguage
- the new language to apply to the request (null to left untouched)public static String getUserLang(javax.servlet.http.HttpServletRequest request, Member loggedMember)
request
- the current HttpServletRequestloggedMember
- the Member currently logged
public static Locale getUserLocale(javax.servlet.http.HttpServletRequest request, Member loggedMember)
request
- the current HttpServletRequestloggedMember
- the Member currently logged
protected static String checkLang(javax.servlet.http.HttpServletRequest request, String lang)
request
- the current HttpServletRequestlang
- the lang to checkprotected boolean checkSiteAccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
request
- the current HttpServletRequestresponse
- the current HttpServletResponse
IOException
protected boolean isPublicPath(String path)
path
- the resource path of the cu
protected boolean blockSiteAccess(String uri, String warningMsg, String[] authJSP, Member loggedMember, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |