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
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
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 %
%@
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
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
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.
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
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
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
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
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
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.
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:
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
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?
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
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();
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
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.
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
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
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
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
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) :
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[' +
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
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
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 }
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
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
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
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{
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
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
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
35 matches
Mail list logo