Author Login
Post Reply
user Digest 16 Apr 2008 15:34:19 -0000 Issue 7982
Topics (messages 185476 through 185499):
Re: Is it possible to make a pop up window using Struts?
185476 by: Antonio Petrelli
185477 by: ryan webb
185479 by: Antonio Petrelli
[S2] Selecting value in radio elements
185478 by: Ramanathan RV
185480 by: Lukasz Lenart
action with dynamic parameter
185481 by: Danieleippoliti\.libero\.it
185482 by: Martin Gainty
tiles problem
185483 by: Chris Pat
185484 by: Antonio Petrelli
185485 by: Chris Pat
185486 by: Antonio Petrelli
Advantage of prepare()?
185487 by: Michael Gagnon
185490 by: Jukka Välimaa
185491 by: Dave Newton
Re: Problem with Select tag
185488 by: Milan Milanovic
185489 by: Michael Gagnon
185494 by: Milan Milanovic
dinamically parameters
185492 by: Danieleippoliti\.libero\.it
185496 by: Antonio Petrelli
185497 by: Danieleippoliti\.libero\.it
185498 by: Antonio Petrelli
Re: ServletRedirectActionResult - is there a way to set parameters?
185493 by: Brad A Cupit
Re: <s:property with dynamic values
185495 by: JRD
Validation of Struts XML files
185499 by: Adam Gordon
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_185476.ezm (zipped)2008/4/16, ryan webb <webb.ryan1@(protected)>:
> Is it possible to make a window pop up using struts?
> usually this can be done in Javascript..
1) What Struts?
2) You can still do it in Javascript
Antonio

Attachment:
user_185477.ezm (zipped)Antonio,
>1) What Struts? Struts 1.2.9 (Netbeans bundle)
>2) You can still do it in Javascript. I see.. I just want to know if you do
it with struts.
I am having trouble with it..I created a pop up window using javascript and
i cant pass query string on new window.
when i clicked a <html:link> I pass a paramId and paramProperty and I cant
make it appear to new window.
I have an action class that has *request.setAttribute("username",
request.getParameter("username"));*
on the new window I have *<%= out.println(request.getAttribute("username"))
%>* but this only displays the word NULL
I am new to struts..
Ryan
On Wed, Apr 16, 2008 at 4:22 PM, Antonio Petrelli <
antonio.petrelli@(protected):
> 2008/4/16, ryan webb <webb.ryan1@(protected)>:
> > Is it possible to make a window pop up using struts?
> > usually this can be done in Javascript..
>
> 1) What Struts?
> 2) You can still do it in Javascript
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185479.ezm (zipped)2008/4/16, ryan webb <webb.ryan1@(protected)>:
>
> I am having trouble with it..I created a pop up window using javascript
> and
> i cant pass query string on new window.
> when i clicked a <html:link> I pass a paramId and paramProperty and I cant
> make it appear to new window.
>
> I have an action class that has *request.setAttribute("username",
> request.getParameter("username"));*
> on the new window I have *<%=
> out.println(request.getAttribute("username"))
> %>* but this only displays the word NULL
Mmmm.... I think that you need to start from a tutorial, won't you?
http://struts.apache.org/1.x/userGuide/index.html
With Struts 1 you don't need to read parameters, but use the corresponding
ActionForm.
Moreover you need to understand the lifecycle of a request: when a new
request is created (for example, when a popup page is shown) the request
attributes are cleared.
Antonio

Attachment:
user_185478.ezm (zipped)Hello,
<s:radio list="#{'Y':'Yes','N':'No'}" name="r2"/>
In this list, how do I preselect "No"?
--
Thanks
Ram

Attachment:
user_185480.ezm (zipped)Hi,
After some experiments, I found the solution:
<s:radio list="#{'Y':'Yes','N':'No'}" name="r2" >
<s:param name="value">N</s:param>
</s:radio>
Just look into riadiomap.ftl template and everything will be clear
(especially for Freemarker developers ;-)
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart

