Re: Customizing CSS
Hi, Thanks for your reply, but i am talking about UI screen, not a table display. in the screen itself for every control i want to apply an alternate back ground color. for example s:textfield name=empid label=Employee ID : s:textfield name=empname label=Employee Name : these two should come with two different background colors. On Thu, Jul 10, 2008 at 3:18 PM, Narayana S [EMAIL PROTECTED] wrote: Hi, as per my requirement, i have to apply two different colors to alternate rows.can any one guide me how to extend theme to implement this?
Re: [S2] Recipe for Action and View
hi, i didnt get you. I have a page for which i need to do some preprocessing to display it. After the page is done by user it has to be processed. Can you please elaborate on the soln given? ravi Gabriel Belingueres-2 wrote: Sorry it seems I entered the conversation later and didn't saw that email. The problem you want to solve is very common (skipping form validation the first time you call an action) and, as Dave wrote, it is commonly solved by invoking the action with the input() method [1]. This method will do nothing and will return INPUT as the result, thus forwarding the response to the page with the form. [1] http://struts.apache.org/2.1.2/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html#input() 2008/7/12 Andreas Mähler [EMAIL PROTECTED]: Hello again, Gabriel Belingueres schrieb: Without knowing what are you actually trying to accomplish with this interceptor, I would warn that when an interceptor messes up with the parameters, you need to carefully think where in the interceptor chain this interceptor will execute. I explain what I am trying to do in my first post[1]. What do you mean by messing up with the parameters? The Interceptor only checks for the presence of at least one of the specified parameters. It does not change anything. Are there any interceptors that actually change the parameter map? As I said, I am a S2 newbie and haven't heard of many things, but I would consider it as bad style. Greetings, ~Andreas [1] http://article.gmane.org/gmane.comp.jakarta.struts.user/158395 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Recipe-for-Action-and-View-tp18381617p18438070.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] current URL in ValueStack?
Pierre Thibaudeau wrote: But your statement about EL intrigues me. How would you do that in EL? Is there some value available to EL in the request context? simply ${pageContext.request.requestURI} The benefit of EL is that your IDE (hopefully) understands it, which in my opinion is much better than hardcoding obscure constant strings into OGNL expressions that fail silently :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Extending Struts Controls - problem
Hi, I have extended Simple theme (by modifying XHTML theme), implemented the column span for every control as given below. s:textfield label=Trucker name=truker size=70 s:param name=labelcolspan value=%{2} / s:param name=inputcolspan value=%{6} / /s:textfield it is working fine. Now to pass these parameters directly within the textfield tag, i have extended org.apache.struts2.views.jsp.ui.TextFieldTag and created my own tag with new attributes labelcolspan,inputcolspan. the taglib file also modified accordingly, but when i am creating a textfield with the extended class, it is not passing these two new parameter info to Free marker template files. after extending as shown below i am using the tag, ss:textfield labelcolspan=row21 inputcolspan=row31 name=myname1 label=Enter First Name / what else i am missing here? can any one suggest me Thanks in advance ~narayana.
Re: problem with checkbox (when using disabled property)
yes it doesnt. Atleast in version 2.0.9. i heard its fixed in 2.1 version. you can write a reset interceptor also for this. i.e. always (before param interceptor) reset the checkbox field. If there is some checkbox getting submitted then you will get them, else the field would be reset by the interceptor. hth ravi Owen Berry wrote: I would have thought s:checkbox.../ would handle all of that for you, but I guess it may not be working, or doesn't aim to. 2008/7/10 Paweł Wielgus [EMAIL PROTECTED]: Hi all, just yesterday i had the very same problem in rails with date field, so i searched for disabled definition and found this: http://www.w3.org/TR/html401/interact/forms.html#successful-controls and http://www.w3.org/TR/html401/interact/forms.html#h-17.12 It looks like disabled flag will simply prevent the field from submiting. So an extra hidden field read-only should do the job. Best greetings, Paweł Wielgus. On 10/07/2008, Dave Newton [EMAIL PROTECTED] wrote: --- On Wed, 7/9/08, Owen Berry [EMAIL PROTECTED] wrote: You need to have a hidden field value that will take the place of the disabled checkbox as some browsers do not send disabled field values. The s:checkbox.../ tag already includes the hidden field; I don't know what it does for disabled checkboxes, though. The checkbox interceptor *should* work in concert with the tag to handle disabled checkboxes as well, or at least I thought it did. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/problem-with-checkbox-%28when-using-disabled-property%29-tp18367328p18438098.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] current URL in ValueStack?
The benefit of EL is that your IDE (hopefully) understands it, I wish my MyEclipse JSP editor was as clever as that... (Should I just revert to Eclipse with the correct collection of plugins? or maybe switch to IntelliJ?) In any case, thanks a million!
struts2 validation
Hi all! Been looking all over the net but my validation simply isn't working :( I have a JSP page with a dropdown box in a form. I just want to make sure the value in the dropdown box is not empty. It currently looks like this: s:form action=3Dmyaction method=3Dpost validate=3Dtrue s:actionerror / s:fielderror / s:select name=3DfieldName id=3DfieldName theme=3Dsimple size=3D1 list=3DfieldList headerKey=3D headerValue=3D- - Please Select - -/ s:submit name=3DSubmit/ /s:form My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1 I was using the validate(...) method in the Form class. It seems none of the Struts2 validation examples on the net are working for= me. Or I'm not doing it right. Anyone any ideas how I can do this simply? Cheers! nic The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.
RE: Customizing CSS
s:textfield name=empid label=Employee ID : cssClass=class1 s:textfield name=empname label=Employee Name : cssClass=class2 .class1{ background-color:red; } .class2{ background-color:blue; } Sorry I have not seen your earlier mail, what ever you want to do using class Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Narayana S [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2008 11:40 AM To: Struts Users Mailing List Subject: Re: Customizing CSS Hi, Thanks for your reply, but i am talking about UI screen, not a table display. in the screen itself for every control i want to apply an alternate back ground color. for example s:textfield name=empid label=Employee ID : s:textfield name=empname label=Employee Name : these two should come with two different background colors. On Thu, Jul 10, 2008 at 3:18 PM, Narayana S [EMAIL PROTECTED] wrote: Hi, as per my requirement, i have to apply two different colors to alternate rows.can any one guide me how to extend theme to implement this? Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 validation
Nicole Luneburg wrote: s:form action=3Dmyaction method=3Dpost validate=3Dtrue The validate attribute here is used to enable client-side validation only. That will only work if you include the s:head attribute in the page. My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1 I was using the validate(...) method in the Form class. It seems none of the Struts2 validation examples on the net are working for= me. You haven't mentioned whether you're using XML validation or annotation-based validation. If by not working you mean does nothing, then your XML file is probably incorrectly named or your missing an annotation. (You need to enable this separately from client-side validation) Whatever the case, the main difference between Struts1 and Struts2 here is that Struts2 performs validation on the Object, not on the form parameters. That means, to check that fieldName is non-blank, it will call getFieldName() after setFieldName() was called by the ParametersInterceptor. A common problem is to forget the getter, but in that case Struts will keep returning INPUT (validation failed) instead of invoking your action. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 validation
If you want validation like in struts1 you can implement the interface com.opensymphony.xwork2.Validateable in your Action class. The method validate() is the same as in your struts1 FormBean. But maybe that's a bit old fashioned :) Regards -- Markus Stauffer On Mon, Jul 14, 2008 at 8:54 AM, Jeromy Evans [EMAIL PROTECTED] wrote: Nicole Luneburg wrote: s:form action=3Dmyaction method=3Dpost validate=3Dtrue The validate attribute here is used to enable client-side validation only. That will only work if you include the s:head attribute in the page. My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1 I was using the validate(...) method in the Form class. It seems none of the Struts2 validation examples on the net are working for= me. You haven't mentioned whether you're using XML validation or annotation-based validation. If by not working you mean does nothing, then your XML file is probably incorrectly named or your missing an annotation. (You need to enable this separately from client-side validation) Whatever the case, the main difference between Struts1 and Struts2 here is that Struts2 performs validation on the Object, not on the form parameters. That means, to check that fieldName is non-blank, it will call getFieldName() after setFieldName() was called by the ParametersInterceptor. A common problem is to forget the getter, but in that case Struts will keep returning INPUT (validation failed) instead of invoking your action. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts2 validation
ps. My post added some 3D text that isn't supposed to be there ... Thanks Jeromy. Yes I do have a s:head attribute, maybe not *exactly* but I have: s:head theme=ajax / Apologies for the confusion. What I meant in my pevious post was that I had tried a few ways to do this validation task. In my initial post I had described one of these attempts which I think should have worked. What I am getting regardless of what sort of validation I try to implement is this error: java.lang.StringIndexOutOfBoundsException: String index out of range: -7 You mentioned the getters and setters for the fieldnames ... this only works though if the fields are stored in the action right? coz the fields I have aren't stored in the action, they are stored in a Form class. Ie my action looks something like: public String execute() { MyForm myForm = (MyForm)super.form; String myField = myForm.getFieldName(); } Markus: Thanks for your reply too, I am trying it right now. Just want this to work grrr -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Monday, 14 July 2008 4:25 PM To: Struts Users Mailing List Subject: Re: struts2 validation Nicole Luneburg wrote: s:form action=3Dmyaction method=3Dpost validate=3Dtrue The validate attribute here is used to enable client-side validation only. That will only work if you include the s:head attribute in the page. My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1 I was using the validate(...) method in the Form class. It seems none of the Struts2 validation examples on the net are working for= me. You haven't mentioned whether you're using XML validation or annotation-based validation. If by not working you mean does nothing, then your XML file is probably incorrectly named or your missing an annotation. (You need to enable this separately from client-side validation) Whatever the case, the main difference between Struts1 and Struts2 here is that Struts2 performs validation on the Object, not on the form parameters. That means, to check that fieldName is non-blank, it will call getFieldName() after setFieldName() was called by the ParametersInterceptor. A common problem is to forget the getter, but in that case Struts will keep returning INPUT (validation failed) instead of invoking your action. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 validation
Struts2 does not have FormBeans anymore. All the form fields are instance variables directly in your Action class. Simply include a variable fieldName of type String with getters and setters in your Action class. The setFieldName() method will be called when you submit the form. In the execute() and validate() methods you can use the fieldName variable directly. What you can also do is put a instance variable of a bean in your Action class. You can then acces the getters and setters of this bean in the jsp: s:form action=myaction s:select name=myBeanVariableName.fieldName theme=simple list=fieldList headerKey= headerValue=- - Please Select - -/ /s:form If you submit this form struts will call myaction.getMyBeanVariableName().setFieldName(selectedValue). Regards -- Markus Stauffer On Mon, Jul 14, 2008 at 9:16 AM, Nicole Luneburg [EMAIL PROTECTED] wrote: ps. My post added some 3D text that isn't supposed to be there ... Thanks Jeromy. Yes I do have a s:head attribute, maybe not *exactly* but I have: s:head theme=ajax / Apologies for the confusion. What I meant in my pevious post was that I had tried a few ways to do this validation task. In my initial post I had described one of these attempts which I think should have worked. What I am getting regardless of what sort of validation I try to implement is this error: java.lang.StringIndexOutOfBoundsException: String index out of range: -7 You mentioned the getters and setters for the fieldnames ... this only works though if the fields are stored in the action right? coz the fields I have aren't stored in the action, they are stored in a Form class. Ie my action looks something like: public String execute() { MyForm myForm = (MyForm)super.form; String myField = myForm.getFieldName(); } Markus: Thanks for your reply too, I am trying it right now. Just want this to work grrr -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Monday, 14 July 2008 4:25 PM To: Struts Users Mailing List Subject: Re: struts2 validation Nicole Luneburg wrote: s:form action=3Dmyaction method=3Dpost validate=3Dtrue The validate attribute here is used to enable client-side validation only. That will only work if you include the s:head attribute in the page. My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1 I was using the validate(...) method in the Form class. It seems none of the Struts2 validation examples on the net are working for= me. You haven't mentioned whether you're using XML validation or annotation-based validation. If by not working you mean does nothing, then your XML file is probably incorrectly named or your missing an annotation. (You need to enable this separately from client-side validation) Whatever the case, the main difference between Struts1 and Struts2 here is that Struts2 performs validation on the Object, not on the form parameters. That means, to check that fieldName is non-blank, it will call getFieldName() after setFieldName() was called by the ParametersInterceptor. A common problem is to forget the getter, but in that case Struts will keep returning INPUT (validation failed) instead of invoking your action. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
REST and JSON plugins
Hi! Will REST plugin replace JSON plugin in Struts 2.1? To my mind JSON plugin was very REST-like, and I was really hoping that it would evolve into something that REST plugin claims to be. Also, do REST and JSON plugins have anything in common? After I read REST plugin author's Struts 2 in Action book it seemed that he wasn't aware of JSON plugin at all - he devoted several pages to implementation of a custom JSON handlers instead of just dropping JSON plugin into Struts 2 stack.. Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: REST and JSON plugins
Oleg Mikheev wrote: Hi! Will REST plugin replace JSON plugin in Struts 2.1? To my mind JSON plugin was very REST-like, and I was really hoping that it would evolve into something that REST plugin claims to be. Also, do REST and JSON plugins have anything in common? They're not related except both can serialize an action/model into JSON. In the past I created a ContentTypeHandler for the REST Plugin that used the JSON plugin's serializer. The result was exactly the same. The REST plugin uses json-lib for its default JSON ContentTypeHandler. (http://json-lib.sourceforge.net/) The advantage of JSON-lib is that it's bidirectional (essential for the plugin) and is used in many frameworks. The advantage of the JSON-plugin is that it includes some simple options to customize the output specifically for S2 (such as changing the root object). I've contributed to both the JSON plugin and REST plugin and use the JSON plugin when I'm writing plain actions that return JSON responses and json-lib when using the REST plugin. The options the JSON-plugin provides are generally not relevant when using the REST plugin so it's not valuable to run both. The JSON plugin should probably be updated to allow the serializer to be customized so you can use the json-lib serializer or the native serializer. After I read REST plugin author's Struts 2 in Action book it seemed that he wasn't aware of JSON plugin at all - he devoted several pages to implementation of a custom JSON handlers instead of just dropping JSON plugin into Struts 2 stack.. I presume that's just because the JSON plugin isn't part of the Struts 2 distribution per se. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Customizing CSS
Hi Jishnu, Thanks for your reply, it applies background color to the text field, but i want it to be applied to that entire row(that have label employee id and text field), not to the text field component alone. On Mon, Jul 14, 2008 at 12:19 PM, Jishnu Viswanath [EMAIL PROTECTED] wrote: s:textfield name=empid label=Employee ID : cssClass=class1 s:textfield name=empname label=Employee Name : cssClass=class2 .class1{ background-color:red; } .class2{ background-color:blue; } Sorry I have not seen your earlier mail, what ever you want to do using class Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Narayana S [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2008 11:40 AM To: Struts Users Mailing List Subject: Re: Customizing CSS Hi, Thanks for your reply, but i am talking about UI screen, not a table display. in the screen itself for every control i want to apply an alternate back ground color. for example s:textfield name=empid label=Employee ID : s:textfield name=empname label=Employee Name : these two should come with two different background colors. On Thu, Jul 10, 2008 at 3:18 PM, Narayana S [EMAIL PROTECTED] wrote: Hi, as per my requirement, i have to apply two different colors to alternate rows.can any one guide me how to extend theme to implement this? Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: about security
hi Thanks i have see documents and search for applying single sign on feature and jdbc realm for security but i can not get properly ,could you provide me some links which can use to understand from scratch all this things, thanks -- View this message in context: http://www.nabble.com/about-security-tp18402549p18439433.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Customizing CSS
I don't have much idea, but you can give it a try on s:label value=Employee ID cssClass=class2/ Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Narayana S [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2008 1:47 PM To: Struts Users Mailing List Subject: Re: Customizing CSS Hi Jishnu, Thanks for your reply, it applies background color to the text field, but i want it to be applied to that entire row(that have label employee id and text field), not to the text field component alone. On Mon, Jul 14, 2008 at 12:19 PM, Jishnu Viswanath [EMAIL PROTECTED] wrote: s:textfield name=empid label=Employee ID : cssClass=class1 s:textfield name=empname label=Employee Name : cssClass=class2 .class1{ background-color:red; } .class2{ background-color:blue; } Sorry I have not seen your earlier mail, what ever you want to do using class Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Narayana S [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2008 11:40 AM To: Struts Users Mailing List Subject: Re: Customizing CSS Hi, Thanks for your reply, but i am talking about UI screen, not a table display. in the screen itself for every control i want to apply an alternate back ground color. for example s:textfield name=empid label=Employee ID : s:textfield name=empname label=Employee Name : these two should come with two different background colors. On Thu, Jul 10, 2008 at 3:18 PM, Narayana S [EMAIL PROTECTED] wrote: Hi, as per my requirement, i have to apply two different colors to alternate rows.can any one guide me how to extend theme to implement this? Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] s:property - how to use CSS on it?
Because I want just a simple list of actionErrors, I have an iterator for the actionErrors such as: s:iterator value=actionErrors s:property/ /s:iterator However, how can I use Css calsses on the property? I want to display the error in red, but the property element doesn't have any CSS property. What's the best way of applying a Css syle to it? -- View this message in context: http://www.nabble.com/-S2--s%3Aproperty---how-to-use-CSS-on-it--tp18440945p18440945.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 Indexed Properties
Hi, I'm having problem with Struts2 and indexed properties. The list in my action is not being updated. My JSP is something like: logic:iterate id=coverTypes name=questionnaireVO.coverTypesList indexId=index input type=hidden id=questionnaireInputVO.coverTypesList[c:out value=${index} /].key name=questionnaireInputVO.coverTypesList[c:out value=${index} /].key value=c:out value=${coverTypes.key.id} / / input type=hidden id=questionnaireInputVO.coverTypesList[c:out value=${index} /].agreementType.key name=questionnaireInputVO.coverTypesList[c:out value=${index} /].agreementType.key value=c:out value=${coverTypes.agreementType.key.id} / / /logic:iterate I've discovered I need an entry in the x-work conversion properties: Element_questionnaireInputVO.coverTypesList=com.mypath.CoverTypeVO CreateIfNull_questionnaireInputVO.coverTypesList=true But I am getting the following error: [2008-07-14 12:13:07,860] [.Transports : 2] DEBUG [com.opensymphony.xwork2.util.InstantiatingNullHandler ] : Entering nullPropertyValue [EMAIL PROTECTED], property=coverTypesList] [2008-07-14 12:13:07,860] [.Transports : 2] ERROR [com.opensymphony.xwork2.util.InstantiatingNullHandler ] : Could not create and/or set value back on to object org.springframework.beans.factory.BeanCreationException: Error creating bean with name '[Lcom.mypath.CoverTypeVO;': Could not resolve matching constructor at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:178) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:799) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowire(AbstractAutowireCapableBeanFactory.java:255) at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:145) at com.opensymphony.xwork2.util.InstantiatingNullHandler.createObject(InstantiatingNullHandler.java:123) at com.opensymphony.xwork2.util.InstantiatingNullHandler.nullPropertyValue(InstantiatingNullHandler.java:104) at ognl.ASTProperty.getValueBody(ASTProperty.java:94) at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) at ognl.SimpleNode.getValue(SimpleNode.java:210) at ognl.ASTChain.setValueBody(ASTChain.java:168) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186) at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:158) at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:193) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:159) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.ing.itrf.starlite.common.interceptor.StarliteSecurityInterceptor.intercept(StarliteSecurityInterceptor.java:54) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.ing.itrf.starlite.common.interceptor.StarliteDebugInterceptor.intercept(StarliteDebugInterceptor.java:54) at
Struts 2 Indexed Properties
Hi, I'm having problem with Struts2 and indexed properties. The list in my action is not being updated. My JSP is something like: logic:iterate id=coverTypes name=questionnaireVO.coverTypesList indexId=index input type=hidden id=questionnaireInputVO.coverTypesList[c:out value=${index} /].key name=questionnaireInputVO.coverTypesList[c:out value=${index} /].key value=c:out value=${coverTypes.key.id} / / input type=hidden id=questionnaireInputVO.coverTypesList[c:out value=${index} /].agreementType.key name=questionnaireInputVO.coverTypesList[c:out value=${index} /].agreementType.key value=c:out value=${coverTypes.agreementType.key.id} / / /logic:iterate I've discovered I need an entry in the x-work conversion properties: Element_questionnaireInputVO.coverTypesList=com.mypath.CoverTypeVO CreateIfNull_questionnaireInputVO.coverTypesList=true But I am getting the following error: [2008-07-14 12:13:07,860] [.Transports : 2] DEBUG [com.opensymphony.xwork2.util.InstantiatingNullHandler ] : Entering nullPropertyValue [EMAIL PROTECTED], property=coverTypesList] [2008-07-14 12:13:07,860] [.Transports : 2] ERROR [com.opensymphony.xwork2.util.InstantiatingNullHandler ] : Could not create and/or set value back on to object org.springframework.beans.factory.BeanCreationException: Error creating bean with name '[Lcom.mypath.CoverTypeVO;': Could not resolve matching constructor at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:178) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:799) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowire(AbstractAutowireCapableBeanFactory.java:255) at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:145) at com.opensymphony.xwork2.util.InstantiatingNullHandler.createObject(InstantiatingNullHandler.java:123) at com.opensymphony.xwork2.util.InstantiatingNullHandler.nullPropertyValue(InstantiatingNullHandler.java:104) at ognl.ASTProperty.getValueBody(ASTProperty.java:94) at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) at ognl.SimpleNode.getValue(SimpleNode.java:210) at ognl.ASTChain.setValueBody(ASTChain.java:168) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186) at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:158) at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:193) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:159) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.ing.itrf.starlite.common.interceptor.StarliteSecurityInterceptor.intercept(StarliteSecurityInterceptor.java:54) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.ing.itrf.starlite.common.interceptor.StarliteDebugInterceptor.intercept(StarliteDebugInterceptor.java:54) at
Do we have such alternative?
Hello. Some days ago I looked in source code of project in ASP.net 2. Here I saw a good architectural alternative to: lt;%@ include file=/include/header.jsp % body lt;%@ include file=/include/footer.jsp % It looks like this: Page 1: lt;%@ CodeFile=EditUsers.aspx.cs MasterPageFile=~/Default.master % lt;asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder1 Runat=Server content 1+ asp.net controls lt;/asp:Content lt;asp:Content ID=Content2 ContentPlaceHolderID=ContentPlaceHolder2 Runat=Server content 2 + asp.net controls lt;/asp:Content and Template page=Default.master: lt;%@ Master Language=C# EnableTheming=True % lt;head...lt;/head lt;body col1 lt;div align=left lt;asp:ContentPlaceHolder ID=ContentPlaceHolder1 runat=server lt;/asp:ContentPlaceHolder lt;/div col2 lt;div align=right lt;/div lt;/body Do we have some similar mechanism is JSP 2 + struts2? Or Do i must use struts2++ library? -- View this message in context: http://www.nabble.com/Do-we-have-such-alternative--tp18441301p18441301.html Sent from the Struts - User mailing list archive at Nabble.com.
Re: Do we have such alternative?
2008/7/14 Igor Vlasov [EMAIL PROTECTED]: Do we have some similar mechanism is JSP 2 + struts2? Well, Tiles: http://tiles.apache.org/ Struts 2 has a Tiles plugin: http://struts.apache.org/2.x/docs/tiles-plugin.html Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Do we have such alternative?
Hello, Do we have some similar mechanism is JSP 2 + struts2? Or Do i must use struts2++ library? JSP can not do that out of the box. But there are very good solutions available. Have a look at Sitemesh or Tiles2: - http://struts.apache.org/2.x/docs/sitemesh-plugin.html - http://struts.apache.org/2.x/docs/tiles-plugin.html Piero - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Do we have such alternative?
Piero Sartini-3 wrote: Hello, Do we have some similar mechanism is JSP 2 + struts2? Or Do i must use struts2++ library? JSP can not do that out of the box. But there are very good solutions available. Have a look at Sitemesh or Tiles2: - http://struts.apache.org/2.x/docs/sitemesh-plugin.html - http://struts.apache.org/2.x/docs/tiles-plugin.html Piero Thank for your answer. I will try . -- View this message in context: http://www.nabble.com/Do-we-have-such-alternative--tp18441301p18441909.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 configuration problems
Hello List... I tried to extend a existing webapp based on a own framework with some actions using struts2. After I added all necessary libraries, the struts2 filter and the struts.xml I have some errors when the tomcat starts up. (see further below) Whats odd about that - I can call a defined action and in the debugger I can see that the execute method is called. But when I try to access properties of the action with s:property value=MyValue / it is empty. Trying it with s:property / shows the class DefaultTextProvider. Tried to find something about that issue on the list, but I am not sure for what I should search. The exception gave just a few responses, but with no clue how to fix it. Thanks in advance! Jan Froehlich Parse Error at line 2 column 16: Document root element struts-config, must match DOCTYPE root null. org.xml.sax.SAXParseException: Document root element struts-config, must match DOCTYPE root null. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno wn Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U nknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRoot ElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(SAXParser.java:344) at javax.xml.parsers.SAXParser.parse(SAXParser.java:120) at org.apache.struts.digester.Digester.parse(Digester.java:755) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:13 32) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 626) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java :553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31 1) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) Parse Error at line 2 column 16: Document is invalid: no grammar found. org.xml.sax.SAXParseException: Document is invalid: no grammar found.
Re: [S2] Recipe for Action and View
Calling an action's input() method is a shortcut to render the page pointed by the input result. If you need to do some processing before displaying the page, just implement a regular action. 2008/7/14 ravi_eze [EMAIL PROTECTED]: hi, i didnt get you. I have a page for which i need to do some preprocessing to display it. After the page is done by user it has to be processed. Can you please elaborate on the soln given? ravi Gabriel Belingueres-2 wrote: Sorry it seems I entered the conversation later and didn't saw that email. The problem you want to solve is very common (skipping form validation the first time you call an action) and, as Dave wrote, it is commonly solved by invoking the action with the input() method [1]. This method will do nothing and will return INPUT as the result, thus forwarding the response to the page with the form. [1] http://struts.apache.org/2.1.2/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html#input() 2008/7/12 Andreas Mähler [EMAIL PROTECTED]: Hello again, Gabriel Belingueres schrieb: Without knowing what are you actually trying to accomplish with this interceptor, I would warn that when an interceptor messes up with the parameters, you need to carefully think where in the interceptor chain this interceptor will execute. I explain what I am trying to do in my first post[1]. What do you mean by messing up with the parameters? The Interceptor only checks for the presence of at least one of the specified parameters. It does not change anything. Are there any interceptors that actually change the parameter map? As I said, I am a S2 newbie and haven't heard of many things, but I would consider it as bad style. Greetings, ~Andreas [1] http://article.gmane.org/gmane.comp.jakarta.struts.user/158395 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Recipe-for-Action-and-View-tp18381617p18438070.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] s:property - how to use CSS on it?
You could pass a css class to the s:actionerror tag. If the HTML code that produces s:actionerror doesn't satisfy you, you can define your own actionerror.ftl template. 2008/7/14 wild_oscar [EMAIL PROTECTED]: Because I want just a simple list of actionErrors, I have an iterator for the actionErrors such as: s:iterator value=actionErrors s:property/ /s:iterator However, how can I use Css calsses on the property? I want to display the error in red, but the property element doesn't have any CSS property. What's the best way of applying a Css syle to it? -- View this message in context: http://www.nabble.com/-S2--s%3Aproperty---how-to-use-CSS-on-it--tp18440945p18440945.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 configuration problems
struts-config is not a the document root element of S2's struts.xml file. That's the root element of S1 configuration file. 2008/7/14 Jan Froehlich [EMAIL PROTECTED]: Hello List... I tried to extend a existing webapp based on a own framework with some actions using struts2. After I added all necessary libraries, the struts2 filter and the struts.xml I have some errors when the tomcat starts up. (see further below) Whats odd about that - I can call a defined action and in the debugger I can see that the execute method is called. But when I try to access properties of the action with s:property value=MyValue / it is empty. Trying it with s:property / shows the class DefaultTextProvider. Tried to find something about that issue on the list, but I am not sure for what I should search. The exception gave just a few responses, but with no clue how to fix it. Thanks in advance! Jan Froehlich Parse Error at line 2 column 16: Document root element struts-config, must match DOCTYPE root null. org.xml.sax.SAXParseException: Document root element struts-config, must match DOCTYPE root null. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno wn Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U nknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRoot ElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(SAXParser.java:344) at javax.xml.parsers.SAXParser.parse(SAXParser.java:120) at org.apache.struts.digester.Digester.parse(Digester.java:755) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:13 32) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 626) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java :553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31 1) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at
RE: struts2 validation
If you don't have an action property named fieldname then not only will validation not work but neither will normal property copying (from form to action). If, for example, you have a MyForm named form, and has an appropriate getter/setter, its form element would look like this: s:textfield name=form.fieldName/ If you're handling validation programmatically (via the Validateable interface and the action's validate() method) you'd then validate against the MyForm instance, for example: public void validate() { if (StringUtils.isBlank(this.form.getFieldName())) { ... } ... } It sort of seems like you're implementing a bit of ModelDriven, but manually--not a problem, but seems a bit duplicative. Dave --- On Mon, 7/14/08, Nicole Luneburg wrote: From: Nicole Luneburg [EMAIL PROTECTED] Subject: RE: struts2 validation To: Struts Users Mailing List user@struts.apache.org Date: Monday, July 14, 2008, 3:16 AM ps. My post added some 3D text that isn't supposed to be there ... Thanks Jeromy. Yes I do have a s:head attribute, maybe not *exactly* but I have: s:head theme=ajax / Apologies for the confusion. What I meant in my pevious post was that I had tried a few ways to do this validation task. In my initial post I had described one of these attempts which I think should have worked. What I am getting regardless of what sort of validation I try to implement is this error: java.lang.StringIndexOutOfBoundsException: String index out of range: -7 You mentioned the getters and setters for the fieldnames ... this only works though if the fields are stored in the action right? coz the fields I have aren't stored in the action, they are stored in a Form class. Ie my action looks something like: public String execute() { MyForm myForm = (MyForm)super.form; String myField = myForm.getFieldName(); } Markus: Thanks for your reply too, I am trying it right now. Just want this to work grrr -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Monday, 14 July 2008 4:25 PM To: Struts Users Mailing List Subject: Re: struts2 validation Nicole Luneburg wrote: s:form action=3Dmyaction method=3Dpost validate=3Dtrue The validate attribute here is used to enable client-side validation only. That will only work if you include the s:head attribute in the page. My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1 I was using the validate(...) method in the Form class. It seems none of the Struts2 validation examples on the net are working for= me. You haven't mentioned whether you're using XML validation or annotation-based validation. If by not working you mean does nothing, then your XML file is probably incorrectly named or your missing an annotation. (You need to enable this separately from client-side validation) Whatever the case, the main difference between Struts1 and Struts2 here is that Struts2 performs validation on the Object, not on the form parameters. That means, to check that fieldName is non-blank, it will call getFieldName() after setFieldName() was called by the ParametersInterceptor. A common problem is to forget the getter, but in that case Struts will keep returning INPUT (validation failed) instead of invoking your action. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] s:property - how to use CSS on it?
--- On Mon, 7/14/08, wild_oscar [EMAIL PROTECTED] wrote: s:iterator value=actionErrors s:property/ /s:iterator However, how can I use Css calsses on the property? I want to display the error in red, but the property element doesn't have any CSS property. What's the best way of applying a Css syle to it? span class=...s:property//span (Or div..., or put it in a list and have a class for list elements, or... any other CSS methodology.) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] NPE when using struts form tags in sitemesh decorator
The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some time ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in newer builds. The problem seems to be that Freemarker can't get its configuration at this point. But ActionContextCleanUp is the first filter in chain, and tags like @s.url do work, only the form and input fields do not work. If I try the exact same form outside the decorator in a normal, decorated page, everything works like expected. Any ideas? java.lang.NullPointerException at org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(FreemarkerManager.java:159) at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:90) at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:558) at org.apache.struts2.components.Submit.end(Submit.java:109) at org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(CallbackWriter.java:84) at freemarker.core.Environment.visit(Environment.java:299) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.include(Environment.java:1477) at freemarker.core.Include.accept(Include.java:169) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.process(Environment.java:188) at freemarker.template.Template.process(Template.java:237) at org.apache.struts2.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMarkerPageFilter.java:160) at org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageFilter.java:116) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) ... ... ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: about security
I am new to the web development, but I like the concept of this answer. Could you explain more about how to setup/configure the interceptor? i.e. How to hook up your interceptor method with the server? Thanks! -Original Message- From: Struts Two [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2008 9:32 AM To: Struts Users Mailing List Subject: Re: about security Here are my thoughts [based on my experience with Websphere but I hope they can be generalized): 1- Using session for users's authentication is not a very good idea esp if there is a chance that they may have multiple browser or tabs open at the sametime. there is a great chance of session mix-ups. However; if you are , for some reason or another, pressed to use http session, make sure that you use url rewriting instead of cookies for session tracking[ Websphere also allows a thrid way to use ssl ids for this purpose if you use ssl]. To do so you do not need to change your code, you need to change container settings. 2- Applying security using JASS or realm is a web-container setting not struts 2. You need to do two things: a) Enable the security of your container (server) to use a registery for authentication (LDAP,OS,...). Note that some servers like websphere allow you to extend its capability to use a custome registery (say database for this purpose) b) Change your web.xml and application.xml (add security constraints and roles and ...). Once it is done. It does not matter u use struts 2 or struts 1 or anyother framework. At logging (first access) users get chanllenged. In my case, to avoid using session for authentication, I am using an interceptor to retrieve user role and other information on each request. Note that once a user is logged in (assuming you use single signon), users' credentials (login name) are cached by the server and at each request you can retrieve it using request.getRemoteUser(). So you can rid of session by paying a very slight overhead of retriving all necessary information at each request using an interceptor. regards, - Original Message From: hns [EMAIL PROTECTED] To: user@struts.apache.org Sent: Friday, July 11, 2008 8:17:54 AM Subject: about security hi i have successfully converted and deployed struts 2.0.11 application to client but still have some security questions because i have less knowledge of jaas ,realm or role based security i have done authentication using query fire in database for user name and password when user authenticated i have stored his user name and user id and user type (admin,executive,branch head) in session problems 1. users can login from diff node or diff explorer n with same user name ,how to solve it 2. how can i apply realm or jaas in struts 2.0.11 please help me ,i am waiting for favorable reply -- View this message in context: http://www.nabble.com/about-security-tp18402549p18402549.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Get the name you've always wanted @ymail.com or @rocketmail.com today! Go to http://ca.promos.yahoo.com/jacko/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Struts2 configuration problems
Well, ok thats really odd... The libs and configuration I added are definetely s2. If you take a look at the other error I got - executed actions but in properties just returns the DefaultTextProvider - can you give me a hint about that? Might be that I got two issues Thanks in advance! -Ursprüngliche Nachricht- Von: Gabriel Belingueres [mailto:[EMAIL PROTECTED] Gesendet: Montag, 14. Juli 2008 14:47 An: Struts Users Mailing List Betreff: Re: Struts2 configuration problems struts-config is not a the document root element of S2's struts.xml file. That's the root element of S1 configuration file. 2008/7/14 Jan Froehlich [EMAIL PROTECTED]: Hello List... I tried to extend a existing webapp based on a own framework with some actions using struts2. After I added all necessary libraries, the struts2 filter and the struts.xml I have some errors when the tomcat starts up. (see further below) Whats odd about that - I can call a defined action and in the debugger I can see that the execute method is called. But when I try to access properties of the action with s:property value=MyValue / it is empty. Trying it with s:property / shows the class DefaultTextProvider. Tried to find something about that issue on the list, but I am not sure for what I should search. The exception gave just a few responses, but with no clue how to fix it. Thanks in advance! Jan Froehlich Parse Error at line 2 column 16: Document root element struts-config, must match DOCTYPE root null. org.xml.sax.SAXParseException: Document root element struts-config, must match DOCTYPE root null. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno wn Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U nknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRoot ElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(SAXParser.java:344) at javax.xml.parsers.SAXParser.parse(SAXParser.java:120) at org.apache.struts.digester.Digester.parse(Digester.java:755) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:13 32) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 626) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java :553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31 1) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at
Re: [S2] s:property - how to use CSS on it?
Thank you.The tag works fine for now. I will also look into modifying the actionerror template when I need a more customized tag. newton.dave wrote: --- On Mon, 7/14/08, wild_oscar [EMAIL PROTECTED] wrote: s:iterator value=actionErrors s:property/ /s:iterator However, how can I use Css calsses on the property? I want to display the error in red, but the property element doesn't have any CSS property. What's the best way of applying a Css syle to it? s:property/ (Or div..., or put it in a list and have a class for list elements, or... any other CSS methodology.) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--s%3Aproperty---how-to-use-CSS-on-it--tp18440945p18444061.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: REST and JSON plugins
The original idea behind the JSON plugin was to use an external library to serialize the objects, xstream to be more specific. But xstream json wasn't even usable at that point and json-lib didn't look that good to me. I think Struts 2 should include a json plugin, and yes we could delegate the serialization to json-lib, or xstream. musachy On Mon, Jul 14, 2008 at 4:07 AM, Jeromy Evans [EMAIL PROTECTED] wrote: Oleg Mikheev wrote: Hi! Will REST plugin replace JSON plugin in Struts 2.1? To my mind JSON plugin was very REST-like, and I was really hoping that it would evolve into something that REST plugin claims to be. Also, do REST and JSON plugins have anything in common? They're not related except both can serialize an action/model into JSON. In the past I created a ContentTypeHandler for the REST Plugin that used the JSON plugin's serializer. The result was exactly the same. The REST plugin uses json-lib for its default JSON ContentTypeHandler. (http://json-lib.sourceforge.net/) The advantage of JSON-lib is that it's bidirectional (essential for the plugin) and is used in many frameworks. The advantage of the JSON-plugin is that it includes some simple options to customize the output specifically for S2 (such as changing the root object). I've contributed to both the JSON plugin and REST plugin and use the JSON plugin when I'm writing plain actions that return JSON responses and json-lib when using the REST plugin. The options the JSON-plugin provides are generally not relevant when using the REST plugin so it's not valuable to run both. The JSON plugin should probably be updated to allow the serializer to be customized so you can use the json-lib serializer or the native serializer. After I read REST plugin author's Struts 2 in Action book it seemed that he wasn't aware of JSON plugin at all - he devoted several pages to implementation of a custom JSON handlers instead of just dropping JSON plugin into Struts 2 stack.. I presume that's just because the JSON plugin isn't part of the Struts 2 distribution per se. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: about security
HI According to help of some previous threads i have created Login interceptor,i really such thankful to all helpful people who help me in this discussion please http://www.nabble.com/about-current-action-name-acsess-td15736383.html#a15755941 Check here and read out from first thread ,you can take advantage of it Yanni Tan wrote: I am new to the web development, but I like the concept of this answer. Could you explain more about how to setup/configure the interceptor? i.e. How to hook up your interceptor method with the server? Thanks! -- View this message in context: http://www.nabble.com/about-security-tp18402549p18444283.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
about iterating values
hi it might be this question is not related s2 but still i want to ask i am using one public function in one class which get key,value pair from database query fire and fill in linked hashmap and return iterator to access on jsp page i have used jsp:usebean of this class to get access public function which iterate data in page scope for my select box now i have to ask when i refresh or redirect this page ,every times Map will get details from database ,so at codebehind database accesss happens so many times when i refresh or redirect it, how can i solve this issue now -- View this message in context: http://www.nabble.com/about-iterating-values-tp18444913p18444913.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Struts2 configuration problems
Maybe the header of your struts.xml does use the wrong DTD. The correct header looks like this: ?xml version=1.0 encoding=UTF-8? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; Am Montag, 14. Juli 2008 15:31:47 schrieb Jan Froehlich: Well, ok thats really odd... The libs and configuration I added are definetely s2. If you take a look at the other error I got - executed actions but in properties just returns the DefaultTextProvider - can you give me a hint about that? Might be that I got two issues Thanks in advance! -Ursprüngliche Nachricht- Von: Gabriel Belingueres [mailto:[EMAIL PROTECTED] Gesendet: Montag, 14. Juli 2008 14:47 An: Struts Users Mailing List Betreff: Re: Struts2 configuration problems struts-config is not a the document root element of S2's struts.xml file. That's the root element of S1 configuration file. 2008/7/14 Jan Froehlich [EMAIL PROTECTED]: Hello List... I tried to extend a existing webapp based on a own framework with some actions using struts2. After I added all necessary libraries, the struts2 filter and the struts.xml I have some errors when the tomcat starts up. (see further below) Whats odd about that - I can call a defined action and in the debugger I can see that the execute method is called. But when I try to access properties of the action with s:property value=MyValue / it is empty. Trying it with s:property / shows the class DefaultTextProvider. Tried to find something about that issue on the list, but I am not sure for what I should search. The exception gave just a few responses, but with no clue how to fix it. Thanks in advance! Jan Froehlich Parse Error at line 2 column 16: Document root element struts-config, must match DOCTYPE root null. org.xml.sax.SAXParseException: Document root element struts-config, must match DOCTYPE root null. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno wn Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U nknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRoot ElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(SAXParser.java:344) at javax.xml.parsers.SAXParser.parse(SAXParser.java:120) at org.apache.struts.digester.Digester.parse(Digester.java:755) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:13 32) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 626) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java :553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31 1) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:120)
problem running a simple struts app
Hi all, I am new on the list and new using struts. Trying to run a simple application that I took from the web ( http://www.abqswt.com/tutorials/basicStruts/index.php ) keep getting the following message, but cannot find out what the real problem is. Any help will be very usefull. == org.apache.jasper.JasperException: Exception in JSP: /PersonalData.jsp:15 12: /head 13: 14: body 15: html:form method=post action=/PersonalData 16: table border=0 17: tr 18: td width=50 root cause: java.lang.NullPointerException: Module 'null' not found. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem url decoding with mutated vowels (Umlaute??)
Hi, we have an action which we call with url paramters from other applications. But now we found out, that we have problems with mutated wowels like äöü. Instead of tls-hölter we get tls-hölter in the parameterMap of the servletRequest (I debugged). I assume that the parameters are decoded with iso ISO-8859-1 instead of utf-8 or otherwise. Is there an option to tell struts2 which charset it should use to decode? The url looks like this: http://localhost:8080/bpc/search.action?ctxSid=20080714082158393251000userId=xxxpageTitle=BlareturnUrl=http://localhost:9080?methodToCall=loadWithCustDetailssimpleSearch=tls-h%C3%B6lter We call the application running on tomcat from an application running on websphere 6.1. Thanks in advance... Best regards, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem url decoding with mutated vowels (Umlaute??)
Hello, you can try the following settings in struts.xml: constant name=struts.i18n.encoding value=UTF-8/ constant name=struts.locale value=de_DE/ Please let me know if this resolves your issue. Piero Am Montag, 14. Juli 2008 15:25:14 schrieb Marc Eckart: Hi, we have an action which we call with url paramters from other applications. But now we found out, that we have problems with mutated wowels like äöü. Instead of tls-hölter we get tls-hölter in the parameterMap of the servletRequest (I debugged). I assume that the parameters are decoded with iso ISO-8859-1 instead of utf-8 or otherwise. Is there an option to tell struts2 which charset it should use to decode? The url looks like this: http://localhost:8080/bpc/search.action?ctxSid=20080714082158393251000user Id=xxxpageTitle=BlareturnUrl=http://localhost:9080?methodToCall=loadWithCu stDetailssimpleSearch=tls-h%C3%B6lter We call the application running on tomcat from an application running on websphere 6.1. Thanks in advance... Best regards, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem running a simple struts app
Without the configuration it'll be tough to help. Any particular reason you're using Struts 1 instead of Struts 2? Dave --- On Mon, 7/14/08, Dante A. Castiglione Maldonado wrote: From: Dante A. Castiglione Maldonado [EMAIL PROTECTED] Subject: problem running a simple struts app To: user@struts.apache.org Date: Monday, July 14, 2008, 10:24 AM Hi all, I am new on the list and new using struts. Trying to run a simple application that I took from the web ( http://www.abqswt.com/tutorials/basicStruts/index.php ) keep getting the following message, but cannot find out what the real problem is. Any help will be very usefull. == org.apache.jasper.JasperException: Exception in JSP: /PersonalData.jsp:15 12: /head 13: 14: body 15: html:form method=post action=/PersonalData 16: table border=0 17: tr 18: td width=50 root cause: java.lang.NullPointerException: Module 'null' not found. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem running a simple struts app
Thanks a lot No, no particular reason. I thought it would be easier to learn. Should I go to version 2? What configuration information/files should i send? 2008/7/14 Dave Newton [EMAIL PROTECTED]: Without the configuration it'll be tough to help. Any particular reason you're using Struts 1 instead of Struts 2? Dave --- On Mon, 7/14/08, Dante A. Castiglione Maldonado wrote: From: Dante A. Castiglione Maldonado [EMAIL PROTECTED] Subject: problem running a simple struts app To: user@struts.apache.org Date: Monday, July 14, 2008, 10:24 AM Hi all, I am new on the list and new using struts. Trying to run a simple application that I took from the web ( http://www.abqswt.com/tutorials/basicStruts/index.php ) keep getting the following message, but cannot find out what the real problem is. Any help will be very usefull. == org.apache.jasper.JasperException: Exception in JSP: /PersonalData.jsp:15 12: /head 13: 14: body 15: html:form method=post action=/PersonalData 16: table border=0 17: tr 18: td width=50 root cause: java.lang.NullPointerException: Module 'null' not found. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem running a simple struts app
--- On Mon, 7/14/08, Dante A. Castiglione Maldonado wrote: I thought it would be easier to learn. Should I go to version 2? Yes. What configuration information/files should i send? The struts configuration file. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem running a simple struts app
Thank you very much Here are the files 2008/7/14 Dave Newton [EMAIL PROTECTED]: --- On Mon, 7/14/08, Dante A. Castiglione Maldonado wrote: I thought it would be easier to learn. Should I go to version 2? Yes. What configuration information/files should i send? The struts configuration file. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.3//EN http://struts.apache.org/dtds/struts-config_1_3.dtd; struts-config !-- Form Bean Definitions -- form-beans form-bean name=PersonalDataForm type=pdata.PersonalData/ !-- Definition from book form-bean name=PersonalDataBean type=pdata.PersonalData form-property name=firstname type=java.lang.String/ form-property name=lastname type=java.lang.String/ form-property name=address type=java.lang.String/ form-property name=city type=java.lang.String/ form-property name=state type=java.lang.String/ /form-bean -- /form-beans !-- = Global Exception Definitions -- global-exceptions !-- sample exception handler exception key=expired.password type=app.ExpiredPasswordException path=/changePassword.jsp/ end sample -- /global-exceptions !-- === Global Forward Definitions -- global-forwards !-- Default forward to Welcome action -- !-- Demonstrates using index.jsp to forward -- forward name=welcome path=/Welcome.do/ /global-forwards !-- === Action Mapping Definitions -- action-mappings !-- Default Welcome action -- !-- Forwards to Welcome.jsp -- action path=/Welcome forward=/Welcome.jsp/ action path=/PersonalData forward=/PersonalData.jsp/ action path=/Results type=pdata.PersonalDataAction scope=request name=personalDataBean input=/PersonalData.jsp forward name=success path=/Results.jsp/forward forward name=failure path=/Error.jsp/forward /action /action-mappings !-- Message Resources Definitions -- message-resources parameter=ApplicationResources null=false /message-resources !-- === Plug Ins Configuration -- !-- === Validator plugin -- plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/org/apache/struts/validator/validator-rules.xml, /WEB-INF/validation.xml/ /plug-in /struts-config ?xml version=1.0 encoding=ISO-8859-1 ? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.3.0//EN http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd; form-validation !-- This is a minimal Validator form file with a couple of examples. -- global !-- An example global constant constant constant-namepostalCode/constant-name constant-value^\d{5}\d*$/constant-value /constant end example-- /global formset !-- An example form -- form name=logonForm field property=username depends=required arg key=logonForm.username/ /field field property=password depends=required,mask arg key=logonForm.password/ var var-namemask/var-name var-value^[0-9a-zA-Z]*$/var-value /var /field /form /formset !-- An example formset for another locale -- formset language=fr constant
Re: REST and JSON plugins
+1 for a pluggable serializer. I dont like the internal json plugin serializer that much and yes, the plugin should be included in the distro because json is that popular these days -- Marc Logemann blog http://logemannreloaded.blogspot.com privat http://www.logemann.org Am 14.07.2008 um 15:42 schrieb Musachy Barroso: The original idea behind the JSON plugin was to use an external library to serialize the objects, xstream to be more specific. But xstream json wasn't even usable at that point and json-lib didn't look that good to me. I think Struts 2 should include a json plugin, and yes we could delegate the serialization to json-lib, or xstream. musachy On Mon, Jul 14, 2008 at 4:07 AM, Jeromy Evans [EMAIL PROTECTED] wrote: Oleg Mikheev wrote: Hi! Will REST plugin replace JSON plugin in Struts 2.1? To my mind JSON plugin was very REST-like, and I was really hoping that it would evolve into something that REST plugin claims to be. Also, do REST and JSON plugins have anything in common? They're not related except both can serialize an action/model into JSON. In the past I created a ContentTypeHandler for the REST Plugin that used the JSON plugin's serializer. The result was exactly the same. The REST plugin uses json-lib for its default JSON ContentTypeHandler. (http://json-lib.sourceforge.net/) The advantage of JSON-lib is that it's bidirectional (essential for the plugin) and is used in many frameworks. The advantage of the JSON-plugin is that it includes some simple options to customize the output specifically for S2 (such as changing the root object). I've contributed to both the JSON plugin and REST plugin and use the JSON plugin when I'm writing plain actions that return JSON responses and json-lib when using the REST plugin. The options the JSON-plugin provides are generally not relevant when using the REST plugin so it's not valuable to run both. The JSON plugin should probably be updated to allow the serializer to be customized so you can use the json-lib serializer or the native serializer. After I read REST plugin author's Struts 2 in Action book it seemed that he wasn't aware of JSON plugin at all - he devoted several pages to implementation of a custom JSON handlers instead of just dropping JSON plugin into Struts 2 stack.. I presume that's just because the JSON plugin isn't part of the Struts 2 distribution per se. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem running a simple struts app
--- On Mon, 7/14/08, Dante A. Castiglione Maldonado wrote: Here are the files In general, attachments are a bad idea on the mailing list. You have an essentially empty web.xml; you need to configure the ActionServlet. http://struts.apache.org/1.3.8/userGuide/configuration.html#dd_config It might have been better to follow the tutorial instructions and start with the blank application. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: REST and JSON plugins
It should be easy to plug in a new serializer (only JSONUtil needs to be changed I think). If you have suggestions on how to improve the current serializer, let me know, or even better, a patch ;) musachy On Mon, Jul 14, 2008 at 11:05 AM, Marc Logemann [EMAIL PROTECTED] wrote: +1 for a pluggable serializer. I dont like the internal json plugin serializer that much and yes, the plugin should be included in the distro because json is that popular these days -- Marc Logemann blog http://logemannreloaded.blogspot.com privat http://www.logemann.org Am 14.07.2008 um 15:42 schrieb Musachy Barroso: The original idea behind the JSON plugin was to use an external library to serialize the objects, xstream to be more specific. But xstream json wasn't even usable at that point and json-lib didn't look that good to me. I think Struts 2 should include a json plugin, and yes we could delegate the serialization to json-lib, or xstream. musachy On Mon, Jul 14, 2008 at 4:07 AM, Jeromy Evans [EMAIL PROTECTED] wrote: Oleg Mikheev wrote: Hi! Will REST plugin replace JSON plugin in Struts 2.1? To my mind JSON plugin was very REST-like, and I was really hoping that it would evolve into something that REST plugin claims to be. Also, do REST and JSON plugins have anything in common? They're not related except both can serialize an action/model into JSON. In the past I created a ContentTypeHandler for the REST Plugin that used the JSON plugin's serializer. The result was exactly the same. The REST plugin uses json-lib for its default JSON ContentTypeHandler. (http://json-lib.sourceforge.net/) The advantage of JSON-lib is that it's bidirectional (essential for the plugin) and is used in many frameworks. The advantage of the JSON-plugin is that it includes some simple options to customize the output specifically for S2 (such as changing the root object). I've contributed to both the JSON plugin and REST plugin and use the JSON plugin when I'm writing plain actions that return JSON responses and json-lib when using the REST plugin. The options the JSON-plugin provides are generally not relevant when using the REST plugin so it's not valuable to run both. The JSON plugin should probably be updated to allow the serializer to be customized so you can use the json-lib serializer or the native serializer. After I read REST plugin author's Struts 2 in Action book it seemed that he wasn't aware of JSON plugin at all - he devoted several pages to implementation of a custom JSON handlers instead of just dropping JSON plugin into Struts 2 stack.. I presume that's just because the JSON plugin isn't part of the Struts 2 distribution per se. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
message resources ???key??? displaying
Hi, I´m developing a project with Struts 1.2. When trying to display html:errors in a jsp page, the errors saved in SaveMessages are displayed, but not correctly, for example: in showerrors.jsp: ???es.error.wrong.password??? instead of: Your password is wrong. The ApplicationResources.properties file is properly mapped with its keys. error.wrong.password = Your password is wrong Figure out that a es. is displayed while no Locale configuration has been setup. What should I check? Any ideas will be welcomed. Thanks,
Re: Problem url decoding with mutated vowels (Umlaute??)
Hi all, maybe it's related with tomcat (or another container You use), One should add URIEncoding=utf-8 in connector like this: Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 URIEncoding=utf-8/ Hope this helps. Best greetings, Paweł Wielgus. 2008/7/14 Piero Sartini [EMAIL PROTECTED]: Hello, you can try the following settings in struts.xml: constant name=struts.i18n.encoding value=UTF-8/ constant name=struts.locale value=de_DE/ Please let me know if this resolves your issue. Piero Am Montag, 14. Juli 2008 15:25:14 schrieb Marc Eckart: Hi, we have an action which we call with url paramters from other applications. But now we found out, that we have problems with mutated wowels like äöü. Instead of tls-hölter we get tls-hölter in the parameterMap of the servletRequest (I debugged). I assume that the parameters are decoded with iso ISO-8859-1 instead of utf-8 or otherwise. Is there an option to tell struts2 which charset it should use to decode? The url looks like this: http://localhost:8080/bpc/search.action?ctxSid=20080714082158393251000user Id=xxxpageTitle=BlareturnUrl=http://localhost:9080?methodToCall=loadWithCu stDetailssimpleSearch=tls-h%C3%B6lter We call the application running on tomcat from an application running on websphere 6.1. Thanks in advance... Best regards, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: message resources ???key??? displaying
Hi, How did you configure the messages in struts-config? It should be something like this: message-resources parameter=MessageResources/ Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] newly-created Session context
I have an interceptor that puts an object in the Session scope. The interceptor calls the following when retrieving the Session: public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) context.get(StrutsStatics.HTTP_REQUEST); HttpSession session = request.getSession(true /* create if need be */); session.setAttribute(attributeName, someObject); ... } Given that code, I don't see how the Session could be null after that interception --- otherwise an exception would be thrown at the point when I attempt to set the Session attribute. Yet, immediately after I start the server (therefore no Session has yet been created), if I issue a browser request on an action that uses that interceptor, OGNL reports the Session as being indeed null --- or so the xml-debug output of the context shows. It's only on the second request that the xml-debug shows a Session context containing the desired object. Is there a way of explaining this discrepancy? Apart from this custom interceptor, I use the paramPrepareParam stack. Would there be another interceptor in there interfering with my custom newly-created Session (but not interfering when the Session is not new anymore)? Toughts?
Re: [S2] NPE when using struts form tags in sitemesh decorator
Ok, the problem was that since 2.1.3 the filters changed: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter instead of ActionContextCleanup and org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter instead of the FilterDispatcher. Now everything works like expected. I will update the wiki of the sitemesh plugin .. Am Montag, 14. Juli 2008 15:23:16 schrieb Piero Sartini: The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some time ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in newer builds. The problem seems to be that Freemarker can't get its configuration at this point. But ActionContextCleanUp is the first filter in chain, and tags like @s.url do work, only the form and input fields do not work. If I try the exact same form outside the decorator in a normal, decorated page, everything works like expected. Any ideas? java.lang.NullPointerException at org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(Free markerManager.java:159) at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTempl ate(FreemarkerTemplateEngine.java:90) at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:558) at org.apache.struts2.components.Submit.end(Submit.java:109) at org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(CallbackW riter.java:84) at freemarker.core.Environment.visit(Environment.java:299) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.include(Environment.java:1477) at freemarker.core.Include.accept(Include.java:169) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.process(Environment.java:188) at freemarker.template.Template.process(Template.java:237) at org.apache.struts2.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMarkerP ageFilter.java:160) at org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageF ilter.java:116) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java :62) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio nFilterChain.java:246) ... ... ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles questions
I have a mainLayout which has a header, body and footer.(and thus I have 4 jsps, mainLayout.jsp, header.jsp, body.jsp, and footer.jsp, and notice that body.jsp will be different for each different screen page). One setting can be of: !-- shared by all -- definition name=mainLayout path=/jsp/common/mainLayout.jsp put name=header value=/jsp/common/header.jsp / put name=body value= / put name=footer value=/jsp/common/footer.jsp / /definition !-- this is different from each screen page -- definition name=viewemployee extends=mainLayout put name=body value=/jsp/employee/employee.jsp / /definition Then I have a further requirement: Manager pages's body has left, middle and right. All manager pages will have common left and right, but middle will be different. So I define the managerBody like !-- every manager page shares this -- definition name=managerBody path=/jsp/common/managerBodyLayout.jsp put name=left value=/jsp/common/left.jsp/ put name=middle value=/ put name=right value=/jsp/common/right.jsp/ /definition Then if I have managerPage1, I can define as: definition name=managerPage1 extends=mainLayout put name=bodyContent value=managerBody/ put name=middle value=/jsp/manager/managerMiddle1.jsp// /definition Unfortunately, this doesn't work. Can somebody help? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles questions
I have a mainLayout which has a header, body and footer.(and thus I have 4 jsps, mainLayout.jsp, header.jsp, body.jsp, and footer.jsp, and notice that body.jsp will be different for each different screen page). One setting can be of: !-- shared by all -- definition name=mainLayout path=/jsp/common/mainLayout.jsp put name=header value=/jsp/common/header.jsp / put name=body value= / put name=footer value=/jsp/common/footer.jsp / /definition !-- this is different from each screen page -- definition name=viewemployee extends=mainLayout put name=body value=/jsp/employee/employee.jsp / /definition Then I have a further requirement: Manager pages's body has left, middle and right. All manager pages will have common left and right, but middle will be different. So I define the managerBody like !-- every manager page shares this -- definition name=managerBody path=/jsp/common/managerBodyLayout.jsp put name=left value=/jsp/common/left.jsp/ put name=middle value=/ put name=right value=/jsp/common/right.jsp/ /definition Then if I have managerPage1, I can define as: definition name=managerPage1 extends=mainLayout put name=body value=managerBody/ put name=middle value=/jsp/manager/managerMiddle1.jsp// /definition Unfortunately, this doesn't work. Can somebody help? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tiles questions
That's because the tiles inheritance you are trying to use doesn't make sense. The managerPage1 tile does NOT have a middle element in the parent tile (which is defined in the managerBody tile). You probably need to use a different strategy, perhaps check the role and forward to the proper tile (tile layout for managers and tile layout for non-managers). Zhang, Larry (L.) wrote: I have a mainLayout which has a header, body and footer.(and thus I have 4 jsps, mainLayout.jsp, header.jsp, body.jsp, and footer.jsp, and notice that body.jsp will be different for each different screen page). One setting can be of: !-- shared by all -- definition name=mainLayout path=/jsp/common/mainLayout.jsp put name=header value=/jsp/common/header.jsp / put name=body value= / put name=footer value=/jsp/common/footer.jsp / /definition !-- this is different from each screen page -- definition name=viewemployee extends=mainLayout put name=body value=/jsp/employee/employee.jsp / /definition Then I have a further requirement: Manager pages's body has left, middle and right. All manager pages will have common left and right, but middle will be different. So I define the managerBody like !-- every manager page shares this -- definition name=managerBody path=/jsp/common/managerBodyLayout.jsp put name=left value=/jsp/common/left.jsp/ put name=middle value=/ put name=right value=/jsp/common/right.jsp/ /definition Then if I have managerPage1, I can define as: definition name=managerPage1 extends=mainLayout put name=body value=managerBody/ put name=middle value=/jsp/manager/managerMiddle1.jsp// /definition Unfortunately, this doesn't work. Can somebody help? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: message resources ???key??? displaying
It is configured as: struts-config.xml message-resources parameter=ApplicationResources null=false / In web.xml is not defined. The ApplicationResources.properties file is under: proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties And the jsp code: logic:messagesPresent message=true html:messages id=msgs message=true bean:write name=msgs/ /html:messages /logic:messagesPresent Is something wrong about the path/classpath? Do I need to add a key to message-resources parameter=ApplicationResources.. key=whatever?? Regards, - Original Message - From: Lukasz Lenart [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, July 14, 2008 6:32 PM Subject: Re: message resources ???key??? displaying Hi, How did you configure the messages in struts-config? It should be something like this: message-resources parameter=MessageResources/ Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Email procesado por MailFoundry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] NPE when using struts form tags in sitemesh decorator
Don is still working on those changes, you could open a ticket to make sure everything gets documented. musachy On Mon, Jul 14, 2008 at 1:22 PM, Piero Sartini [EMAIL PROTECTED] wrote: Ok, the problem was that since 2.1.3 the filters changed: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter instead of ActionContextCleanup and org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter instead of the FilterDispatcher. Now everything works like expected. I will update the wiki of the sitemesh plugin .. Am Montag, 14. Juli 2008 15:23:16 schrieb Piero Sartini: The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some time ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in newer builds. The problem seems to be that Freemarker can't get its configuration at this point. But ActionContextCleanUp is the first filter in chain, and tags like @s.url do work, only the form and input fields do not work. If I try the exact same form outside the decorator in a normal, decorated page, everything works like expected. Any ideas? java.lang.NullPointerException at org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(Free markerManager.java:159) at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTempl ate(FreemarkerTemplateEngine.java:90) at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:558) at org.apache.struts2.components.Submit.end(Submit.java:109) at org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(CallbackW riter.java:84) at freemarker.core.Environment.visit(Environment.java:299) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.include(Environment.java:1477) at freemarker.core.Include.accept(Include.java:169) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.process(Environment.java:188) at freemarker.template.Template.process(Template.java:237) at org.apache.struts2.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMarkerP ageFilter.java:160) at org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageF ilter.java:116) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java :62) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio nFilterChain.java:246) ... ... ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: message resources ???key??? displaying
I got the same problem a few moments ago I put the ApplicationResources.properties file under WEB-INF/classes and it worked ok 2008/7/14 [EMAIL PROTECTED]: It is configured as: struts-config.xml message-resources parameter=ApplicationResources null=false / In web.xml is not defined. The ApplicationResources.properties file is under: proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties And the jsp code: logic:messagesPresent message=true html:messages id=msgs message=true bean:write name=msgs/ /html:messages /logic:messagesPresent Is something wrong about the path/classpath? Do I need to add a key to message-resources parameter=ApplicationResources.. key=whatever?? Regards, - Original Message - From: Lukasz Lenart [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, July 14, 2008 6:32 PM Subject: Re: message resources ???key??? displaying Hi, How did you configure the messages in struts-config? It should be something like this: message-resources parameter=MessageResources/ Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Email procesado por MailFoundry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: message resources ???key??? displaying
The ApplicationResources.properties file is under: proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties Move to the /WEB-INF/classes Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: message resources ???key??? displaying
Hi, That was the correct path, I didn´t know about it. Thank you for your answers, guys. ;-) - Original Message - From: Lukasz Lenart [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, July 14, 2008 8:22 PM Subject: Re: message resources ???key??? displaying The ApplicationResources.properties file is under: proyect_name/Webroot/WEB-INF/lib/ApplicationResources.properties Move to the /WEB-INF/classes Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Email procesado por MailFoundry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] NPE when using struts form tags in sitemesh decorator
I added a warning box with title Struts 2.1.3 to the wiki page of struts2-sitemesh-plugin. Hope this is ok... I looked there before searching the code, maybe it helps others. Is there a solution for the version problem in the wiki now? I remember there was no way to handle this some time ago. I could help out updating the docs if you say me in what way this should be done. (Dont want to make changes you have to revert afterwards ;-) Piero Am Montag, 14. Juli 2008 20:09:30 schrieb Musachy Barroso: Don is still working on those changes, you could open a ticket to make sure everything gets documented. musachy On Mon, Jul 14, 2008 at 1:22 PM, Piero Sartini [EMAIL PROTECTED] wrote: Ok, the problem was that since 2.1.3 the filters changed: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter instead of ActionContextCleanup and org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter instead of the FilterDispatcher. Now everything works like expected. I will update the wiki of the sitemesh plugin .. Am Montag, 14. Juli 2008 15:23:16 schrieb Piero Sartini: The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some time ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in newer builds. The problem seems to be that Freemarker can't get its configuration at this point. But ActionContextCleanUp is the first filter in chain, and tags like @s.url do work, only the form and input fields do not work. If I try the exact same form outside the decorator in a normal, decorated page, everything works like expected. Any ideas? java.lang.NullPointerException at org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(F ree markerManager.java:159) at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTe mpl ate(FreemarkerTemplateEngine.java:90) at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:558) at org.apache.struts2.components.Submit.end(Submit.java:109) at org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(Callba ckW riter.java:84) at freemarker.core.Environment.visit(Environment.java:299) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.include(Environment.java:1477) at freemarker.core.Include.accept(Include.java:169) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:208) at freemarker.core.Environment.process(Environment.java:188) at freemarker.template.Template.process(Template.java:237) at org.apache.struts2.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMark erP ageFilter.java:160) at org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePa geF ilter.java:116) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.j ava :62) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tio nFilterChain.java:246) ... ... ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] newly-created Session context
Where in the interceptor chain do your custom interceptor execute? 2008/7/14 Pierre Thibaudeau [EMAIL PROTECTED]: I have an interceptor that puts an object in the Session scope. The interceptor calls the following when retrieving the Session: public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) context.get(StrutsStatics.HTTP_REQUEST); HttpSession session = request.getSession(true /* create if need be */); session.setAttribute(attributeName, someObject); ... } Given that code, I don't see how the Session could be null after that interception --- otherwise an exception would be thrown at the point when I attempt to set the Session attribute. Yet, immediately after I start the server (therefore no Session has yet been created), if I issue a browser request on an action that uses that interceptor, OGNL reports the Session as being indeed null --- or so the xml-debug output of the context shows. It's only on the second request that the xml-debug shows a Session context containing the desired object. Is there a way of explaining this discrepancy? Apart from this custom interceptor, I use the paramPrepareParam stack. Would there be another interceptor in there interfering with my custom newly-created Session (but not interfering when the Session is not new anymore)? Toughts? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] NPE when using struts form tags in sitemesh decorator
I added a warning box with title Struts 2.1.3 to the wiki page of struts2-sitemesh-plugin. Hope this is ok... I looked there before searching the code, maybe it helps others. yes that is perfect, thanks. Is there a solution for the version problem in the wiki now? I remember there was no way to handle this some time ago. I could help out updating the docs if you say me in what way this should be done. (Dont want to make changes you have to revert afterwards ;-) No, there isn't any solution for the version problem ATM. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 Locale sensitive validations
Is anyone aware of how to use validation files in a way similar to message resources? I am finding too much if/else code in Struts 2 actions where for example input field lengths are a function of locale! -- View this message in context: http://www.nabble.com/S2-Locale-sensitive-validations-tp18450763p18450763.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Issue in Validation value Stack - Duplicate error messages
Hi All, I am using Strut 2.0 and tiles with Spring and I am having the following issue in the validation framework. When ever I submit a form with error in a field, subsequent submission of the same form (without valid value), generates duplicate error messages. i.e If i leave the first name field as blank and submit the page, i get a valid error message due to the validations in place. But if i submit the same page again as it is, I am getting duplicate error messages for the same field again. Also if I enter valid values in the form field after the error message is displayed, I am not able to get through the page. I am stuck at the error page itself. Please find below the code snippets: spring-config.xml --- Struts.xml - page.applicationStart addProjectPageDisplay displayProjects page.applicationStart commonAppStack is a custom made interceptor stack which doesn't have any fancy stuff. Any pointers to this issue is appreciated. Thanks Mahesh K -- View this message in context: http://www.nabble.com/Issue-in-Validation-value-Stack---Duplicate-error-messages-tp18450806p18450806.html Sent from the Struts - User mailing list archive at Nabble.com.
Re: about iterating values
Hi, you can save it into session and use it to display on jsp page. -- Milan hns wrote: hi it might be this question is not related s2 but still i want to ask i am using one public function in one class which get key,value pair from database query fire and fill in linked hashmap and return iterator to access on jsp page i have used jsp:usebean of this class to get access public function which iterate data in page scope for my select box now i have to ask when i refresh or redirect this page ,every times Map will get details from database ,so at codebehind database accesss happens so many times when i refresh or redirect it, how can i solve this issue now -- View this message in context: http://www.nabble.com/about-iterating-values-tp18444913p18450811.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] newly-created Session context
2008/7/14 Gabriel Belingueres [EMAIL PROTECTED]: Where in the interceptor chain do your custom interceptor execute? interceptor-stack name=customStack interceptor-ref name=userLanguage/ interceptor-ref name=debugging/ interceptor-ref name=autoLogin/ interceptor-ref name=paramsPrepareParamsStack / /interceptor-stack The interceptor I mentioned in my earlier post is the first one: userLanguage. BTW, to make more accurate what I stated earlier, the xml-debug tree does not actually claim that the Session is null; rather that it's empty. Here's the relevant section: debug parameters/ context ... /context request ... /request session/ valueStack ... /valueStack /debug As you can see, the session/ tag is empty...
Re: [S2] newly-created Session context
Extra update. What makes this even more puzzling is that EL can find the object while OGNL cannot. On the first request, ${userLanguage} will display the correct value, but s:property value=#session['userLanguage']/ will display nothing. On the second request, both expressions will display the same (and correct) value.
Re: Issue in Validation value Stack - Duplicate error messages
Did you put singleton=false or scope=prototype for action's beans in spring config? Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Issue in Validation value Stack - Duplicate error messages
that worked like a gem...thanks! Lukasz Lenart wrote: Did you put singleton=false or scope=prototype for action's beans in spring config? Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Issue-in-Validation-value-Stack---Duplicate-error-messages-tp18450806p18451791.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] newly-created Session context
That's strange. Which S2 version are you using? 2008/7/14 Pierre Thibaudeau [EMAIL PROTECTED]: Extra update. What makes this even more puzzling is that EL can find the object while OGNL cannot. On the first request, ${userLanguage} will display the correct value, but s:property value=#session['userLanguage']/ will display nothing. On the second request, both expressions will display the same (and correct) value. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Where to get latest binaries
Hi: Can anyone tell me where I can get the latest binaries for struts 2.1..x that contains the fixes since the struts 2.1.2 build release on 02-May-2008. I would like to test JIRA WW-2642 that I opened using 2.1.2 and have the issue closed. All I need is the sample applicaiton{hello world) with binaries that contain the fixes, say 2.1.3. I went to followoing page but did not find what I was looking for. http://people.apache.org/builds/struts/ - Original Message From: hns [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, July 14, 2008 9:46:43 AM Subject: RE: about security HI According to help of some previous threads i have created Login interceptor,i really such thankful to all helpful people who help me in this discussion please http://www.nabble.com/about-current-action-name-acsess-td15736383.html#a15755941 Check here and read out from first thread ,you can take advantage of it Yanni Tan wrote: I am new to the web development, but I like the concept of this answer. Could you explain more about how to setup/configure the interceptor? i.e. How to hook up your interceptor method with the server? Thanks! -- View this message in context: http://www.nabble.com/about-security-tp18402549p18444283..html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Referring to Properties object via OGNL?
On Monday 14 July 2008 00:30:19 Jeromy Evans wrote: Dave Belfer-Shevett wrote: In my JSP, I have: Preferred cid is s:property value=#attr.properties[preferredcid]/br This expression reads evaluate perferredcid, then get the value of #attr.properties[evalresult]. I expect you want. s:property value=#attr.properties['preferredcid']/ so it uses the literal string 'preferredcid' instead of evaluating it. Please let me know if that fixes it. OGNL doesn't provide much useful feedback for cases like these. That fixed it. Is there a chance we can update the 'collections' page in the struts docs to give information like this? Thanks again. -d - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] newly-created Session context
2008/7/14 Gabriel Belingueres [EMAIL PROTECTED]: That's strange. Which S2 version are you using? Struts 2.1.2
Re: [S2] newly-created Session context
Please test your interceptor using the following to get the session: Map session = invocation.getInvocationContext().getSession(); 2008/7/14 Pierre Thibaudeau [EMAIL PROTECTED]: 2008/7/14 Gabriel Belingueres [EMAIL PROTECTED]: That's strange. Which S2 version are you using? Struts 2.1.2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 2 Indexed Properties
Re you using struts 2 itself? If yes it would look something like this s:iterator value=listName status=stat input name=someName[s:property value='stat.index'/] /s:iterator The code you send looks like struts 1 Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: YAQ [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2008 4:05 PM To: user@struts.apache.org Subject: Struts 2 Indexed Properties Hi, I'm having problem with Struts2 and indexed properties. The list in my action is not being updated. My JSP is something like: logic:iterate id=coverTypes name=questionnaireVO.coverTypesList indexId=index input type=hidden id=questionnaireInputVO.coverTypesList[c:out value=${index} /].key name=questionnaireInputVO.coverTypesList[c:out value=${index} /].key value=c:out value=${coverTypes.key.id} / / input type=hidden id=questionnaireInputVO.coverTypesList[c:out value=${index} /].agreementType.key name=questionnaireInputVO.coverTypesList[c:out value=${index} /].agreementType.key value=c:out value=${coverTypes.agreementType.key.id} / / /logic:iterate I've discovered I need an entry in the x-work conversion properties: Element_questionnaireInputVO.coverTypesList=com.mypath.CoverTypeVO CreateIfNull_questionnaireInputVO.coverTypesList=true But I am getting the following error: [2008-07-14 12:13:07,860] [.Transports : 2] DEBUG [com.opensymphony.xwork2.util.InstantiatingNullHandler ] : Entering nullPropertyValue [EMAIL PROTECTED], property=coverTypesList] [2008-07-14 12:13:07,860] [.Transports : 2] ERROR [com.opensymphony.xwork2.util.InstantiatingNullHandler ] : Could not create and/or set value back on to object org.springframework.beans.factory.BeanCreationException: Error creating bean with name '[Lcom.mypath.CoverTypeVO;': Could not resolve matching constructor at org.springframework.beans.factory.support.ConstructorResolver.autowireCo nstructor(ConstructorResolver.java:178) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:799) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.autowire(AbstractAutowireCapableBeanFactory.java:255) at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjec tFactory.java:145) at com.opensymphony.xwork2.util.InstantiatingNullHandler.createObject(Insta ntiatingNullHandler.java:123) at com.opensymphony.xwork2.util.InstantiatingNullHandler.nullPropertyValue( InstantiatingNullHandler.java:104) at ognl.ASTProperty.getValueBody(ASTProperty.java:94) at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) at ognl.SimpleNode.getValue(SimpleNode.java:210) at ognl.ASTChain.setValueBody(ASTChain.java:168) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186) at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java :158) at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java :146) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters( ParametersInterceptor.java:193) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Pa rametersInterceptor.java:159) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Me thodFilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultAct ionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultAct ionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerS tack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo cation.java:221) at com.ing.itrf.starlite.common.interceptor.StarliteSecurityInterceptor.int ercept(StarliteSecurityInterceptor.java:54) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultAct ionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultAct ionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerS tack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo cation.java:221) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(Servle tConfigInterceptor.java:170) at
messages_(locale).properties
Hi all, Can any one tell me where do I specify that I want to use messages_en.properties or messages_de.properties? By the way I am using struts 2. And one more thing, does browser any intention that it's DE or EN? Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] newly-created Session context
2008/7/14 Gabriel Belingueres [EMAIL PROTECTED]: Please test your interceptor using the following to get the session: Map session = invocation.getInvocationContext().getSession(); Well, Gabriel: a) I'll be d*mned! b) You're a genius! ;) (I would never have thought of looking that way!) Now, it's worth making an extra comment about this strange situation. I patched my interceptor as follows: public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) context.get(StrutsStatics.HTTP_REQUEST); HttpSession session = request.getSession(true /* create if not yet in existence */); Map?,? sessionMap = invocation.getInvocationContext().getSession(); ... } In other words, I didn't merely REPLACE my previous HttpSession by the Map?,?, but I added the Map?,?. With this new setup, so long as I put one object in the sessionMap, then the other object (yes, there were two of them; I hadn't mention the second one) is set properly with HttpSession.setAttribute(String). And BOTH object are recognized by OGNL, not merely the one that I had Map.put(Object, Object)... So basically, we are facing an initialization issue somewhere. I wish there was a more elegant way of preparing that new session... But at least, now the interceptor behaves as intended. I bet this issue should be made explicit in the Strut2 / ActionInvocation /OGNL guides... Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator plugin error
Hi, I´m trying to use Struts 1.2 Validator plugin. I guess something in struts-config.xml is missing or wrong. If I add the necessary code to use the plugin validator: plug-in classname=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/ /plug-in After redeploying my webapp, I get a 404 error Servlet action not available. Validation and validation-rules are configured. Any suggestions? Thanks in advance.
Re: REST plugin URL syntax
Jeromy, Thanks *heaps* for finfing the time to do that. I'd pretty much done everything your demo does except for one little detail: constant name=struts.patternMatcher value=namedVariablePatternMatcher/ Doh! Now to see if that's broken my fancy pants image handler... BTW, if I want a controller to work in multiple namespaces do I need to declare seperate packages in struts.xml instead of just relying on the @Namespace annotation? Thanks again for all your help. 2008/7/12 Jeromy Evans [EMAIL PROTECTED]: Jeromy Evans wrote: Dusty, you're right. I just had a quick look and I do have a custom action mapper that checks whether the pattern above references an action or method for that exact reason (it checks the list of available actions and gives precedence to those). Works great for me. I released another actionmapper that solved the problem using a different approach. It will be deprecated, but it's still up for info: http://code.google.com/p/struts2urlplugin/ I had an opportunity to throw together a sample application. Apologies for the delay. Relevant source and commentary are included in the demo. http://www.blueskyminds.com.au/url-hierarchy/ From the description: This webapp demonstrates a technique to access resources with hierarchical relationships in Struts 2. The model is a Book with a list of Chapters. Each Book has a unique URI: eg. /book/1 (book #1) Each chapter also has a unique URI: eg. /book/1/chapter/2 (chapter #2 in book #1) Following Struts2 conventions, the list of books and list of chapters in a book are also available: eg. /book (list of books) eg. /book/1/chapter (list of chapters in book #1) regards, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] newly-created Session context
Seems like something is not correctly initialized in OGNL when you get the session from the HTTPServletRequest object this way (it should be documented somewhere or otherwise fix it.) But you don't need to get both the HTTPSession and the Map to put something in session scope. The SessionMap is an adapter to ease unit testing of actions, and every change is is done to the SessionMap it is delegated to the HTTPSession object. 2008/7/14 Pierre Thibaudeau [EMAIL PROTECTED]: 2008/7/14 Gabriel Belingueres [EMAIL PROTECTED]: Please test your interceptor using the following to get the session: Map session = invocation.getInvocationContext().getSession(); Well, Gabriel: a) I'll be d*mned! b) You're a genius! ;) (I would never have thought of looking that way!) Now, it's worth making an extra comment about this strange situation. I patched my interceptor as follows: public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) context.get(StrutsStatics.HTTP_REQUEST); HttpSession session = request.getSession(true /* create if not yet in existence */); Map?,? sessionMap = invocation.getInvocationContext().getSession(); ... } In other words, I didn't merely REPLACE my previous HttpSession by the Map?,?, but I added the Map?,?. With this new setup, so long as I put one object in the sessionMap, then the other object (yes, there were two of them; I hadn't mention the second one) is set properly with HttpSession.setAttribute(String). And BOTH object are recognized by OGNL, not merely the one that I had Map.put(Object, Object)... So basically, we are facing an initialization issue somewhere. I wish there was a more elegant way of preparing that new session... But at least, now the interceptor behaves as intended. I bet this issue should be made explicit in the Strut2 / ActionInvocation /OGNL guides... Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to get latest binaries
The easiest (and most reliable) is to build from source yourself... In a nutshell, do the following - svn co https://svn.apache.org/repos/asf/struts/current/ struts cd struts svn co http://svn.opensymphony.com/svn/xwork/trunk xwork cd xwork mvn -Pall clean install (wait until complete) cd ../struts2 mvn -Pall clean install (wait a bit) Then, when everything is done, you have not only all the appropriate and up-to-date libs, but you have the sources to in case you want to attach and debug. For a quick test, just delve into one of the app directories and run jetty like so - cd apps/showcase mvn jetty:run -Wes On Mon, 2008-07-14 at 13:04 -0700, Struts Two wrote: Hi: Can anyone tell me where I can get the latest binaries for struts 2.1..x that contains the fixes since the struts 2.1.2 build release on 02-May-2008. I would like to test JIRA WW-2642 that I opened using 2.1.2 and have the issue closed. All I need is the sample applicaiton{hello world) with binaries that contain the fixes, say 2.1.3. I went to followoing page but did not find what I was looking for. http://people.apache.org/builds/struts/ - Original Message From: hns [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, July 14, 2008 9:46:43 AM Subject: RE: about security HI According to help of some previous threads i have created Login interceptor,i really such thankful to all helpful people who help me in this discussion please http://www.nabble.com/about-current-action-name-acsess-td15736383.html#a15755941 Check here and read out from first thread ,you can take advantage of it Yanni Tan wrote: I am new to the web development, but I like the concept of this answer. Could you explain more about how to setup/configure the interceptor? i.e. How to hook up your interceptor method with the server? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] newly-created Session context
Thanks for the heads up! I'm learning every day! And yes, I concur: this definitely needs to be documented! 2008/7/14 Gabriel Belingueres [EMAIL PROTECTED]: Seems like something is not correctly initialized in OGNL when you get the session from the HTTPServletRequest object this way (it should be documented somewhere or otherwise fix it.) But you don't need to get both the HTTPSession and the Map to put something in session scope. The SessionMap is an adapter to ease unit testing of actions, and every change is is done to the SessionMap it is delegated to the HTTPSession object. 2008/7/14 Pierre Thibaudeau [EMAIL PROTECTED]: 2008/7/14 Gabriel Belingueres [EMAIL PROTECTED]: Please test your interceptor using the following to get the session: Map session = invocation.getInvocationContext().getSession(); Well, Gabriel: a) I'll be d*mned! b) You're a genius! ;) (I would never have thought of looking that way!) Now, it's worth making an extra comment about this strange situation. I patched my interceptor as follows: public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) context.get(StrutsStatics.HTTP_REQUEST); HttpSession session = request.getSession(true /* create if not yet in existence */); Map?,? sessionMap = invocation.getInvocationContext().getSession(); ... } In other words, I didn't merely REPLACE my previous HttpSession by the Map?,?, but I added the Map?,?. With this new setup, so long as I put one object in the sessionMap, then the other object (yes, there were two of them; I hadn't mention the second one) is set properly with HttpSession.setAttribute(String). And BOTH object are recognized by OGNL, not merely the one that I had Map.put(Object, Object)... So basically, we are facing an initialization issue somewhere. I wish there was a more elegant way of preparing that new session... But at least, now the interceptor behaves as intended. I bet this issue should be made explicit in the Strut2 / ActionInvocation /OGNL guides... Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts2 validation
Ah! Now I understand ... Looks like I will be changing a few things in this project ... Thanks for your help! -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Monday, 14 July 2008 10:22 PM To: Struts Users Mailing List Subject: RE: struts2 validation If you don't have an action property named fieldname then not only will validation not work but neither will normal property copying (from form to action). If, for example, you have a MyForm named form, and has an appropriate getter/setter, its form element would look like this: s:textfield name=form.fieldName/ If you're handling validation programmatically (via the Validateable interface and the action's validate() method) you'd then validate against the MyForm instance, for example: public void validate() { if (StringUtils.isBlank(this.form.getFieldName())) { ... } ... } It sort of seems like you're implementing a bit of ModelDriven, but manually--not a problem, but seems a bit duplicative. Dave --- On Mon, 7/14/08, Nicole Luneburg wrote: From: Nicole Luneburg [EMAIL PROTECTED] Subject: RE: struts2 validation To: Struts Users Mailing List user@struts.apache.org Date: Monday, July 14, 2008, 3:16 AM ps. My post added some 3D text that isn't supposed to be there ... Thanks Jeromy. Yes I do have a s:head attribute, maybe not *exactly* but I have: s:head theme=ajax / Apologies for the confusion. What I meant in my pevious post was that I had tried a few ways to do this validation task. In my initial post I had described one of these attempts which I think should have worked. What I am getting regardless of what sort of validation I try to implement is this error: java.lang.StringIndexOutOfBoundsException: String index out of range: -7 You mentioned the getters and setters for the fieldnames ... this only works though if the fields are stored in the action right? coz the fields I have aren't stored in the action, they are stored in a Form class. Ie my action looks something like: public String execute() { MyForm myForm = (MyForm)super.form; String myField = myForm.getFieldName(); } Markus: Thanks for your reply too, I am trying it right now. Just want this to work grrr -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Monday, 14 July 2008 4:25 PM To: Struts Users Mailing List Subject: Re: struts2 validation Nicole Luneburg wrote: s:form action=3Dmyaction method=3Dpost validate=3Dtrue The validate attribute here is used to enable client-side validation only. That will only work if you include the s:head attribute in the page. My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1 I was using the validate(...) method in the Form class. It seems none of the Struts2 validation examples on the net are working for= me. You haven't mentioned whether you're using XML validation or annotation-based validation. If by not working you mean does nothing, then your XML file is probably incorrectly named or your missing an annotation. (You need to enable this separately from client-side validation) Whatever the case, the main difference between Struts1 and Struts2 here is that Struts2 performs validation on the Object, not on the form parameters. That means, to check that fieldName is non-blank, it will call getFieldName() after setFieldName() was called by the ParametersInterceptor. A common problem is to forget the getter, but in that case Struts will keep returning INPUT (validation failed) instead of invoking your action. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to
Re: Referring to Properties object via OGNL?
Dave Belfer-Shevett wrote: That fixed it. Is there a chance we can update the 'collections' page in the struts docs to give information like this? Great! Can you please post a comment to the relevant docs page so one of the developers remembers to update it? You're also welcome to contribute to the documentation: http://struts.apache.org/helping.html#documentation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: REST plugin URL syntax
Mike Watson wrote: BTW, if I want a controller to work in multiple namespaces do I need to declare seperate packages in struts.xml instead of just relying on the @Namespace annotation? Thanks again for all your help. Unfortunately when using Codeheind, you do have to create a new package for each namespace. The easiest way to do that is to extend your action and add a @Namespace for each subclass. It's wasteful but works. The Convention Plugin that (eventually) supersedes Codeheind does include a @Namespaces() annotation. Glad I could help! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extending Struts Controls - problem
any one please reply to this... i am kind of stucked On Mon, Jul 14, 2008 at 11:49 AM, Narayana S [EMAIL PROTECTED] wrote: Hi, I have extended Simple theme (by modifying XHTML theme), implemented the column span for every control as given below. s:textfield label=Trucker name=truker size=70 s:param name=labelcolspan value=%{2} / s:param name=inputcolspan value=%{6} / /s:textfield it is working fine. Now to pass these parameters directly within the textfield tag, i have extended org.apache.struts2.views.jsp.ui.TextFieldTag and created my own tag with new attributes labelcolspan,inputcolspan. the taglib file also modified accordingly, but when i am creating a textfield with the extended class, it is not passing these two new parameter info to Free marker template files. after extending as shown below i am using the tag, ss:textfield labelcolspan=row21 inputcolspan=row31 name=myname1 label=Enter First Name / what else i am missing here? can any one suggest me Thanks in advance ~narayana.
RE: struts2 validation
In case it helps anyone else, I found a simple solution ... Annotations. I did exactly what is here: http://struts.apache.org/2.x/docs/validation-annotation.html Thanks again for everyone's help! The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: about iterating values
HI Thanks for reply but session is appropriate for large size map stored in it? it can works fine? please reply -- View this message in context: http://www.nabble.com/about-iterating-values-tp18444913p18458485.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]