Re: Unit Testing Actions with Annotation based validation in Struts 2.1.6

2009-10-13 Thread bloodredsun
I've figured how to do it! You need to use the container properly to populate all the fields with @Inject annotated setters. It's another reason why I don't like auto-wiring. I know it's powerful and when you're familiar with the codebase it's simple but it makes stepping through the code a

Re: action class is a part of controller or model; and what about formBean

2009-10-13 Thread Gregor Marinšek
Well i would say, tha action implementation (action class) is the controller, formBean is in one way the interface between view and controller and model is implementation of some third part (f.e. hibernate)... Thats my view of the 'story'. If i'm wrong, please correct me. Gregor Arindam

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Alex Siman
I have such custom JSP tag file: /WEB-INF/tags/formField.tag -- %@ taglib prefix=s uri=/struts-tags % %@ tag language=java pageEncoding=UTF-8 % %@ attribute name=fieldName % %@ attribute name=inputId % %@ attribute name=label % %@

Conversion problem for bi-dimensional Lists and Arrays

2009-10-13 Thread Damian
Hi all, I want to send a bidimensional List and/or a bidimensional array from my application's view to the action. For example, I have a generixMatrix object in the action (with getters and setters of course). The genericMatrix should be able to hold any kind of object. I want to set a

how to add multiple addon rows in struts..urgert please

2009-10-13 Thread swathi reddy
Hi all please let me know how we can add multiple rows like he want to add multiple Mobile numbers in the jsp page when he want to submit in struts. page has a filed mobile no. to enetre then beside add another Mobile no. and edit the No. please replay quickly... -- Thanks Regards Swathi

Re: how to add multiple addon rows in struts..urgert please

2009-10-13 Thread swathi reddy
wrong word correct field not filed On Tue, Oct 13, 2009 at 6:20 PM, swathi reddy swathi23.re...@gmail.comwrote: Hi all please let me know how we can add multiple rows like he want to add multiple Mobile numbers in the jsp page when he want to submit in struts. page has a filed mobile no.

Re: how to add multiple addon rows in struts..urgert please

2009-10-13 Thread Mileidys González Prieto
You need to declare ur variable like an array of string, numbers... ArrayListString mobiles and then in ur jsp code u just need to create differents input all of them with the same name mobiles dont forget the get and set for the property... De: swathi

Re: how to add multiple addon rows in struts..urgert please

2009-10-13 Thread swathi reddy
Actuall i am strucked at design while we we want to add one more number ,he will click at add one more number then previous one need to be shouln as label and the new empty mobile no. text field should display. 2009/10/13 Mileidys González Prieto mileid...@yahoo.com You need to declare ur

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Alex Siman
OK, I figured out how to get value of tag attribute in JSP: %= jspContext.getAttribute(fieldName, PageContext.PAGE_SCOPE) % Now I need to put this value into some OGNL variable, say '#ognlFieldName', to get access to this value from Struts2 tags. So, how to get access to jspContext

RE: How to get value of tag attribute from OGNL?

2009-10-13 Thread Mike Baranski
Why not use this? http://struts.apache.org/2.1.6/docs/set.html -Original Message- From: Alex Siman [mailto:aleksandr.si...@gmail.com] Sent: Tuesday, October 13, 2009 9:25 AM To: user@struts.apache.org Subject: Re: How to get value of tag attribute from OGNL? OK, I figured out how to get

RE: How to get value of tag attribute from OGNL?

2009-10-13 Thread Alex Siman
Did you mean this variant?: s:set var=ognlFieldName value='%{\%= jspContext.getAttribute(fieldName, PageContext.PAGE_SCOPE) %\}'/ This code does NOT work. So the question still open. Mike Baranski-2 wrote: Why not use this? http://struts.apache.org/2.1.6/docs/set.html -Original

Why is PageContext null?