Attachment:
user_185481.ezm (zipped)Hi,
when a link i clicked I would pass a parameter to an Action.This parameter is an object list, but i can't to define the action with tag <param in struts .xml because i know the parameter only at run time.
How can I do it??
Thank you

Attachment:
user_185482.ezm (zipped)implement ParameterAware and then call getParameters method to obtain the
map e.g.
Map parameters = this.getParameters();
http://struts.apache.org/2.0.11.1/docs/how-can-we-access-request-parameters-
passed-into-an-action.html
Martin----- Original Message -----
From: <Danieleippoliti@(protected)>
To: "struts mailing list" <user@(protected)>
Sent: Wednesday, April 16, 2008 7:01 AM
Subject: action with dynamic parameter
Hi,
when a link i clicked I would pass a parameter to an Action.This parameter
is an object list, but i can't to define the action with tag <param in
struts .xml because i know the parameter only at run time.
How can I do it??
Thank you
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185483.ezm (zipped)Hello
I two different deployment of Tomcat with an app that work fine in 5.0.27 but fails in 5.0.28. Looking at the startup the only difference I can see this time is that the 5.0.27 loads this:
org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
and the 5.0.28 does not. Is there a way of making the startup of 5.0.28 equivalent to 5.0.27? Is it just copy over the web.xml? Ideas? tia.

Attachment:
user_185484.ezm (zipped)2008/4/16, Chris Pat <cpanon@(protected)>:
>
> I two different deployment of Tomcat with an app that work fine in 5.0.27
> but fails in 5.0.28. Looking at the startup the only difference I can see
> this time is that the 5.0.27 loads this:
>
org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
>
> and the 5.0.28 does not. Is there a way of making the startup of 5.0.28
> equivalent to 5.0.27?
I think that there are no substantial differences between 5.0.27 and
5.0.28.So may I see how you configure Tiles in your environment?
Is it just copy over the web.xml?
In general it is just a copy of the complete WAR.
Antonio

Attachment:
user_185485.ezm (zipped)Hi Antonio
Thanks, however it is very consistent. In 5.0.28 it says the action is not available and the only difference is that it is not loading that Factory. It must something subtle but deterministic. Any ideas what could be different? I have looked and they seem identical in server.xml and web.xml. Could it be an extra library? But obviously it is in the struts library and it is being loaded. tia
Antonio Petrelli <antonio.petrelli@(protected) :
>
> I two different deployment of Tomcat with an app that work fine in 5.0.27
> but fails in 5.0.28. Looking at the startup the only difference I can see
> this time is that the 5.0.27 loads this:
>
org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
>
> and the 5.0.28 does not. Is there a way of making the startup of 5.0.28
> equivalent to 5.0.27?
I think that there are no substantial differences between 5.0.27 and
5.0.28.So may I see how you configure Tiles in your environment?
Is it just copy over the web.xml?
In general it is just a copy of the complete WAR.
Antonio

Attachment:
user_185486.ezm (zipped)2008/4/16, Chris Pat <cpanon@(protected)>:
>
> In 5.0.28 it says the action is not available and the only difference is
> that it is not loading that Factory. It must something subtle but
> deterministic. Any ideas what could be different? I have looked and they
> seem identical in server.xml and web.xml. Could it be an extra
> library? But obviously it is in the struts library and it is being loaded.
Mmm... It could be the XML parser... do you receive some exception at
startup of the web application?
Antonio

Attachment:
user_185487.ezm (zipped)I've been working with struts2 for about 2 months and so far I've been using
the preparable interface to populate any data the resulting page wants to
display. I've used the execute method to do non-visible work and determine a
result (which controls flow).
I'm wondering if this is the intended pattern. If so (and even if not), why?
The only intended benefit I see to using prepare at all is if you somehow
want to use one action in two different contexts - one which uses the
preparable interceptor and one which doesn't. If this was ever the case, I'd
argue two different actions should exist. If there's some common
functionality needed it should be in a superclass and the subclasses should
call into it in the execute method. So given the only appropriate scenario I
can think of off the top of my head, its use looks like an anti-pattern to
me.
I see prepare being used in the way I'm using it in many tutorials but I
haven't found any articles explaining any particular reason why. I'm hoping
maybe somebody can shed some light on this. should I bother using prepare at
all? Why?

