Extending Template
Hi, I want to extend the css_xhtml. 1- /WEB-INF/classes/template/mytemp 2- Put the theme.properties in it . 3- Add the parent = css_xhtml 4- Update the the struts.xml as below: constant name=struts.ui.theme value=mytemp / constant name=sstruts.ui.templateDir value=template / constant name=struts.ui.templateSuffix value=ftl / I got below error: -- Error reading included file template/mytemp/controlheader.ftl The problematic instruction: -- == include /${parameters.templateDir}/${parameters.theme}/controlheader.ftl [on line 24, column 1 in template/css_xhtml/text.ftl] -- Template template/mytemp/controlheader.ftl not found. -- I expect that every thing should go fine !! I have just extended the template, should I copy all the css_xhtml folder from struts2-core jar. ~Regards, ~~Alireza Fattahi
Re: Extending Template
2013/7/9 Alireza Fattahi afatt...@yahoo.com: Hi, I want to extend the css_xhtml. 1- /WEB-INF/classes/template/mytemp 2- Put the theme.properties in it . 3- Add the parent = css_xhtml 4- Update the the struts.xml as below: constant name=struts.ui.theme value=mytemp / constant name=sstruts.ui.templateDir value=template / is it typo here or in your code? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Extending Template
Yes it is a typo. I have this constant name=struts.ui.templateDir value=template / in the struts.xml ~Regards, ~~Alireza Fattahi From: Lukasz Lenart lukaszlen...@apache.org To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, 9 July 2013, 11:12 Subject: Re: Extending Template 2013/7/9 Alireza Fattahi afatt...@yahoo.com: Hi, I want to extend the css_xhtml. 1- /WEB-INF/classes/template/mytemp 2- Put the theme.properties in it . 3- Add the parent = css_xhtml 4- Update the the struts.xml as below: constant name=struts.ui.theme value=mytemp / constant name=sstruts.ui.templateDir value=template / is it typo here or in your code? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
WW if question
Hey, quick question (I know WW is EOL maybe someone will help me nonetheless): Why does ww:if test=!searchResult.empty || !#searchResult.empty not work as expected? Depending on the call, searchResult is either from the action or set by ww:set but the if only evaluates the one from the action - searchResult and if its empty does not proceed to check #searchResult which isnt empty. What am I missing? Thank you and best Fabian smime.p7s Description: S/MIME Kryptografische Unterschrift
Re: WW if question
Have you tried this: ww:if test=%{!searchResult.empty || !#searchResult.empty} 2013/7/9 Fabian Richter frich...@mtg.de: Hey, quick question (I know WW is EOL maybe someone will help me nonetheless): Why does ww:if test=!searchResult.empty || !#searchResult.empty not work as expected? Depending on the call, searchResult is either from the action or set by ww:set but the if only evaluates the one from the action - searchResult and if its empty does not proceed to check #searchResult which isnt empty. What am I missing? Thank you and best Fabian - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: WW if question
Am 09.07.2013 11:07, schrieb Lukasz Lenart: Have you tried this: ww:if test=%{!searchResult.empty || !#searchResult.empty} Yes, I did, didnt work :( smime.p7s Description: S/MIME Kryptografische Unterschrift
Re: WW if question
2013/7/9 Fabian Richter frich...@mtg.de: Am 09.07.2013 11:07, schrieb Lukasz Lenart: Have you tried this: ww:if test=%{!searchResult.empty || !#searchResult.empty} Yes, I did, didnt work :( getters? And maybe use just one value instead of two searchResult? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: WW if question
Am 09.07.2013 11:15, schrieb Lukasz Lenart: getters? And maybe use just one value instead of two searchResult? Getters are present for the one from the action, without the # I need both for an evil hack, I have a page that consists of a form and a list which are seperate actions and after submitting the form when the validation fails, the list is empty as the fetching of the list isnt done anymore. Havent found a better solution to that problem yet than calling the action that fetches the list again if the one from the action that validates and processes the form stops due to validation errors. Fabian smime.p7s Description: S/MIME Kryptografische Unterschrift
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
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
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, umeshawas...@gmail.com 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
convention redirect to slash
Hi, The constant name=struts.convention.redirect.to.slash value=false / is not working ! It keeps redirecting to slash any comments ?! ~Regards, ~~Alireza Fattahi
Re: convention redirect to slash
2013/7/9 Alireza Fattahi afatt...@yahoo.com: The constant name=struts.convention.redirect.to.slash value=false / is not working ! It keeps redirecting to slash any comments ?! Could you share your struts.xml? Os some snippets with results? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: convention redirect to slash
Here it is: I acutally downloaded the struts 2 jquery plug in and add constant name=struts.convention.redirect.to.slash value=false / to it! struts constant name=struts.enable.DynamicMethodInvocation value=false / constant name=struts.devMode value=true / constant name=struts.convention.action.packages value=com.jgeppert.struts2.jquery.showcase / constant name=struts.convention.default.parent.package value=json-default / constant name=struts.convention.redirect.to.slash value=false / constant name=struts.custom.i18n.resources value=messages / /struts ~Regards, ~~Alireza Fattahi From: Lukasz Lenart lukaszlen...@apache.org To: Struts Users Mailing List user@struts.apache.org; Alireza Fattahi afatt...@yahoo.com Sent: Tuesday, 9 July 2013, 17:22 Subject: Re: convention redirect to slash 2013/7/9 Alireza Fattahi afatt...@yahoo.com: The constant name=struts.convention.redirect.to.slash value=false / is not working ! It keeps redirecting to slash any comments ?! Could you share your struts.xml? Os some snippets with results? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
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, umeshawas...@gmail.com 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: convention redirect to slash
Ok, but could you share configuration of results? How do you perform redirect? 2013/7/9 Alireza Fattahi afatt...@yahoo.com: Here it is: I acutally downloaded the struts 2 jquery plug in and add constant name=struts.convention.redirect.to.slash value=false / to it! struts constant name=struts.enable.DynamicMethodInvocation value=false / constant name=struts.devMode value=true / constant name=struts.convention.action.packages value=com.jgeppert.struts2.jquery.showcase / constant name=struts.convention.default.parent.package value=json-default / constant name=struts.convention.redirect.to.slash value=false / constant name=struts.custom.i18n.resources value=messages / /struts ~Regards, ~~Alireza Fattahi From: Lukasz Lenart lukaszlen...@apache.org To: Struts Users Mailing List user@struts.apache.org; Alireza Fattahi afatt...@yahoo.com Sent: Tuesday, 9 July 2013, 17:22 Subject: Re: convention redirect to slash 2013/7/9 Alireza Fattahi afatt...@yahoo.com: The constant name=struts.convention.redirect.to.slash value=false / is not working ! It keeps redirecting to slash any comments ?! Could you share your struts.xml? Os some snippets with results? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
by pass the validation
Hi, When I put SomeAction-validation.xml nead an action class, the validation is always checked before execute method. If I have more than one method in the action, will the validation execute for them too ?! Is there any way that I can configure which methods should by pass the validation ~Regards, ~~Alireza Fattahi
Re: convention redirect to slash
I do not use any configuration. There is an index.jsp: % response.sendRedirect(index.action); % and the index.action is has a execute and simple return SUCCESS and redirects to a jsp. As I said it is the struts 2 jquery showcase sample! I am new, please let me know if I should describe any thing else !! ~Regards, ~~Alireza Fattahi From: Lukasz Lenart lukaszlen...@apache.org To: Struts Users Mailing List user@struts.apache.org; Alireza Fattahi afatt...@yahoo.com Sent: Tuesday, 9 July 2013, 17:40 Subject: Re: convention redirect to slash Ok, but could you share configuration of results? How do you perform redirect? 2013/7/9 Alireza Fattahi afatt...@yahoo.com: Here it is: I acutally downloaded the struts 2 jquery plug in and add constant name=struts.convention.redirect.to.slash value=false / to it! struts constant name=struts.enable.DynamicMethodInvocation value=false / constant name=struts.devMode value=true / constant name=struts.convention.action.packages value=com.jgeppert.struts2.jquery.showcase / constant name=struts.convention.default.parent.package value=json-default / constant name=struts.convention.redirect.to.slash value=false / constant name=struts.custom.i18n.resources value=messages / /struts ~Regards, ~~Alireza Fattahi From: Lukasz Lenart lukaszlen...@apache.org To: Struts Users Mailing List user@struts.apache.org; Alireza Fattahi afatt...@yahoo.com Sent: Tuesday, 9 July 2013, 17:22 Subject: Re: convention redirect to slash 2013/7/9 Alireza Fattahi afatt...@yahoo.com: The constant name=struts.convention.redirect.to.slash value=false / is not working ! It keeps redirecting to slash any comments ?! Could you share your struts.xml? Os some snippets with results? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: by pass the validation
I think that if you name your validation file as follows it will only trigger for the given method. SomeAction-method-validation.xml For the saveFile method you would have: SomeAction-saveFile-validation.xml Todd Kofford tkoff...@ku.edu From: Alireza Fattahi [afatt...@yahoo.com] Sent: Tuesday, July 09, 2013 8:16 AM To: Struts Users Mailing List Subject: by pass the validation Hi, When I put SomeAction-validation.xml nead an action class, the validation is always checked before execute method. If I have more than one method in the action, will the validation execute for them too ?! Is there any way that I can configure which methods should by pass the validation ~Regards, ~~Alireza Fattahi - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: convention redirect to slash
2013/7/9 Alireza Fattahi afatt...@yahoo.com: I do not use any configuration. There is an index.jsp: % response.sendRedirect(index.action); % Try to use % response.sendRedirect(/namespace/); % and the index.action is has a execute and simple return SUCCESS and redirects to a jsp. As I said it is the struts 2 jquery showcase sample! I am new, please let me know if I should describe any thing else !! If you redirects to action directly, the action will be called. If you redirect to /namespace/, action Index in that namespace will be used. Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: by pass the validation
Hi Alireza See if this helps SomeAction-AliasName-validation.xml, where AliasName is method/action name Regards, Neville Fernandes | Software Engineer Cell: +91-9049398189| Off Tel: +91-832-6628733 Persistent Systems Ltd.| Partners in Innovation | www.persistentsys.com -Original Message- From: Alireza Fattahi [mailto:afatt...@yahoo.com] Sent: 09 July 2013 PM 06:47 To: Struts Users Mailing List Subject: by pass the validation Hi, When I put SomeAction-validation.xml nead an action class, the validation is always checked before execute method. If I have more than one method in the action, will the validation execute for them too ?! Is there any way that I can configure which methods should by pass the validation ~Regards, ~~Alireza Fattahi DISCLAIMER == This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
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, umeshawas...@gmail.com 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, umeshawas...@gmail.com 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 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 davelnew...@gmail.com 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, umeshawas...@gmail.com 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
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, umeshawas...@gmail.com 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
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 pbened...@apache.org 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, umeshawas...@gmail.com 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
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 pbened...@apache.org 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, umeshawas...@gmail.com 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
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 davelnew...@gmail.com 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, umeshawas...@gmail.com 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 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 davelnew...@gmail.com 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 davelnew...@gmail.com 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, umeshawas...@gmail.com 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
struts2 jquery s:div resize feature
I wrote an action class to return an image, and display perfect. http://localhost/ecommerce/ImageAction?imageId=darksouls.jpg but, when i use struts 2' jquery plugin div resize sample(just copy paste their demo code, but only change action at following. s:url var=ajax value='ImageAction?imageId=darksouls.jpg' / sj:div href=%{ajax} indicator=indicator resizable=true resizableAnimate=true resizableGhost=true resizableHelper=ui-state-highlight resizableAspectRatio=true cssStyle=width: 250px; height: 180px; cssClass=ui-widget-content ui-corner-all img id=indicator src=images/indicator.gif alt=Loading... style=display:none/ /sj:div It return/display garbage char from image, really have no idea why this happen, because regular call http://localhost/ecommerce/ImageAction?imageId=darksouls.jpg works perfect. any trick to use s:j:div resize feature? thanks in advance john
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 sreekanth.n...@egovernments.org To: Struts Users Mailing List user@struts.apache.org 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 davelnew...@gmail.com 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 davelnew...@gmail.com 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 http://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, umeshawas...@gmail.com 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
Using Two Parent Pakages!!
Hi, I am using the convention in with json plugin so I add: constant name=struts.convention.default.parent.package value=json-default / Now I want to use the REST plugin so I should add: constant name=struts.convention.default.parent.package value=rest-default / How can I solve it ! ~Regards, ~~Alireza Fattahi
Re: Using Two Parent Pakages!!
2013/7/10 Alireza Fattahi afatt...@yahoo.com: Hi, I am using the convention in with json plugin so I add: constant name=struts.convention.default.parent.package value=json-default / Now I want to use the REST plugin so I should add: constant name=struts.convention.default.parent.package value=rest-default / json-default [1] contains just one result definition and two interceptors, so you can merge it into your own package How can I solve it ! Question mark would be better than exclamation mark ;-) [1] https://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/json/src/main/resources/struts-plugin.xml Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Using Two Parent Pakages!!
Thanks ! I found a code here:http://struts.apache.org/release/2.0.x/docs/zero-configuration.html @ParentPackage({my-parent-package1, my-parent-package2}) package com.mycompany.myapp.actions import org.apache.struts2.config.ParentPackage; Can I do it ?! ~Regards, ~~Alireza Fattahi From: Lukasz Lenart lukaszlen...@apache.org To: Struts Users Mailing List user@struts.apache.org; Alireza Fattahi afatt...@yahoo.com Sent: Wednesday, 10 July 2013, 10:13 Subject: Re: Using Two Parent Pakages!! 2013/7/10 Alireza Fattahi afatt...@yahoo.com: Hi, I am using the convention in with json plugin so I add: constant name=struts.convention.default.parent.package value=json-default / Now I want to use the REST plugin so I should add: constant name=struts.convention.default.parent.package value=rest-default / json-default [1] contains just one result definition and two interceptors, so you can merge it into your own package How can I solve it ! Question mark would be better than exclamation mark ;-) [1] https://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/json/src/main/resources/struts-plugin.xml Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Using Two Parent Pakages!!
2013/7/10 Alireza Fattahi afatt...@yahoo.com: Thanks ! I found a code here:http://struts.apache.org/release/2.0.x/docs/zero-configuration.html @ParentPackage({my-parent-package1, my-parent-package2}) package com.mycompany.myapp.actions import org.apache.struts2.config.ParentPackage; Can I do it ?! Right, you can extend from more than one package package name=employee extends=struts-default,json-default namespace=/employee http://struts.apache.org/release/2.0.x/docs/package-configuration.html Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org