2009-10-13 Thread Alex Siman
I do try to get PageContext inside action in a such way: ServletActionContext.getPageContext(); and it is null. Why? -- View this message in context: http://www.nabble.com/Why-is-PageContext-null--tp25873385p25873385.html Sent from the Struts - User mailing list archive at Nabble.com.

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Dale Newfield
The answer is easier if this .tag file contains no recursive calls. The issue is that the .tag file receives attributes through jstl-el, not ognl. You can use the jstl-el c:set tag to promote that value into a namespace that's also accessible from ognl. Alex Siman wrote:

localization properties files working in WEB-INF/classes and not in WEB-INF/lib/NAME.jar

2009-10-13 Thread Ignacio de Córdoba
Hi there, I am facing a strange problem. My properties files work fine when I put them unjarred in /WEB-INF/classes/com/mypackage/package_en.properties /WEB-INF/classes/com/mypackage/package_en.properties but struts2 actions and tags (s:text) won't find them if I include them in the same jar

Re: Portlet form action parameters doubles the namespace of actions

2009-10-13 Thread Leonard Broman
I reconfigured the project not to use the convention plugin and using the good old xml-configuration. But the problem persists. I'll try to dig into what might be causing this. Is anyone looking actively at the portlet plugin? Can anyone give me advice on development tools for debugging portlets?

Re: Why is PageContext null?

2009-10-13 Thread Musachy Barroso
that should be available inside tags only, not actions..I think. On Tue, Oct 13, 2009 at 6:57 AM, Alex Siman aleksandr.si...@gmail.com wrote: I do try to get PageContext inside action in a such way:        ServletActionContext.getPageContext(); and it is null. Why? -- View this message in

Re: Why is PageContext null?

2009-10-13 Thread Alex Siman
OK, let it be so. Musachy Barroso wrote: that should be available inside tags only, not actions..I think. On Tue, Oct 13, 2009 at 6:57 AM, Alex Siman aleksandr.si...@gmail.com wrote: I do try to get PageContext inside action in a such way:        ServletActionContext.getPageContext();

Passing List with Redirect

2009-10-13 Thread Timothy Orme
Hi All I'm wondering if theres a way to pass a list of values as a parameter in a redirectAction. For instance: action name=WorkAction class=test.WorkAction result name=success type=redirectAction param name=actionNameViewAction/param param

Re: Changing the border color of a text field

2009-10-13 Thread Burton Rhodes
You could use 'addFieldError' in your action class for the zipcode field that contains the error. Then use the 'cssErrorClass' attribute in the s:textfield tag to change the display of the 'error' textfield. Each of your textfields will have to have a unique name in order to add the field error.

Re: Changing the border color of a text field