Attachment:
user_185490.ezm (zipped)With preparable, you can load the objects you need in prepare() method, and
do whatever specific you want in the actual called method. In CRUD actions,
it is very handy to use prepare and paramsPrepareParams to first load the
stuff you want, and after prepare all the parameters are inserted
automatically. You don't need to change or access the object states
explixitly at all in many cases -- the second params interceptor in the
stack does that for you.
On Wed, Apr 16, 2008 at 4:22 PM, Michael Gagnon <
mgagnon@(protected):
> I've been working with struts2 for about 2 months and so far I've been
> using
> the preparable interface to populate any data the resulting page wants to
> display. I've used the execute method to do non-visible work and determine
> a
> result (which controls flow).
>
>
>
> I'm wondering if this is the intended pattern. If so (and even if not),
> why?
> The only intended benefit I see to using prepare at all is if you somehow
> want to use one action in two different contexts - one which uses the
> preparable interceptor and one which doesn't. If this was ever the case,
> I'd
> argue two different actions should exist. If there's some common
> functionality needed it should be in a superclass and the subclasses
> should
> call into it in the execute method. So given the only appropriate scenario
> I
> can think of off the top of my head, its use looks like an anti-pattern to
> me.
>
>
>
>
>
> I see prepare being used in the way I'm using it in many tutorials but I
> haven't found any articles explaining any particular reason why. I'm
> hoping
> maybe somebody can shed some light on this. should I bother using prepare
> at
> all? Why?
>
>

Attachment:
user_185491.ezm (zipped)--- Michael Gagnon <mgagnon@(protected):
> I've been working with struts2 for about 2 months and so far I've been
> using the preparable interface to populate any data the resulting page
> wants to display. I've used the execute method to do non-visible work
> and determine a result (which controls flow).
>
> I'm wondering if this is the intended pattern.
AFAIK, yes. Not sure what else it would be used for.
> If so (and even if not), why?
It moves initialization code from the mainline code and provides a uniform,
deterministic way to run it across an application.
As a counter-example, consider a multi-developer project where each developer
initializes actions in a different way: some embed the code in an action's
execute() method, some call an initialization method in execute(), some use
an interceptor, ad nauseam. Preparable unifies the initialization mechanism.
> The only intended benefit I see to using prepare at all is if you somehow
> want to use one action in two different contexts - one which uses the
> preparable interceptor and one which doesn't.
Don't forget that Preparable isn't just the prepare() method, it's also
prepareXxxx() if you write actions with multiple methods. (Multiple methods
per action class is a cultural decision, and is debated from time to time.)
Consider also an action under unit test: it may not be desirable to call the
Preparable methods during testing, instead initializing the action manually
to allow testing of specific behaviors.
> I see prepare being used in the way I'm using it in many tutorials but I
> haven't found any articles explaining any particular reason why. I'm hoping
> maybe somebody can shed some light on this. should I bother using prepare
> at all? Why?
"Should" implies a level of obligation I'm not comfortable with.
I don't find the use of Preparable to be much of a productivity boost; the
"mainline" code savings are minimal, and it depends on framework knowledge to
understand why and how code using it works. I am ambivalent about its use,
but comfortable with either viewpoint.
Dave

