Re: Migration problem from 2.0.x to 2.1.6
You would anyways need to extend the action class if you want the action mapping in your servlet. On 5/27/2010 11:18 AM, Gwen Harold Autencio wrote: Hi, I got a Servlet which doesn't extends to an action. Looking for a work around without extending the servlet to an action because it's already has extends another class. Any ideas ? I'm getting this in the logs 2010-05-27 13:46:44,962 [btpool0-8] WARN org.apache.struts2.dispatcher.Dispatcher - Could not find action or result There is no Action mapped for namespace / and action name repository/internal/. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) - 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: action chain tag
When an http://struts.apache.org/2.0.11.1/docs/action.htmlaction class method completes, it returns a String. The value of the String is used to select a result element. (result name = input here ) Not very sure on this but I think the flow will go to render action first and then if it finds the forward name there as input, it will show product_main.jsp On 5/27/2010 9:52 AM, ennidhi wrote: There is a action tag like this in my application. What happens here? whether the request goes to the render action or the page product_main.jsp is displayed? How to find this? Thanks action name=viewedit_ajax com.tebs.augusta.web.actions.product.ProductAction_viewedit result type=chainrender/result result name=inputproduct_main.jsp/result /action
Re: Migration problem from 2.0.x to 2.1.6
So all the servlet should be an action now in 2.1.6 ? --- On Thu, 5/27/10, Rupali Gupta r.gup...@mpstechnologies.com wrote: From: Rupali Gupta r.gup...@mpstechnologies.com Subject: Re: Migration problem from 2.0.x to 2.1.6 To: user@struts.apache.org Date: Thursday, May 27, 2010, 3:05 PM You would anyways need to extend the action class if you want the action mapping in your servlet. On 5/27/2010 11:18 AM, Gwen Harold Autencio wrote: Hi, I got a Servlet which doesn't extends to an action. Looking for a work around without extending the servlet to an action because it's already has extends another class. Any ideas ? I'm getting this in the logs 2010-05-27 13:46:44,962 [btpool0-8] WARN org.apache.struts2.dispatcher.Dispatcher - Could not find action or result There is no Action mapped for namespace / and action name repository/internal/. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) - 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Cookie Manipulation attack
Hi Guys, I am handling a application in which we have application in two languages. There is a Locale action for setting locale to English or Arabic based on the parameter being passed from the respective index pages. I.e. index_en.jsp and index_ar.jsp the parameter is passed as the POST variable. Now we conducted a security testing in which it was shown that the parameter has been changed in to some meta tag for cookie manipulation. If I try changing the parameter the dispatch action will throw an error java.lang.NoSuchMethodException: Now how could I redirect to error page if an exception is thrown in dispatch action? Best Regards, Vishnu NV
RE: Migration problem from 2.0.x to 2.1.6
If you have access the class the Servlet extends to and that class does not extend to a class, try to have that class extends to an action. -Original Message- From: Gwen Harold Autencio [mailto:gwenharol...@yahoo.com] Sent: Thursday, May 27, 2010 1:49 AM To: user@struts.apache.org Subject: Migration problem from 2.0.x to 2.1.6 Hi, I got a Servlet which doesn't extends to an action. Looking for a work around without extending the servlet to an action because it's already has extends another class. Any ideas ? I'm getting this in the logs 2010-05-27 13:46:44,962 [btpool0-8] WARN org.apache.struts2.dispatcher.Dispatcher - Could not find action or result There is no Action mapped for namespace / and action name repository/internal/. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) - 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: Cookie Manipulation attack
Em 27-05-2010 11:27, Vishnu Vyasan Nelliparmbil escreveu: Hi Guys, I am handling a application in which we have application in two languages. There is a Locale action for setting locale to English or Arabic based on the parameter being passed from the respective index pages. I.e. index_en.jsp and index_ar.jsp the parameter is passed as the POST variable. Now we conducted a security testing in which it was shown that the parameter has been changed in to some meta tag for cookie manipulation. If I try changing the parameter the dispatch action will throw an error java.lang.NoSuchMethodException: Now how could I redirect to error page if an exception is thrown in dispatch action? Global exception mappings in struts.xml , maybe? Best Regards, Vishnu NV * * * * - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: PRG pattern question
Em 26-05-2010 16:57, Chris Pratt escreveu: If you search the forum, someone posted an Interceptor (quite a while ago) that saves the Action/Field Errors/Messages in the Session so that they will survive a redirect. It could easily be extended to do what you require. (*Chris*) I think this interceptor is already included in S2. What I use: !-- Action messages and errors auto-stored in session -- interceptor-ref name=store param name=operationModeAUTOMATIC/param /interceptor-ref And it does what it says :D On Wed, May 26, 2010 at 5:45 AM, szerintedmiszerinte...@gmail.com wrote: Hi Everybody, I would like to ask some advice implementing PRG pattern with struts2 (using 2.0.14). I can easily handle a normal scenario : 1.GET showItem.action?itemId=1 result: showItem.jsp 2. POST saveItem.action result: redirect-action: success?itemId=1 3. GET success?itemId =1 result: success.jsp Browser back works perfectly with this workflow. However if there is a form error at step 2.: 1. GET showItem.action?itemId=1 result: showItem.jsp 2.1 POST saveItem.action result: showItem.jsp (with field/action errors) 2.2 POST saveItem.action (user fixed errors on form) result: redirect-action: success?itemId=1 3. GET success?itemId=1 result: success.jsp In this scenario if the user press back after the 3rd step he gets a page with saveItem.action url (without params) and with a re-submit browser alert. If a form validation error happens I could use a redirect-action result to showItem.action at step 2.1. But that way I'm loosing all the posted form data and the data field/action errors. Alternativelly I could use the same action to show and save, that way url would be showItem after 2.1 but still without url params. I could hack url query string to the reponse but still have re-submit alerts from browser after user press back button because that was a result of a post. What is the best practice to handle form errors with struts if I want to implement Post-Redirect-Get pattern? Thanks, Peter - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
IntRangeFieldValidator - Double javascript validation instead of one
Hi all, I am using Struts 2 annotations for validation: @Validations(requiredStrings = { @RequiredStringValidator(fieldName = firstName, type = ValidatorType.FIELD, message = First name is required), @RequiredStringValidator(fieldName = lastName, type = ValidatorType.FIELD, message = Last name is required), @RequiredStringValidator(fieldName = email, type = ValidatorType.FIELD, message = Email is required) }, emails = { @EmailValidator(fieldName = email, type = ValidatorType.FIELD, message = Email format is incorrect) }, intRangeFields = { @IntRangeFieldValidator(fieldName = itemSelectedId, type = ValidatorType.FIELD, min = 1, shortCircuit = true, message = An item is required) } ) public String save() throws Exception .. This works fine for all the fields except for the IntRangeFieldValidator. It inserts the javascript code twice instead of one only: // field name: itemSelectedId // validator name: int if (form.elements['itemSelectedId']) { field = form.elements['itemSelectedId']; var error = An itemis required; if (continueValidation field.value != null) { if (parseInt(field.value) 1 || false) { addError(field, error); errors = true; continueValidation = false; } } } Consequently, the error message is also displayed twice ! Any idea on what could cause this ? Thanks in advance, PBR
Re: Migration problem from 2.0.x to 2.1.6
Check out the wiki entry for migrating https://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html There is a section Filter Mapping, default Action extensions, and Servlets that should help. Unfortunately the docs seem to still be messed up. sigh On Thu, May 27, 2010 at 1:48 AM, Gwen Harold Autencio gwenharol...@yahoo.com wrote: Hi, I got a Servlet which doesn't extends to an action. Looking for a work around without extending the servlet to an action because it's already has extends another class. Any ideas ? I'm getting this in the logs 2010-05-27 13:46:44,962 [btpool0-8] WARN org.apache.struts2.dispatcher.Dispatcher - Could not find action or result There is no Action mapped for namespace / and action name repository/internal/. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) - 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
Now the wiki is also messed up
Come on guys... The docs have been messed up for a while and now the wiki is messed up. On this page https://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html All the code samples are missing, they show up as a squiggly line. Even the home page links to the Wiki are broken https://cwiki.apache.org/S2WIKI/home.html takes you to a not found page and after a few seconds you are redirected to a folder listing. Docs are so important for a open source project, someone needs to work on getting them fixed. (Pretty please) - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Regular Expression Denial of Service Attacks and Defenses
This link is to an article that talks of how Denial of Service attacks can target vulnerable Regular Expressions. Regular Expression Denial of Service Attacks and Defenses http://msdn.microsoft.com/en-us/magazine/ff646973.aspx (Not sure if you need to login to see this page, I hope not.) A friend tested the example expression ^(\d+)+$ using the Java Regex library and discovered it is vulnerable and a badly formed 30 character string was taking over 2 minutes to determine that it didn't match. Struts 2 (and many other frameworks) use regular expressions in validation. I'm wondering if anyone has checked to see if any of the built in regex expressions are vulnerable, I'm thinking specifically of the email address validation? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
How to control the rendering of struts UI tags? [Solved]
Searching I found something to the effect did you change the rendering mode to css... and then the OP went on his way... Where is this switch flicked? Oh, just because I've got inertia found the answer in Struts 2 in Action, but was looking user the wrong headings... I'm going to answer my own question: 1) Create the file struts.properties in the class path. 2) add the line (well it's css_xhtml in my case anyways...): struts.ui.theme=css_xhtml Note the default properties are defined in default.properties at org.apache.struts2, creating this file lets you override what you want. From searching google, it seems obvious to the rest of the world but maybe this will help some other super newbie.
Re: Struts Users Mailing List user@struts.apache.org - question
I think you just have to subscribe with the new email. I don't think you can update your info. Steve - Original Message - From: Polakovic, Juraj To: stephenpi...@gmail.com Sent: Thursday, May 27, 2010 16:02 Subject: Struts Users Mailing List user@struts.apache.org - question Hi Stephen, Sorry to bother you this way but you might have an answer to my subscription type of question. My email has recently changed and I am wondering if there is a way to update my subscription email to receive emails from u...@struts.apache.org. (I've only found subscribe/unsubscribe links) Is there any way ? Thanks, Juraj This email communication and any files transmitted with it may contain confidential and or proprietary information and is provided for the use of the intended recipient only. Any review, retransmission or dissemination of this information by anyone other than the intended recipient is prohibited. If you receive this email in error, please contact the sender and delete this communication and any copies immediately. Thank you. http://www.cenovus.com
Struts url, a, and iterator tag behaviour
I am trying to dynamically construct a url inside an iterator tag and use that result in an anchor. s:iterator value=next s:url id=companyId action=companyDetails.action namespace=/secure s:param name=group value=log.id.mlgroup/ s:param name=id value=log.id.mlid/ /s:url tr tds:property value=log.id.mlgroup//td tds:property value=log.id.mlid//td tds:property value=log.mlco//td tds:a value=%{companyId}s:property value=cur.mco//s:a/td /tr /s:iterator This is producing the following html: (Showing two iterations only) tr td01 /td td24737/td td TEST ** FOCUS INDUSTRIAL /td tda TEST ** FOCUS INDUSTRIAL /a/td /tr tr td01 /td td0/td td==+** THE TEST COMPANY **+/td tdaCASH ** THE TEST COMPANY **/a/td /tr Any Ideas?