Re: How to make interceptor to be invoked only for HTTP Request not for Response
As per my understanding, your applciation might have configured the common interceptor stack for action classes, that is why for every action request..it is accessing the interceptor and u see the log msgs. -Thanks Uma Kagitha. From: Sreekanth S. Nair To: Struts Users Mailing List Sent: Tuesday, July 9, 2013 11:28 AM Subject: Re: How to make interceptor to be invoked only for HTTP Request not for Response Yes you are right Dave, let me recheck the scenario when my interceptor calls twice. -- Thanks & Regards Srikanth Software Developer eGovernments Foundations http://www.egovernments.org/ Mob : 9980078913 On Tue, Jul 9, 2013 at 8:46 PM, Dave Newton wrote: > What do you mean by "called while response"? Interceptors aren't called > twice, they wrap action invocation. > > Dave > On Jul 9, 2013 10:07 AM, "Sreekanth S. Nair" < > sreekanth.n...@egovernments.org> wrote: > > > I have a custom interceptor for trimming whitespaces in request data > > My intercept method is like below > > @Override > > public String intercept(final ActionInvocation invocation) throws > > Exception { > > // Get the action context from the invocation so we can access > the > > // HttpServletRequest and HttpSession objects. > > final HttpServletRequest request = (HttpServletRequest) > > invocation.getInvocationContext().get(HTTP_REQUEST); > > Map parameters = > invocation.getInvocationContext().getParameters(); > > parameters = this.getTrimmedParameters(request, parameters); > > invocation.getInvocationContext().setParameters(parameters); > > return invocation.invoke(); > > } > > > > but this interceptor is getting called while request as well as while > > coming back from my action (response). I dont want intercept method to be > > called while response. > > > > > > > > > > > > -- > > Thanks & Regards > > Srikanth > > Software Developer > > > > eGovernments Foundations > > www.egovernments.org > > Mob : 9980078913 > > > > > > > > On Tue, Jul 9, 2013 at 8:29 PM, Dave Newton > wrote: > > > > > It works precisely like a filter, there is code before and after > > > action.invoke, and before rendering with PreResultListeners. > > > > > > I don't understand the specific issue(s) you think you're having. What > > > problem are you having that you're trying to solve? > > > > > > Dave > > > On Jul 9, 2013 9:54 AM, "Sreekanth S. Nair" < > > > sreekanth.n...@egovernments.org> wrote: > > > > > > > I doubt struts2 interceptor work like a filter, just like in ur > pseudo > > > > code. In filter we can specify > > > > what to do with request and response by adding code before and > > > > after chain.doFilter(request, response). In Interceptor intercept > > method > > > > will always get executed before and after req & resp. > > > > > > > > > > > > > > > > > > > > -- > > > > Thanks & Regards > > > > Srikanth > > > > Software Developer > > > > > > > > eGovernments Foundations > > > > www.egovernments.org > > > > Mob : 9980078913 > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > > > > felipe.lor...@idealogic.com.br> wrote: > > > > > > > > > I dont think it is possible. But I believe you can just ignore the > > > > > response and do nothing with that. > > > > > > > > > > I am not sure if I understand your question. But an interceptor has > > > only > > > > > one call per request/response. So your code could like this: > > > > > > > > > > > > > > > public class Interceptor { > > > > > > > > > > method { > > > > > removeSpaceFromRequest(); > > > > > String resp = invoke(); > > > > > //here, you do nothing with the response. > > > > > return resp; > > > > > } > > > > > > > > > > } >
Re: How to make interceptor to be invoked only for HTTP Request not for Response
Yes you are right Dave, let me recheck the scenario when my interceptor calls twice. -- Thanks & Regards Srikanth Software Developer eGovernments Foundations www.egovernments.org Mob : 9980078913 On Tue, Jul 9, 2013 at 8:46 PM, Dave Newton wrote: > What do you mean by "called while response"? Interceptors aren't called > twice, they wrap action invocation. > > Dave > On Jul 9, 2013 10:07 AM, "Sreekanth S. Nair" < > sreekanth.n...@egovernments.org> wrote: > > > I have a custom interceptor for trimming whitespaces in request data > > My intercept method is like below > > @Override > > public String intercept(final ActionInvocation invocation) throws > > Exception { > > // Get the action context from the invocation so we can access > the > > // HttpServletRequest and HttpSession objects. > > final HttpServletRequest request = (HttpServletRequest) > > invocation.getInvocationContext().get(HTTP_REQUEST); > > Map parameters = > invocation.getInvocationContext().getParameters(); > > parameters = this.getTrimmedParameters(request, parameters); > > invocation.getInvocationContext().setParameters(parameters); > > return invocation.invoke(); > > } > > > > but this interceptor is getting called while request as well as while > > coming back from my action (response). I dont want intercept method to be > > called while response. > > > > > > > > > > > > -- > > Thanks & Regards > > Srikanth > > Software Developer > > > > eGovernments Foundations > > www.egovernments.org > > Mob : 9980078913 > > > > > > > > On Tue, Jul 9, 2013 at 8:29 PM, Dave Newton > wrote: > > > > > It works precisely like a filter, there is code before and after > > > action.invoke, and before rendering with PreResultListeners. > > > > > > I don't understand the specific issue(s) you think you're having. What > > > problem are you having that you're trying to solve? > > > > > > Dave > > > On Jul 9, 2013 9:54 AM, "Sreekanth S. Nair" < > > > sreekanth.n...@egovernments.org> wrote: > > > > > > > I doubt struts2 interceptor work like a filter, just like in ur > pseudo > > > > code. In filter we can specify > > > > what to do with request and response by adding code before and > > > > after chain.doFilter(request, response). In Interceptor intercept > > method > > > > will always get executed before and after req & resp. > > > > > > > > > > > > > > > > > > > > -- > > > > Thanks & Regards > > > > Srikanth > > > > Software Developer > > > > > > > > eGovernments Foundations > > > > www.egovernments.org > > > > Mob : 9980078913 > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > > > > felipe.lor...@idealogic.com.br> wrote: > > > > > > > > > I dont think it is possible. But I believe you can just ignore the > > > > > response and do nothing with that. > > > > > > > > > > I am not sure if I understand your question. But an interceptor has > > > only > > > > > one call per request/response. So your code could like this: > > > > > > > > > > > > > > > public class Interceptor { > > > > > > > > > > method { > > > > > removeSpaceFromRequest(); > > > > > String resp = invoke(); > > > > > //here, you do nothing with the response. > > > > > return resp; > > > > > } > > > > > > > > > > } > > > > > > > > > > Felipe Lorenz > > > > > Gerente de Projetos > > > > > Idealogic Software > > > > > Fone: (51) 3715 5523 - (51) 3715 5548 > > > > > www.idealogic.com.br > > > > > > > > > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > > > > > > > > > Yes, i have an Interceptor basically to Trimming of input > values, i > > > > don't > > > > > > want to do this to be happened while request coming back with > > > response. > > > > > > > > > > > > -- > > > > > > Thanks & Regards > > > > > > Srikanth > > > > > > Software Developer > > > > > > > > > > > > eGovernments Foundations > > > > > > www.egovernments.org > > > > > > Mob : 9980078913 > > > > > > > > > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > > > > > > > > > >> Any specific reason to do that? > > > > > >> --Original Message-- > > > > > >> From: Sreekanth S. Nair > > > > > >> To: Struts Users Mailing List > > > > > >> ReplyTo: Struts Users Mailing List > > > > > >> Subject: How to make interceptor to be invoked only for HTTP > > Request > > > > not > > > > > >> for Response > > > > > >> Sent: Jul 9, 2013 5:33 PM > > > > > >> > > > > > >> How to make interceptor to be invoked only for HTTP Request not > > for > > > > > >> Response > > > > > >> > > > > > >> > > > > > >> > > > > > >> Sent from BlackBerry® on Airtel > > > > > > > > > > > > > > > > > > > >
Re: How to make interceptor to be invoked only for HTTP Request not for Response
What do you mean by "called while response"? Interceptors aren't called twice, they wrap action invocation. Dave On Jul 9, 2013 10:07 AM, "Sreekanth S. Nair" < sreekanth.n...@egovernments.org> wrote: > I have a custom interceptor for trimming whitespaces in request data > My intercept method is like below > @Override > public String intercept(final ActionInvocation invocation) throws > Exception { > // Get the action context from the invocation so we can access the > // HttpServletRequest and HttpSession objects. > final HttpServletRequest request = (HttpServletRequest) > invocation.getInvocationContext().get(HTTP_REQUEST); > Map parameters = invocation.getInvocationContext().getParameters(); > parameters = this.getTrimmedParameters(request, parameters); > invocation.getInvocationContext().setParameters(parameters); > return invocation.invoke(); > } > > but this interceptor is getting called while request as well as while > coming back from my action (response). I dont want intercept method to be > called while response. > > > > > > -- > Thanks & Regards > Srikanth > Software Developer > > eGovernments Foundations > www.egovernments.org > Mob : 9980078913 > > > > On Tue, Jul 9, 2013 at 8:29 PM, Dave Newton wrote: > > > It works precisely like a filter, there is code before and after > > action.invoke, and before rendering with PreResultListeners. > > > > I don't understand the specific issue(s) you think you're having. What > > problem are you having that you're trying to solve? > > > > Dave > > On Jul 9, 2013 9:54 AM, "Sreekanth S. Nair" < > > sreekanth.n...@egovernments.org> wrote: > > > > > I doubt struts2 interceptor work like a filter, just like in ur pseudo > > > code. In filter we can specify > > > what to do with request and response by adding code before and > > > after chain.doFilter(request, response). In Interceptor intercept > method > > > will always get executed before and after req & resp. > > > > > > > > > > > > > > > -- > > > Thanks & Regards > > > Srikanth > > > Software Developer > > > > > > eGovernments Foundations > > > www.egovernments.org > > > Mob : 9980078913 > > > > > > > > > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > > > felipe.lor...@idealogic.com.br> wrote: > > > > > > > I dont think it is possible. But I believe you can just ignore the > > > > response and do nothing with that. > > > > > > > > I am not sure if I understand your question. But an interceptor has > > only > > > > one call per request/response. So your code could like this: > > > > > > > > > > > > public class Interceptor { > > > > > > > > method { > > > > removeSpaceFromRequest(); > > > > String resp = invoke(); > > > > //here, you do nothing with the response. > > > > return resp; > > > > } > > > > > > > > } > > > > > > > > Felipe Lorenz > > > > Gerente de Projetos > > > > Idealogic Software > > > > Fone: (51) 3715 5523 - (51) 3715 5548 > > > > www.idealogic.com.br > > > > > > > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > > > > > > > Yes, i have an Interceptor basically to Trimming of input values, i > > > don't > > > > > want to do this to be happened while request coming back with > > response. > > > > > > > > > > -- > > > > > Thanks & Regards > > > > > Srikanth > > > > > Software Developer > > > > > > > > > > eGovernments Foundations > > > > > www.egovernments.org > > > > > Mob : 9980078913 > > > > > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > > > > > > > >> Any specific reason to do that? > > > > >> --Original Message-- > > > > >> From: Sreekanth S. Nair > > > > >> To: Struts Users Mailing List > > > > >> ReplyTo: Struts Users Mailing List > > > > >> Subject: How to make interceptor to be invoked only for HTTP > Request > > > not > > > > >> for Response > > > > >> Sent: Jul 9, 2013 5:33 PM > > > > >> > > > > >> How to make interceptor to be invoked only for HTTP Request not > for > > > > >> Response > > > > >> > > > > >> > > > > >> > > > > >> Sent from BlackBerry® on Airtel > > > > > > > > > > > > > >
Re: How to make interceptor to be invoked only for HTTP Request not for Response
Interceptor are designed to work in this way.. They work in 2 steps pre-processing and post-processing.The time Interceptor is called in reverse order, response will already be with your client (Browser) Other option (not good) is to create a custom convertor where you can trim spaces. On Tue, Jul 9, 2013 at 8:41 PM, Sreekanth S. Nair < sreekanth.n...@egovernments.org> wrote: > No, I dont want a filter i want to make it done with strust2 interceptor > only, my question is how do we achieve this using an interceptor. > > -- > Thanks & Regards > Srikanth > Software Developer > > eGovernments Foundations > www.egovernments.org > Mob : 9980078913 > > > > On Tue, Jul 9, 2013 at 8:39 PM, Paul Benedict > wrote: > > > Agreed. What you want is a Servlet filter, not a Struts interceptor. > > > > > > On Tue, Jul 9, 2013 at 9:54 AM, Sreekanth S. Nair < > > sreekanth.n...@egovernments.org> wrote: > > > > > I doubt struts2 interceptor work like a filter, just like in ur pseudo > > > code. In filter we can specify > > > what to do with request and response by adding code before and > > > after chain.doFilter(request, response). In Interceptor intercept > method > > > will always get executed before and after req & resp. > > > > > > > > > > > > > > > -- > > > Thanks & Regards > > > Srikanth > > > Software Developer > > > > > > eGovernments Foundations > > > www.egovernments.org > > > Mob : 9980078913 > > > > > > > > > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > > > felipe.lor...@idealogic.com.br> wrote: > > > > > > > I dont think it is possible. But I believe you can just ignore the > > > > response and do nothing with that. > > > > > > > > I am not sure if I understand your question. But an interceptor has > > only > > > > one call per request/response. So your code could like this: > > > > > > > > > > > > public class Interceptor { > > > > > > > > method { > > > > removeSpaceFromRequest(); > > > > String resp = invoke(); > > > > //here, you do nothing with the response. > > > > return resp; > > > > } > > > > > > > > } > > > > > > > > Felipe Lorenz > > > > Gerente de Projetos > > > > Idealogic Software > > > > Fone: (51) 3715 5523 - (51) 3715 5548 > > > > www.idealogic.com.br > > > > > > > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > > > > > > > Yes, i have an Interceptor basically to Trimming of input values, i > > > don't > > > > > want to do this to be happened while request coming back with > > response. > > > > > > > > > > -- > > > > > Thanks & Regards > > > > > Srikanth > > > > > Software Developer > > > > > > > > > > eGovernments Foundations > > > > > www.egovernments.org > > > > > Mob : 9980078913 > > > > > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > > > > > > > >> Any specific reason to do that? > > > > >> --Original Message-- > > > > >> From: Sreekanth S. Nair > > > > >> To: Struts Users Mailing List > > > > >> ReplyTo: Struts Users Mailing List > > > > >> Subject: How to make interceptor to be invoked only for HTTP > Request > > > not > > > > >> for Response > > > > >> Sent: Jul 9, 2013 5:33 PM > > > > >> > > > > >> How to make interceptor to be invoked only for HTTP Request not > for > > > > >> Response > > > > >> > > > > >> > > > > >> > > > > >> Sent from BlackBerry® on Airtel > > > > > > > > > > > > > > > > > > > -- > > Cheers, > > Paul > > > -- With Regards Umesh Awasthi http://www.travellingrants.com/
Re: How to make interceptor to be invoked only for HTTP Request not for Response
No, I dont want a filter i want to make it done with strust2 interceptor only, my question is how do we achieve this using an interceptor. -- Thanks & Regards Srikanth Software Developer eGovernments Foundations www.egovernments.org Mob : 9980078913 On Tue, Jul 9, 2013 at 8:39 PM, Paul Benedict wrote: > Agreed. What you want is a Servlet filter, not a Struts interceptor. > > > On Tue, Jul 9, 2013 at 9:54 AM, Sreekanth S. Nair < > sreekanth.n...@egovernments.org> wrote: > > > I doubt struts2 interceptor work like a filter, just like in ur pseudo > > code. In filter we can specify > > what to do with request and response by adding code before and > > after chain.doFilter(request, response). In Interceptor intercept method > > will always get executed before and after req & resp. > > > > > > > > > > -- > > Thanks & Regards > > Srikanth > > Software Developer > > > > eGovernments Foundations > > www.egovernments.org > > Mob : 9980078913 > > > > > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > > felipe.lor...@idealogic.com.br> wrote: > > > > > I dont think it is possible. But I believe you can just ignore the > > > response and do nothing with that. > > > > > > I am not sure if I understand your question. But an interceptor has > only > > > one call per request/response. So your code could like this: > > > > > > > > > public class Interceptor { > > > > > > method { > > > removeSpaceFromRequest(); > > > String resp = invoke(); > > > //here, you do nothing with the response. > > > return resp; > > > } > > > > > > } > > > > > > Felipe Lorenz > > > Gerente de Projetos > > > Idealogic Software > > > Fone: (51) 3715 5523 - (51) 3715 5548 > > > www.idealogic.com.br > > > > > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > > > > > Yes, i have an Interceptor basically to Trimming of input values, i > > don't > > > > want to do this to be happened while request coming back with > response. > > > > > > > > -- > > > > Thanks & Regards > > > > Srikanth > > > > Software Developer > > > > > > > > eGovernments Foundations > > > > www.egovernments.org > > > > Mob : 9980078913 > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > > > > > >> Any specific reason to do that? > > > >> --Original Message-- > > > >> From: Sreekanth S. Nair > > > >> To: Struts Users Mailing List > > > >> ReplyTo: Struts Users Mailing List > > > >> Subject: How to make interceptor to be invoked only for HTTP Request > > not > > > >> for Response > > > >> Sent: Jul 9, 2013 5:33 PM > > > >> > > > >> How to make interceptor to be invoked only for HTTP Request not for > > > >> Response > > > >> > > > >> > > > >> > > > >> Sent from BlackBerry® on Airtel > > > > > > > > > > > > -- > Cheers, > Paul >
Re: How to make interceptor to be invoked only for HTTP Request not for Response
Agreed. What you want is a Servlet filter, not a Struts interceptor. On Tue, Jul 9, 2013 at 9:54 AM, Sreekanth S. Nair < sreekanth.n...@egovernments.org> wrote: > I doubt struts2 interceptor work like a filter, just like in ur pseudo > code. In filter we can specify > what to do with request and response by adding code before and > after chain.doFilter(request, response). In Interceptor intercept method > will always get executed before and after req & resp. > > > > > -- > Thanks & Regards > Srikanth > Software Developer > > eGovernments Foundations > www.egovernments.org > Mob : 9980078913 > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > felipe.lor...@idealogic.com.br> wrote: > > > I dont think it is possible. But I believe you can just ignore the > > response and do nothing with that. > > > > I am not sure if I understand your question. But an interceptor has only > > one call per request/response. So your code could like this: > > > > > > public class Interceptor { > > > > method { > > removeSpaceFromRequest(); > > String resp = invoke(); > > //here, you do nothing with the response. > > return resp; > > } > > > > } > > > > Felipe Lorenz > > Gerente de Projetos > > Idealogic Software > > Fone: (51) 3715 5523 - (51) 3715 5548 > > www.idealogic.com.br > > > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > > > Yes, i have an Interceptor basically to Trimming of input values, i > don't > > > want to do this to be happened while request coming back with response. > > > > > > -- > > > Thanks & Regards > > > Srikanth > > > Software Developer > > > > > > eGovernments Foundations > > > www.egovernments.org > > > Mob : 9980078913 > > > -------- > > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > > > >> Any specific reason to do that? > > >> --Original Message-- > > >> From: Sreekanth S. Nair > > >> To: Struts Users Mailing List > > >> ReplyTo: Struts Users Mailing List > > >> Subject: How to make interceptor to be invoked only for HTTP Request > not > > >> for Response > > >> Sent: Jul 9, 2013 5:33 PM > > >> > > >> How to make interceptor to be invoked only for HTTP Request not for > > >> Response > > >> > > >> > > >> > > >> Sent from BlackBerry® on Airtel > > > > > -- Cheers, Paul
Re: How to make interceptor to be invoked only for HTTP Request not for Response
I have a custom interceptor for trimming whitespaces in request data My intercept method is like below @Override public String intercept(final ActionInvocation invocation) throws Exception { // Get the action context from the invocation so we can access the // HttpServletRequest and HttpSession objects. final HttpServletRequest request = (HttpServletRequest) invocation.getInvocationContext().get(HTTP_REQUEST); Map parameters = invocation.getInvocationContext().getParameters(); parameters = this.getTrimmedParameters(request, parameters); invocation.getInvocationContext().setParameters(parameters); return invocation.invoke(); } but this interceptor is getting called while request as well as while coming back from my action (response). I dont want intercept method to be called while response. -- Thanks & Regards Srikanth Software Developer eGovernments Foundations www.egovernments.org Mob : 9980078913 On Tue, Jul 9, 2013 at 8:29 PM, Dave Newton wrote: > It works precisely like a filter, there is code before and after > action.invoke, and before rendering with PreResultListeners. > > I don't understand the specific issue(s) you think you're having. What > problem are you having that you're trying to solve? > > Dave > On Jul 9, 2013 9:54 AM, "Sreekanth S. Nair" < > sreekanth.n...@egovernments.org> wrote: > > > I doubt struts2 interceptor work like a filter, just like in ur pseudo > > code. In filter we can specify > > what to do with request and response by adding code before and > > after chain.doFilter(request, response). In Interceptor intercept method > > will always get executed before and after req & resp. > > > > > > > > > > -- > > Thanks & Regards > > Srikanth > > Software Developer > > > > eGovernments Foundations > > www.egovernments.org > > Mob : 9980078913 > > > > > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > > felipe.lor...@idealogic.com.br> wrote: > > > > > I dont think it is possible. But I believe you can just ignore the > > > response and do nothing with that. > > > > > > I am not sure if I understand your question. But an interceptor has > only > > > one call per request/response. So your code could like this: > > > > > > > > > public class Interceptor { > > > > > > method { > > > removeSpaceFromRequest(); > > > String resp = invoke(); > > > //here, you do nothing with the response. > > > return resp; > > > } > > > > > > } > > > > > > Felipe Lorenz > > > Gerente de Projetos > > > Idealogic Software > > > Fone: (51) 3715 5523 - (51) 3715 5548 > > > www.idealogic.com.br > > > > > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > > > > > Yes, i have an Interceptor basically to Trimming of input values, i > > don't > > > > want to do this to be happened while request coming back with > response. > > > > > > > > -- > > > > Thanks & Regards > > > > Srikanth > > > > Software Developer > > > > -------- > > > > eGovernments Foundations > > > > www.egovernments.org > > > > Mob : 9980078913 > > > > > > > > > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > > > > > >> Any specific reason to do that? > > > >> --Original Message-- > > > >> From: Sreekanth S. Nair > > > >> To: Struts Users Mailing List > > > >> ReplyTo: Struts Users Mailing List > > > >> Subject: How to make interceptor to be invoked only for HTTP Request > > not > > > >> for Response > > > >> Sent: Jul 9, 2013 5:33 PM > > > >> > > > >> How to make interceptor to be invoked only for HTTP Request not for > > > >> Response > > > >> > > > >> > > > >> > > > >> Sent from BlackBerry® on Airtel > > > > > > > > >
Re: How to make interceptor to be invoked only for HTTP Request not for Response
It works precisely like a filter, there is code before and after action.invoke, and before rendering with PreResultListeners. I don't understand the specific issue(s) you think you're having. What problem are you having that you're trying to solve? Dave On Jul 9, 2013 9:54 AM, "Sreekanth S. Nair" < sreekanth.n...@egovernments.org> wrote: > I doubt struts2 interceptor work like a filter, just like in ur pseudo > code. In filter we can specify > what to do with request and response by adding code before and > after chain.doFilter(request, response). In Interceptor intercept method > will always get executed before and after req & resp. > > > > > -- > Thanks & Regards > Srikanth > Software Developer > > eGovernments Foundations > www.egovernments.org > Mob : 9980078913 > > > > On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < > felipe.lor...@idealogic.com.br> wrote: > > > I dont think it is possible. But I believe you can just ignore the > > response and do nothing with that. > > > > I am not sure if I understand your question. But an interceptor has only > > one call per request/response. So your code could like this: > > > > > > public class Interceptor { > > > > method { > > removeSpaceFromRequest(); > > String resp = invoke(); > > //here, you do nothing with the response. > > return resp; > > } > > > > } > > > > Felipe Lorenz > > Gerente de Projetos > > Idealogic Software > > Fone: (51) 3715 5523 - (51) 3715 5548 > > www.idealogic.com.br > > > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > > > Yes, i have an Interceptor basically to Trimming of input values, i > don't > > > want to do this to be happened while request coming back with response. > > > > > > -- > > > Thanks & Regards > > > Srikanth > > > Software Developer > > > > > > eGovernments Foundations > > > www.egovernments.org > > > Mob : 9980078913 > > > > > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > > > >> Any specific reason to do that? > > >> --Original Message-- > > >> From: Sreekanth S. Nair > > >> To: Struts Users Mailing List > > >> ReplyTo: Struts Users Mailing List > > >> Subject: How to make interceptor to be invoked only for HTTP Request > not > > >> for Response > > >> Sent: Jul 9, 2013 5:33 PM > > >> > > >> How to make interceptor to be invoked only for HTTP Request not for > > >> Response > > >> > > >> > > >> > > >> Sent from BlackBerry® on Airtel > > > > >
Re: How to make interceptor to be invoked only for HTTP Request not for Response
I doubt struts2 interceptor work like a filter, just like in ur pseudo code. In filter we can specify what to do with request and response by adding code before and after chain.doFilter(request, response). In Interceptor intercept method will always get executed before and after req & resp. -- Thanks & Regards Srikanth Software Developer eGovernments Foundations www.egovernments.org Mob : 9980078913 On Tue, Jul 9, 2013 at 6:37 PM, Felipe Lorenz < felipe.lor...@idealogic.com.br> wrote: > I dont think it is possible. But I believe you can just ignore the > response and do nothing with that. > > I am not sure if I understand your question. But an interceptor has only > one call per request/response. So your code could like this: > > > public class Interceptor { > > method { > removeSpaceFromRequest(); > String resp = invoke(); > //here, you do nothing with the response. > return resp; > } > > } > > Felipe Lorenz > Gerente de Projetos > Idealogic Software > Fone: (51) 3715 5523 - (51) 3715 5548 > www.idealogic.com.br > > Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > > > Yes, i have an Interceptor basically to Trimming of input values, i don't > > want to do this to be happened while request coming back with response. > > > > -- > > Thanks & Regards > > Srikanth > > Software Developer > > > > eGovernments Foundations > > www.egovernments.org > > Mob : 9980078913 > > > > > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > > > >> Any specific reason to do that? > >> ------Original Message-- > >> From: Sreekanth S. Nair > >> To: Struts Users Mailing List > >> ReplyTo: Struts Users Mailing List > >> Subject: How to make interceptor to be invoked only for HTTP Request not > >> for Response > >> Sent: Jul 9, 2013 5:33 PM > >> > >> How to make interceptor to be invoked only for HTTP Request not for > >> Response > >> > >> > >> > >> Sent from BlackBerry® on Airtel > >
Re: How to make interceptor to be invoked only for HTTP Request not for Response
I dont think it is possible. But I believe you can just ignore the response and do nothing with that. I am not sure if I understand your question. But an interceptor has only one call per request/response. So your code could like this: public class Interceptor { method { removeSpaceFromRequest(); String resp = invoke(); //here, you do nothing with the response. return resp; } } Felipe Lorenz Gerente de Projetos Idealogic Software Fone: (51) 3715 5523 - (51) 3715 5548 www.idealogic.com.br Em 09/07/2013, às 09:13, Sreekanth S. Nair escreveu: > Yes, i have an Interceptor basically to Trimming of input values, i don't > want to do this to be happened while request coming back with response. > > -- > Thanks & Regards > Srikanth > Software Developer > > eGovernments Foundations > www.egovernments.org > Mob : 9980078913 > > > > On Tue, Jul 9, 2013 at 5:41 PM, wrote: > >> Any specific reason to do that? >> --Original Message-- >> From: Sreekanth S. Nair >> To: Struts Users Mailing List >> ReplyTo: Struts Users Mailing List >> Subject: How to make interceptor to be invoked only for HTTP Request not >> for Response >> Sent: Jul 9, 2013 5:33 PM >> >> How to make interceptor to be invoked only for HTTP Request not for >> Response >> >> >> >> Sent from BlackBerry® on Airtel
Re: How to make interceptor to be invoked only for HTTP Request not for Response
Yes, i have an Interceptor basically to Trimming of input values, i don't want to do this to be happened while request coming back with response. -- Thanks & Regards Srikanth Software Developer eGovernments Foundations www.egovernments.org Mob : 9980078913 On Tue, Jul 9, 2013 at 5:41 PM, wrote: > Any specific reason to do that? > --Original Message-- > From: Sreekanth S. Nair > To: Struts Users Mailing List > ReplyTo: Struts Users Mailing List > Subject: How to make interceptor to be invoked only for HTTP Request not > for Response > Sent: Jul 9, 2013 5:33 PM > > How to make interceptor to be invoked only for HTTP Request not for > Response > > > > Sent from BlackBerry® on Airtel
Re: How to make interceptor to be invoked only for HTTP Request not for Response
Any specific reason to do that? --Original Message-- From: Sreekanth S. Nair To: Struts Users Mailing List ReplyTo: Struts Users Mailing List Subject: How to make interceptor to be invoked only for HTTP Request not for Response Sent: Jul 9, 2013 5:33 PM How to make interceptor to be invoked only for HTTP Request not for Response Sent from BlackBerry® on Airtel
How to make interceptor to be invoked only for HTTP Request not for Response
How to make interceptor to be invoked only for HTTP Request not for Response