Attachment:
user_185488.ezm (zipped)Nobody has an answer to this simple question ?
As I asked, there is with select's tag "list" attribute, when namespace is added to the package and to the form tag. It doesn't recognize given array from the action class anymore. Do I miss something or this is a serious error in Struts 2 ?
--
Thanks, Milan Milanovic
----- Original Message ----
From: Milan Milanovic <milanmilanovich@(protected)>
To: user@(protected)
Sent: Tuesday, April 15, 2008 11:21:37 PM
Subject: Problem with Select tag
Hi,
I'm using Struts 2.0.11.1, and I have wierd problem with select UI tag. It works perfectly, but
when I added namespace to the package in struts.xml, which is used in form where this select tag
is located, I get an error:
"tag 'select', field 'list', id 'roles', name 'user.roles': The requested list key 'allRoles' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unkown location]"
I should note that I've added this namespace to the form tag too, where select tag is located.
How can I solve this problem ? It seems when namespace is added to package, select's list attribute doesn't recognize correct value stack anymore.
___________________________
Thanks in advance, Milan Milanovic
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Attachment:
user_185489.ezm (zipped)Can you show your struts xml, calling java action, and resulting jsp code?
I've noticed error messages like that whenever ANYTHING was wrong on a page
with a select box -- completely independent of anything to do with the
select box. So I think whatever you changed MAY have broken something else
and the message may be misleading you.
-----Original Message-----
From: Milan Milanovic [mailto:milanmilanovich@(protected)]
Sent: Wednesday, April 16, 2008 9:28 AM
To: Struts Users Mailing List
Subject: Re: Problem with Select tag
Nobody has an answer to this simple question ?
As I asked, there is with select's tag "list" attribute, when namespace is
added to the package and to the form tag. It doesn't recognize given array
from the action class anymore. Do I miss something or this is a serious
error in Struts 2 ?
--
Thanks, Milan Milanovic
----- Original Message ----
From: Milan Milanovic <milanmilanovich@(protected)>
To: user@(protected)
Sent: Tuesday, April 15, 2008 11:21:37 PM
Subject: Problem with Select tag
Hi,
I'm using Struts 2.0.11.1, and I have wierd problem with select UI tag. It
works perfectly, but
when I added namespace to the package in struts.xml, which is used in form
where this select tag
is located, I get an error:
"tag 'select', field 'list', id 'roles', name 'user.roles': The requested
list key 'allRoles' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unkown location]"
I should note that I've added this namespace to the form tag too, where
select tag is located.
How can I solve this problem ? It seems when namespace is added to package,
select's list attribute doesn't recognize correct value stack anymore.
___________________________
Thanks in advance, Milan Milanovic
____________________________________________________________________________
________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
____________________________________________________________________________
________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Attachment:
user_185494.ezm (zipped)Yes, I understand. But if you read my post, EVERYTHING works fine, but when I add namespace to package
in struts.xml (and in <s:form...) automatically "list" attribute of <s:select... doesn't recognize array anymore. I've tried
this many times and every time it works in the same way.
Here is excerpt of my code:
struts.xml:
--
<struts>
<constant name="struts.objectFactory" value="spring" />
<constant name="struts.devMode" value="true" />
<package name="administration" namespace="/administration" extends="struts-default">
<action name="save" class="userAction" method="save">
<result>/pages/administration/list.jsp</result>
<result name="input">/pages/administration/list.jsp</result>
</action>
</package>
<package name="register" namespace="/registers" extends="struts-default">
...
</struts>
UserAction.java:
--
public class UserAction extends ActionSupport implements Preparable {
/**
*
*/
private static final long serialVersionUID = 7654885094460681178L;
private UserService service;
private List<User> users;
private User user;
private String username;
private String [] allRoles;
public UserAction(UserService service) {
this.service = service;
}
public String execute() {
users = service.findAllUsers();
allRoles = service.getAllRoles(); <- this method works fine, it return an array of roles
user = new User();
return Action.SUCCESS;
}
public String save() {
service.save(user);
return execute();
}
public void prepare() throws Exception {
if (username != null)
if (!username.equals(""))
user = servis.findUserByUsername(username);
}
public void setAllRoles(String [] allRoles) {
this.allRoles = allRoles;
}
public String [] getAllRoles() {
return allRoles;
}
// Other getters/setters
}
users.jsp:
--
<body>
...
<s:form action="save" namespace="/administration" validate="true" method="post">
<s:textfield id="username" label="Username" name="user.username"/>
<s:textfield id="password" label="Password" name="user.password"/>
<s:select
id = "roleChoose"
label="Role"
list="allRoles" <- THIS DOESN'T WORK WHEN I ADD NAMESPACE HERE IN FORM AND IN STRUTS.XML FOR CORRESPODING PACKAGE
name="user.roles"
emptyOption="false"
value="user.roles"
headerKey="None"
multiple="true"/>
<s:submit theme="ajax" value="Save" targets="users" notifyTopics="/save"/>
</s:form>
...
</body>
--
Thx in advance, Milan Milanovic
----- Original Message ----
From: Michael Gagnon <mgagnon@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Wednesday, April 16, 2008 3:38:38 PM
Subject: RE: Problem with Select tag
Can you show your struts xml, calling java action, and resulting jsp code?
I've noticed error messages like that whenever ANYTHING was wrong on a page
with a select box -- completely independent of anything to do with the
select box. So I think whatever you changed MAY have broken something else
and the message may be misleading you.
-----Original Message-----
From: Milan Milanovic [mailto:milanmilanovich@(protected)]
Sent: Wednesday, April 16, 2008 9:28 AM
To: Struts Users Mailing List
Subject: Re: Problem with Select tag
Nobody has an answer to this simple question ?
As I asked, there is with select's tag "list" attribute, when namespace is
added to the package and to the form tag. It doesn't recognize given array
from the action class anymore. Do I miss something or this is a serious
error in Struts 2 ?
--
Thanks, Milan Milanovic
----- Original Message ----
From: Milan Milanovic <milanmilanovich@(protected)>
To: user@(protected)
Sent: Tuesday, April 15, 2008 11:21:37 PM
Subject: Problem with Select tag
Hi,
I'm using Struts 2.0.11.1, and I have wierd problem with select UI tag. It
works perfectly, but
when I added namespace to the package in struts.xml, which is used in form
where this select tag
is located, I get an error:
"tag 'select', field 'list', id 'roles', name 'user.roles': The requested
list key 'allRoles' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unkown location]"
I should note that I've added this namespace to the form tag too, where
select tag is located.
How can I solve this problem ? It seems when namespace is added to package,
select's list attribute doesn't recognize correct value stack anymore.
___________________________
Thanks in advance, Milan Milanovic
____________________________________________________________________________
________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
____________________________________________________________________________
________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Attachment:
user_185492.ezm (zipped)I have an Object List of objects News and when a user click on a link of the interfece i have to pass this parameter to the correspondent action.
But this parameter is setted only at run time, so i have to pass it dinamically.
Can I pass an Object list to an other action???
How I can do It???
I'm not very expert in struts 2.0.11

