use of contextfilter.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

use of contextfilter.java

nachi19-2
Hi
   can anyone give the brief description of contextfilter.java .. what is its purpose ... and what task it does...
Reply | Threaded
Open this post in threaded view
|

Re: use of contextfilter.java

Adrian Crum
http://java.sun.com/blueprints/corej2eepatterns/Patterns/InterceptingFilter.html


nachi19 wrote:
> Hi
>    can anyone give the brief description of contextfilter.java .. what is
> its purpose ... and what task it does...
Reply | Threaded
Open this post in threaded view
|

Re: use of contextfilter.java

Nalin Chandra
In reply to this post by nachi19-2
Hi

I think you want to know about use contextfilter.java in ofbiz application.

This file is use to set the context path, initial parameter for our servlet.
you go through the code written in the contextfilter.java file as well as with logs.

few log statement is following:-
-12-12 09:15:59,881 (main) [      ContextFilter.java:297:INFO ] Adding web.xml context-param to application attribute with name [entityDelegatorName] and value [default]
-12-12 09:15:59,881 (main) [      ContextFilter.java:297:INFO ] Adding web.xml context-param to application attribute with name [localDispatcherName] and value [example]
======OFBIZ HOME===========  D:\demoappwithvisitorstat
 is the path information   : D:\demoappwithvisitorstat\framework\example\webapp\example\index.jsp
-12-12 09:15:59,881 (main) [      ContextFilter.java:257:INFO ] [ContextFilter.init] Getting Entity Engine Delegator with delegator name default


 
nachi19 wrote
Hi
   can anyone give the brief description of contextfilter.java .. what is its purpose ... and what task it does...
Reply | Threaded
Open this post in threaded view
|

Re: use of contextfilter.java

Ashish Nagar
nalin chandra wrote:

> Hi
>
> I think you want to know about use contextfilter.java in ofbiz application.
>
> This file is use to set the context path, initial parameter for our servlet.
> you go through the code written in the contextfilter.java file as well as
> with logs.
>
> few log statement is following:-
> -12-12 09:15:59,881 (main) [      ContextFilter.java:297:INFO ] Adding
> web.xml context-param to application attribute with name
> [entityDelegatorName] and value [default]
> -12-12 09:15:59,881 (main) [      ContextFilter.java:297:INFO ] Adding
> web.xml context-param to application attribute with name
> [localDispatcherName] and value [example]
> ======OFBIZ HOME===========  D:\demoappwithvisitorstat
>  is the path information   :
> D:\demoappwithvisitorstat\framework\example\webapp\example\index.jsp
> -12-12 09:15:59,881 (main) [      ContextFilter.java:257:INFO ]
> [ContextFilter.init] Getting Entity Engine Delegator with delegator name
> default
>
>
>  
>
> nachi19 wrote:
>  
>> Hi
>>    can anyone give the brief description of contextfilter.java .. what is
>> its purpose ... and what task it does...
>>
>>    
>
>  
Hi,
Contextfilter.java in ofbiz application is a java class which has
implemented Filter interface.I think the purpose of a Filter is to
filter the requests sent to server.This is used when either you want to
restrict request to some specific pages or you want to move request to
some page.We define the values of variable used in our Filter class ,in
web.xml. The values like available paths, error-code et.c. can be
defined in web.xml so that our filter can use those values throughout
the context.
I would suggest you to go through the ContextFilter.java file along with
web.xml.

Regards:
Ashish Nagar
Reply | Threaded
Open this post in threaded view
|

Re: use of contextfilter.java

Amit Sharma-10
In reply to this post by nachi19-2
Hi,

In OFBiz application, if you give url like
http://localhost:8080/<application-name>/<unknown-request> will be
redirected to the redirectPath specified in Web.xml. In that case,
ContextFilter filter out the request and use this redirect path to
redirect the request. this file is responsible for redirecting the
response to control/main.

Thanks and Regards
Amit Sharma

nachi19 wrote:
> Hi
>    can anyone give the brief description of contextfilter.java .. what is
> its purpose ... and what task it does...
>