2009-10-13 Thread james billa
Alex, It is a great idea. But still I haven't got it working. value=%{fieldErrors['zipCode[ ' + #rowstatus.index + ']']}/ - always evaluates to null. Can you think of any reason why it could be so? On Mon, Oct 12, 2009 at 3:50 PM, Alex Siman aleksandr.si...@gmail.comwrote: Try to add

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Dale Newfield
Alex Siman wrote: Thanx you Dave for your advice! Sure, Alix. I switched off the JSTL-EL (as it was recomended in Struts2 wiki) Can you please point me to that? Seems quite strange to me... so I wrote another working code: snippets of java inside your .jsp seems like a step back about

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Musachy Barroso
on top of that, you can use the the struts set tag to set stuff in any of the contexts. Scriptlets are evil. musachy On Tue, Oct 13, 2009 at 9:41 AM, Dale Newfield d...@newfield.org wrote: Alex Siman wrote: Thanx you Dave for your advice! Sure, Alix. I switched off the JSTL-EL (as it was

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Alex Siman
I switched off the JSTL-EL (as it was recomended in Struts2 wiki) Can you please point me to that? Seems quite strange to me... Read the section JSP 2.1 here: http://struts.apache.org/2.1.8/docs/ognl.html The answer is easier if this .tag file contains no recursive calls. I think this

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Alex Siman
Why are scriptlets an evil? Is it relates to an architectural aspect that View (JSP) must contain no business logic? Or something else? BTW sometimes OGNL also contains little complex code. What about this one: s:set var=label value=%{#attr.labelKey != null ? getText(#attr.labelKey) :

Re: Changing the border color of a text field

2009-10-13 Thread Alex Siman
I am confused about what getter are you using for String[] zipCode = new zipCode[10]; Is it 'getZipCode' or 'getZipCodeList'? If 'getZipCodeList' then try this one: s:iterator value=zipCodeList var=Zcode status=rowstatus ... s:set var=zipCodeErrors value=%{fieldErrors['zipCodeList[' +

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Musachy Barroso
trust me, that is nothing compared to what I have seen in scriptlets. That expression could be broken down into an if block, even the original is not that hard to read. Assuming you don't put any business logic in scriplets, which is evil by definition (an axiom I guess), pages containing

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Dale Newfield
Alex Siman wrote: I switched off the JSTL-EL (as it was recomended in Struts2 wiki) Can you please point me to that? Seems quite strange to me... Read the section JSP 2.1 here: http://struts.apache.org/2.1.8/docs/ognl.html That was added by Ted Husted on 3/23/2007. What are the problems

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Musachy Barroso
that's only a problem for defining maps in ognl, which used the #{a:b} syntax, which made the jstl el complain. The solution is just to use the alternative map syntax: #...@java.util.linkedhashmap@{ foo : foo value, bar : bar value }

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Dale Newfield
Alex Siman wrote: I switched off the JSTL-EL (as it was recomended in Struts2 wiki) Can you please point me to that? Seems quite strange to me... Since we've removed the possibility of including JSTL-EL expressions in struts tag attributes, this advice is no longer appropriate. If that's

Re: How to get value of tag attribute from OGNL?

2009-10-13 Thread Alex Siman
Cool, welcome back, JSTL-EL! DNewfield wrote: Alex Siman wrote: I switched off the JSTL-EL (as it was recomended in Struts2 wiki) Can you please point me to that? Seems quite strange to me... Since we've removed the possibility of including JSTL-EL expressions in struts tag

Unit Testing in Struts 2.1.6

2009-10-13 Thread Dan R. Olsen III
I have gone to the page found at http://struts.apache.org/2.1.6/docs/how-can-we-test-actions.html. However, the code on that page is not possible with Struts 2.1.6 although it is found in the docs for Struts 2.1.6. How can we get this page updated to show how to test actions in Struts 2.1.6 so

iterator and radio struts2

2009-10-13 Thread Odelya YomTov
Hi! I have the following class: public class Question implements Serializable { private Integer id; private String content; private String type; private ListAnswer answers = new ArrayListAnswer(); . } And class answer: public class Answer implements Serializable{

RE: iterator and radio struts2

2009-10-13 Thread Lee Clemens
It looks like you may be able to nest s:iterator tags to achieve this. s:iterator value=%{questionsArrayFromActionClass} s:property value=%{theQuestion}/ s:iterator value=%{answersFromQuestionClass} s:radio... /s:iterator /s:iterator --Lee -Original

Re: iterator and radio struts2

2009-10-13 Thread Odelya YomTov
hi! the problem was that i didn't have a get method for id and content. Now my question is: when i run the page, the source code writes the radio buttons like this: input type=radio name=answer[#pos.index] id=getFirstVideo_answer_#pos_index_5 value=5/ what i need it to save the answer for each

Re: Portlet form action parameters doubles the namespace of actions

2009-10-13 Thread Nils-Helge Garli Hegvik
I noticed your bug report in JIRA and will be looking into it. As for debugging, check out the setup in the sample portlet application. I use it to run portlets embedded in pluto directly in Eclipse. Makes debugging real easy. Nils-H On Fri, Oct 9, 2009 at 10:35 AM, Leonard Broman