Attachment:
user_185496.ezm (zipped)2008/4/16, Danieleippoliti@(protected)>:
> I have an Object List of objects News and when a user click on a link of the interfece i have to pass this parameter to the correspondent action.
> But this parameter is setted only at run time, so i have to pass it dinamically.
>
> Can I pass an Object list to an other action???
> How I can do It???
How is this list rendered?
Antonio

Attachment:
user_185497.ezm (zipped)Sto facendo un motore di ricerca di news.
Inizialmente ho una pagina html che mostra le news piu aggiornate e fino qui nessun problema.
Il fatto è che per ogni news mostrata ho un link del tipo "altre n news simili" dove si accede alle notizie simili per quella particolare news.
Visto che io ho già calcolato allo scatenarsi della action di "accesso" tali cluster per ogni news vorrei che una volta che venga cliccato il link si scateni un azione a cui passo il giusto oggetto di tipo lista.
Naturalmente non posso definire azioni con parametri in struts.xml perchè i parametri li conosco solo a run time quindi vorrei un passaggio di paramtri dinamico.
Io ho provato a definire il link come segue:
<s:url id="url" action="showSimilarNews">
<s:param name="similarNews"><s:property value="similarNews"/></s:param>
</s:url>
<s:a href="%{url}">Altre: <s:property value="centralNews.numSimilarNews"/> News simili</s:a>
dove similarNews risulta essere una lista di news sia per il bean sottostante alla news di accesso sia per la classe relativa alla action che dovrà mostrare le news simili.
Grazie mille
Daniele
---------- Initial Header -----------
From : "Antonio Petrelli" antonio.petrelli@(protected)
To : "Struts Users Mailing List" user@(protected)
Cc :
Date : Wed, 16 Apr 2008 16:43:40 +0200
Subject : Re: dinamically parameters
> 2008/4/16, Danieleippoliti@(protected)>:
> > I have an Object List of objects News and when a user click on a link of the interfece i have to pass this parameter to the correspondent action.
> > But this parameter is setted only at run time, so i have to pass it dinamically.
> >
> > Can I pass an Object list to an other action???
> > How I can do It???
>
> How is this list rendered?
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185498.ezm (zipped)Please write in English. This is an English speaking mailing list.
Antonio
2008/4/16, Danieleippoliti@(protected)>:
>
> Sto facendo un motore di ricerca di news.
> Inizialmente ho una pagina html che mostra le news piu aggiornate e fino
> qui nessun problema.
> Il fatto è che per ogni news mostrata ho un link del tipo "altre n news
> simili" dove si accede alle notizie simili per quella particolare news.
>
> Visto che io ho già calcolato allo scatenarsi della action di "accesso"
> tali cluster per ogni news vorrei che una volta che venga cliccato il link
> si scateni un azione a cui passo il giusto oggetto di tipo lista.
> Naturalmente non posso definire azioni con parametri in struts.xml perchè
> i parametri li conosco solo a run time quindi vorrei un passaggio di
> paramtri dinamico.
>
> Io ho provato a definire il link come segue:
>
> <s:url id="url" action="showSimilarNews">
> <s:param name="similarNews"><s:property value="similarNews"/></s:param>
> </s:url>
> <s:a href="%{url}">Altre: <s:property value="centralNews.numSimilarNews"/>
> News simili</s:a>
>
> dove similarNews risulta essere una lista di news sia per il bean
> sottostante alla news di accesso sia per la classe relativa alla action che
> dovrà mostrare le news simili.
>
> Grazie mille
>
>
> Daniele
>
>
>
> ---------- Initial Header -----------
>
> From : "Antonio Petrelli" antonio.petrelli@(protected)
>
> To : "Struts Users Mailing List" user@(protected)
> Cc :
> Date : Wed, 16 Apr 2008 16:43:40 +0200
> Subject : Re: dinamically parameters
>
>
>
>
>
>
>
>
> > 2008/4/16, Danieleippoliti@(protected)>:
> > > I have an Object List of objects News and when a user click on a link
> of the interfece i have to pass this parameter to the correspondent action.
> > > But this parameter is setted only at run time, so i have to pass it
> dinamically.
> > >
> > > Can I pass an Object list to an other action???
> > > How I can do It???
> >
> > How is this list rendered?
> >
> > Antonio
> >
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185493.ezm (zipped)> I need to tag along a request paramter. So my annotation looks
> like this:
>
> @Result(name="enterNewContactInfo",value="enterNewContactInfo",
> type=ServletActionRedirectResult.class,params={"country","AUT"})
>
> I get a nasty NPE if I add the params. If I remove it everything
works fine.
It's a known issue which has been fixed in Struts 2.1:
https://issues.apache.org/struts/browse/WW-2170
As you mentioned, putting the results in struts.xml will fix it, or as a
workaround you can use
@Result(type=ServletRedirectResult.class,
value="/actionName.action?param1=value1")
> Another question is how do I set the parameter dynamically ? If I
> recall correctly WW had a special syntax for it. Something like
> params={"country","%{country}"}, but with no annotations for
> course.Any way to do this in S2?
This can be done in xml or with annotations. For ServletRedirectResult,
using the above example:
@Result(type=ServletRedirectResult.class,
value="/actionName.action?param1=${value1}")
will evaluate 'value1' as an OGNL expression
and for ServletActionRedirectResult (once Struts 2.1 gets released or
WW-2170 is backported to 2.0.x), I believe the following would work.
@Result(type= ServletActionRedirectResult.class, value="actionName",
params={"param1","${value1}"})
The big advantage of ServletActionRedirectResult over
ServletRedirectResult is that it automatically URL-encodes the
parameters.
> I am having way too many problems with this zero config/codebehind.
> Technically the codebehind plugin is listed as 'experimental' on the
wiki.
> The convention plugin (only for Struts 2.1) look incredible.
Having said all of that, I've been able to get the zero
config/codebehind working and (in Spring 2.5) component scanned Spring
beans so that newly written Actions and DAOs require few annotations and
no xml configuration. What other kind of problems have you had?
Brad Cupit
Louisiana State University - UIS

Attachment:
user_185495.ezm (zipped)
I can't use ${x} because I am not always looking for x.
The basics of what I am doing is building a tile that will print out any
property in my action/form.
So I have some JSP #1 that says
<tiles:insertDef name="textOutput">
<tiles:putAttribute name="property" value="x"/>
</tiles:insertDef>
<tiles:insertDef name="textOutput">
<tiles:putAttribute name="property" value="y"/>
</tiles:insertDef>
...
And for each definition it inserts JSP #2 that looks like...
<tiles:useAttribute name="property">
<s:property ??? />
I just can't figure out how to write that property tag. I need it to show
the value of the property passed in. As I said if I could use runtime
expressions I could just write <s:property value="${property}"/>
So I can't use the:
Or use <s:set name="currentProperty" value="x"/> with either the "bare" JSP
2.0+ notation or via <s:property value="#currentProperty"/>.
It would work if I knew to write in 'x' for the currentProperty, but since I
have to evaluate property to get x it doesn't work.
Any other thoughts? Thanks,
Jonathan
newton.dave wrote:
>
> --- JRD <danger_jon@(protected):
>> I have a .JSP where I want to write out the values of them dynamically.
>>
>>
>> <c:set var="currentProperty" value="x"/>
>>
>> How do I write a <s:property value=""/> using currentProperty that would
>> result it showing my actions value (1).
>>
>> If I were using runtime expressions I would write it like
>> <s:property value="${currentProperty}"/>
>> but that is verboten by the tld.
>
> Why wouldn't you just use ${x} (in a JSP 2.0+ container) or <s:property
> value="x"/>?
>
> If you're dead-set on using the "currentProperty" thing use
> ${currentProperty} or <s:property value="currentProperty"/>.
>
> Or use <s:set name="currentProperty" value="x"/> with either the "bare"
> JSP
> 2.0+ notation or via <s:property value="#currentProperty"/>.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185499.ezm (zipped)Last night, our company had a maintenance window whereby Internet access
was shut off from our office to the outside world. During that time I
was doing development and attempted to start up our web app in a
development environment.
I've not seen this error in almost 2 years but it's apparently back:
[
org.apache.struts.action.ActionServlet] [handleConfigException] Parsing
error processing resource path /WEB-INF/struts-optout.xml
java.net.UnknownHostException: jakarta.apache.org
at
java.net.PlainSocketImpl.connect (
PlainSocketImpl.java:177)
at
java.net.Socket.connect (
Socket.java:520)
at
java.net.Socket.connect (
Socket.java:470)
at
sun.net.NetworkClient.doConnect (
NetworkClient.java:157)
...*snip*...
I remember this well. The problem is that struts-optout.xml has the
DOCTYPE of:
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd">
But, the struts-config_1_3.dtd is not in the struts.jar file (we're
using Struts 1.2.9) so, apparently in order to validate that the XML
file is well-formed at webapp start up time, Tomcat feels the need to go
out and retrieve this DTD - only it can't because Internet access was
down. The problem is greatly exacerbated by the fact that Tomcat stops
processing the loading of struts modules when this one fails essentially
rendering the web app useless.
I seem to recall playing with turning validation of XML files off, but
that not being a sufficient solution so I tried adding the DTD into the
struts JAR file in the same location as the other DTDs:
org/apache/struts/resources/struts-config_1_x.dtd (where x=0,1,2) but
that didn't work.
We need to be able to find a solution to where we can host the DTDs
locally and do not have to rely on a 3rd party server being up in order
to deploy our web application. I seem to recall this being an issue
with the W3C (especally w.r.t. [X]HTML validation in that it results in
a ton of unnecessary network calls to retrieve DTDs for validation
rather than web servers hosting the DTDs locally.
I'm sure I'm not the only one to have seen this so any help to resolve
this would be greatly appreciated. Thanks.
-- adam