Actionerror's wont be shown when ajax call or when we do type="redirectAction" using struts2.1.6

2009-03-12 Thread sajidbigler

Hi Friends,

How can we show ActionErrors,ActionMessages,FieldErrors in Ajax call using
struts2.1.6.i tried to do the following

http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/

you can see my comments on this too

 tried

Unable to preserve erroe messages :( please help



-- 
View this message in context: 
http://www.nabble.com/Actionerror%27s-wont-be-shown-when-ajax-call-or-when-we-do-type%3D%22redirectAction%22-using-struts2.1.6-tp22490692p22490692.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



S:Iterator break out of it according to a condition

2009-03-12 Thread Ransika de Silva
Hello all,
I have a list to iterate and according to a certain logic I want the
iteration to stop and break out of the iteration. Similar to the break in
java inside a loop. Any idea how I can achieve this?

Regards,

Ransika


org.apache.jasper.JasperException: tag 'select', field 'list', name 'fieldTypeID'

2009-03-12 Thread Muthu Velappan

Hi,

I have a JSP page containing data like this...

















   

this page works fine in first load.. However, I end up getting problem when
there is any validation error occured fieldname or displayname fields. The
select box values are not loaded properly in this case, It shows a big stack
trace like the one shown below. I found that map is not loaded back in this
Validator error loop but I don't know how to fix this.. Can any one throw
some light on how to clear this out...

SEVERE: Servlet.service() for servlet jsp threw exception
tag 'select', field 'list', name 'fieldTypeID': The requested list key
'fieldTypeMap' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]
at 
org.apache.struts2.components.Component.fieldError(Component.java:230)
at org.apache.struts2.components.Component.findValue(Component.java:292)
at
org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:80)
at
org.apache.struts2.components.Select.evaluateExtraParams(Select.java:105)
at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:858)
at org.apache.struts2.components.UIBean.end(UIBean.java:509)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)


2009-03-13 10:16:04,002 ERROR (CommonsLogger.java:error:28) - 
java.security.PrivilegedActionException: org.apache.jasper.JasperException:
tag 'select', field 'list', name 'fieldTypeID': The requested list key
'fieldTypeMap' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at
com.aspire.propel.web.membership.SecurityInterceptor.intercept(SecurityInterceptor.java:49)
at
com.google.inject.struts2.GuiceObjectFactory$LazyLoadedInterceptor.intercept(GuiceObjectFactory.java:171)
at
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
at
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
at
com.aspire.propel.transaction.TransactionActionInterceptor$1.executeTransaction(TransactionActionInterceptor.java:58)
at
com.aspire.propel.transaction.TransactionManager.executeTransaction(TransactionManager.java:82)
at
com.aspire.propel.transaction.TransactionActionInterceptor.intercept(TransactionActionInterceptor.java:54)
at
com.google.inject.struts2.GuiceObjectFactory$LazyLoadedInterceptor.intercept(GuiceObjectFactory.java:171)


at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.jasper.JasperException: tag 'select', field 'list',
name 'fieldTypeID': The requested list key 'fieldTypeMap' could not be
resolved as a collection/array/map/enumeration/iterator type. Example:
people or people.{name} - [unknown location]
at
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:541)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...
...
... 61 more


Advance Thanks for any help..

~Muthu
-- 
View this message in context: 
http://www.nabble.com/org.apache.jasper.JasperException%3A-tag-%27select%27%2C-field-%27list%27%2C-name-%27fieldTypeID%27-tp22490368p22490368.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: S2: Using Outbound Rules with UrlRewriter

2009-03-12 Thread Wes Wannemacher
On Thursday 12 March 2009 23:34:22 Daniel Ruan wrote:
> Has anyone used the UrlRewriter outbound rules with Struts 2?
> UrlRewriter requires that the urls go through response.encodeURL().
> In JSP and JSTL examples:
>
>  %>">nyc
>
>  />">nyc
>
> What is the Struts2 equivalent way?  (s:url encode="true" does not work).
>
> Thanks,
>

I'm not sure if I'm answering your question, but the struts2 way would differ 
slightly from your example in two ways - 

1. world.jsp should be converted to an action rather than a JSP. You could 
simple map world.jsp to ActionSupport if you didn't want to code a whole 
action, but since your taking parameters, I would suggest writing an action 
for it.

2. Rather than using a scriptlet, you'd use the struts2 tags to generate the 
link. This could be done in a few ways - 

2a. generate the url with the s:url tag and assign it to a variable on the 
value stack to use with the s:a tag - 

nyc

2b. use the s:url tag right in the href= of your HTML a tag -
http://www.manning.com/wannemacher


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



S2: Using Outbound Rules with UrlRewriter

2009-03-12 Thread Daniel Ruan
Has anyone used the UrlRewriter outbound rules with Struts 2?
UrlRewriter requires that the urls go through response.encodeURL().
In JSP and JSTL examples:

">nyc

">nyc

What is the Struts2 equivalent way?  (s:url encode="true" does not work).

Thanks,

Daniel

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: this is driving me nucking futs!

2009-03-12 Thread Martin Gainty

dave answered about namespace

curious about 'routes pattern'

thanks,
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Thu, 12 Mar 2009 20:23:57 -0700
> From: dustin_pea...@yahoo.com
> To: user@struts.apache.org
> Subject: RE: this is driving me nucking futs!
> 
> 
> Sorry Martin, did Dave answer your question?  Were you just wondering about
> the namespace parameter on the url tag or about the routes pattern in
> general?
> 
> 
> mgainty wrote:
> > 
> > 
> > can you explain this routes a bit more..what is this another attribute or
> > a template?
> > i can see see action, params but namespace?
> > 
> > if you look at the code the base class changes from 
> > public class AnchorTag extends AbstractClosingTag 
> > TO
> > public class AnchorTag extends ContextBean
> > basing AnchorTag on a bean allows you to tack on infinitely more
> > attributes
> > ...
> > Martin 
> > __ 
> > Disclaimer and confidentiality note 
> > Everything in this e-mail and any attachments relates to the official
> > business of Sender. This transmission is of a confidential nature and
> > Sender does not endorse distribution to any party other than intended
> > recipient. Sender does not necessarily endorse content contained within
> > this transmission. 
> > 
> > 
> > 
> > 
> >> Date: Thu, 12 Mar 2009 09:24:54 -0700
> >> From: dustin_pea...@yahoo.com
> >> To: user@struts.apache.org
> >> Subject: Re: this is driving me nucking futs!
> >> 
> >> 
> >> Adding the action, namespace and params url constructing pieces to s:a
> >> would
> >> be cool, as long as we don't nerf the s:url function.  I rather like the
> >> pattern of using a central "routes" page as an include where urls are
> >> created and their ids referenced in links via JSTL in the main pages.
> >> 
> >> -D
> >> 
> >> newton.dave wrote:
> >> > 
> >> > mitch gorman wrote:
> >> >> I AM AN INSTRUMENT OF CHANGE!!!
> >> > 
> >> > Hmm, when people say that about me they say I'm a tool.
> >> > 
> >> > I'm not *entirely* sure they're being complimentary ;)
> >> > 
> >> > Dave
> >> > 
> >> > 
> >> > -
> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> > For additional commands, e-mail: user-h...@struts.apache.org
> >> > 
> >> > 
> >> > 
> >> 
> >> -- 
> >> View this message in context:
> >> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >> 
> >> 
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >> 
> > 
> > _
> > Windows Live™ Groups: Create an online spot for your favorite groups to
> > meet.
> > http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22489517.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ Contacts: Organize your contact list. 
http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009

RE: this is driving me nucking futs!

2009-03-12 Thread dusty

Sorry Martin, did Dave answer your question?  Were you just wondering about
the namespace parameter on the url tag or about the routes pattern in
general?


mgainty wrote:
> 
> 
> can you explain this routes a bit more..what is this another attribute or
> a template?
> i can see see action, params but namespace?
> 
> if you look at the code the base class changes from 
> public class AnchorTag extends AbstractClosingTag 
> TO
> public class AnchorTag extends ContextBean
> basing AnchorTag on a bean allows you to tack on infinitely more
> attributes
> ...
> Martin 
> __ 
> Disclaimer and confidentiality note 
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission. 
> 
> 
> 
> 
>> Date: Thu, 12 Mar 2009 09:24:54 -0700
>> From: dustin_pea...@yahoo.com
>> To: user@struts.apache.org
>> Subject: Re: this is driving me nucking futs!
>> 
>> 
>> Adding the action, namespace and params url constructing pieces to s:a
>> would
>> be cool, as long as we don't nerf the s:url function.  I rather like the
>> pattern of using a central "routes" page as an include where urls are
>> created and their ids referenced in links via JSTL in the main pages.
>> 
>> -D
>> 
>> newton.dave wrote:
>> > 
>> > mitch gorman wrote:
>> >> I AM AN INSTRUMENT OF CHANGE!!!
>> > 
>> > Hmm, when people say that about me they say I'm a tool.
>> > 
>> > I'm not *entirely* sure they're being complimentary ;)
>> > 
>> > Dave
>> > 
>> > 
>> > -
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>> 
> 
> _
> Windows Live™ Groups: Create an online spot for your favorite groups to
> meet.
> http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009
> 

-- 
View this message in context: 
http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22489517.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: this is driving me nucking futs!

2009-03-12 Thread Dave Newton

Martin Gainty wrote:

can you explain this routes a bit more..what is this another attribute or a 
template?
i can see see action, params but namespace?


Yeah, so if the action is in another namespace you can refer to it.

if you look at the code the base class changes from 
public class AnchorTag extends AbstractClosingTag 
TO

public class AnchorTag extends ContextBean
basing AnchorTag on a bean allows you to tack on infinitely more attributes


It's already been done, as Musachy said:

https://issues.apache.org/struts/browse/WW-3037

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How can I tell if Struts is finding my messages file?

2009-03-12 Thread Lalchandra Rampersaud


You could have a class like this implemented...

package additionalClasses;

import java.util.ResourceBundle;


public class MessageBundle {

   private static final String DEFAULT_BUNDLE_NAME = 
"teamsoftSite.ApplicationResources";
   private static ResourceBundle defaultBundle = 
ResourceBundle.getBundle(DEFAULT_BUNDLE_NAME);


   public static String getMessage(String key) {
return defaultBundle.getString(key);
   }
}

and later call the getMessage function
MessageBundle.getMessage("assignRole.incompWorkers")

saludos
lalchandra rampersaud


- Original Message - 
From: "laredotornado" 

To: 
Sent: Thursday, March 12, 2009 10:41 AM
Subject: How can I tell if Struts is finding my messages file?




Hi,

I'm using Struts 1.  In my ActionForm's validate method, I have a section 
of

code ...

final ActionMessage am = new
ActionMessage("error.accountNum.wrong.length");
errors.add(ACCOUNT_NUM_PARAM_NAME,am);

My question is how can I verify that the property
"error.accountNum.wrong.length" is found in my message resource file?  Is
there a way I can get the value of the property,
"error.accountNum.wrong.length" within my validate method?

Thanks, - Dave



--
View this message in context: 
http://www.nabble.com/How-can-I-tell-if-Struts-is-finding-my-messages-file--tp22481715p22481715.html

Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



VI Conferencia Internacional de Energía Renovable, Ahorro de Energía y 
Educación Energética
9 - 12 de Junio 2009, Palacio de las Convenciones
...Por una cultura energética sustentable
www.ciercuba.com 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: this is driving me nucking futs!

2009-03-12 Thread Martin Gainty

can you explain this routes a bit more..what is this another attribute or a 
template?
i can see see action, params but namespace?

if you look at the code the base class changes from 
public class AnchorTag extends AbstractClosingTag 
TO
public class AnchorTag extends ContextBean
basing AnchorTag on a bean allows you to tack on infinitely more attributes
...
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Thu, 12 Mar 2009 09:24:54 -0700
> From: dustin_pea...@yahoo.com
> To: user@struts.apache.org
> Subject: Re: this is driving me nucking futs!
> 
> 
> Adding the action, namespace and params url constructing pieces to s:a would
> be cool, as long as we don't nerf the s:url function.  I rather like the
> pattern of using a central "routes" page as an include where urls are
> created and their ids referenced in links via JSTL in the main pages.
> 
> -D
> 
> newton.dave wrote:
> > 
> > mitch gorman wrote:
> >> I AM AN INSTRUMENT OF CHANGE!!!
> > 
> > Hmm, when people say that about me they say I'm a tool.
> > 
> > I'm not *entirely* sure they're being complimentary ;)
> > 
> > Dave
> > 
> > 
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ Groups: Create an online spot for your favorite groups to meet.
http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009

Re: this is driving me nucking futs!

2009-03-12 Thread Musachy Barroso
it is up in svn, ticket:

https://issues.apache.org/struts/browse/WW-3037

The "a" tag now supports all the attributes that "url" supports,
except "var", which it doesn't need. It also supports nested params.
One annoyance down, a few to go.

musachy

On Thu, Mar 12, 2009 at 1:30 PM, Musachy Barroso  wrote:
> "a" will support all the attributes that "url" does, it is almost
> done, working on the tests at the moment.
>
> musachy
>
> On Thu, Mar 12, 2009 at 12:24 PM, dusty  wrote:
>>
>> Adding the action, namespace and params url constructing pieces to s:a would
>> be cool, as long as we don't nerf the s:url function.  I rather like the
>> pattern of using a central "routes" page as an include where urls are
>> created and their ids referenced in links via JSTL in the main pages.
>>
>> -D
>>
>> newton.dave wrote:
>>>
>>> mitch gorman wrote:
     I AM AN INSTRUMENT OF CHANGE!!!
>>>
>>> Hmm, when people say that about me they say I'm a tool.
>>>
>>> I'm not *entirely* sure they're being complimentary ;)
>>>
>>> Dave
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Convention for keeping passwords out of struts.xml

2009-03-12 Thread Security Management
I'll look up the spring way to do it, I was incorrectly thinking my stuff
was in struts.xml, but it's in applicationContext (which is, of course,
spring).

Thanks

-Original Message-
From: Dave Newton [mailto:newton.d...@yahoo.com] 
Sent: Thursday, March 12, 2009 2:57 PM
To: Struts Users Mailing List
Subject: Re: Convention for keeping passwords out of struts.xml

Jim Kiley wrote:
> Dave's right -- a good choice here is to keep that kind of data in a
server
> settings config file, and set up your application to pull the database
> context info out of the JNDI context.  Check out
> http://tomcat.apache.org/tomcat-5.5-doc/index.html
> for
> details on this sort of thing.

I'm with Jim. But that aside you can also use Spring's 
property-placeholder (or whatever it's called) to keep passwords in a 
property file, the values of which are then referenced inside the Spring 
config file.

This seems more like a Spring-ish topic, though.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



UI tags encoding/stripping behavior

2009-03-12 Thread Arshan Dabirsiaghi
I'm a Struts1 guy who just started researching Struts2. Is there any place
where the encoding and stripping behavior of the UI tags is located? I've
done a fair bit of Googling and downloaded the source code, but I can't find
any correlating logic. If I send the following string as a parameter that is
shown on a JSP with , should the expected value be blank?

!...@$%^*()_+-={}|[]\:";'<>?,./

You can test this on the showcase demo with the following URL (domain, port
may have to be customized):

http://localhost:8080/struts2-showcase-2.1.6/tags/ui/example!input.action?nam...@$%^*()_+-={}|[]\:";'<>?,./

I'm interested to figure out how these UI tags all handle special
characters, and any feedback is appreciated.

Thanks,
Arshan


Re: Convention for keeping passwords out of struts.xml

2009-03-12 Thread Dave Newton

Jim Kiley wrote:

Dave's right -- a good choice here is to keep that kind of data in a server
settings config file, and set up your application to pull the database
context info out of the JNDI context.  Check out
http://tomcat.apache.org/tomcat-5.5-doc/index.html
for
details on this sort of thing.


I'm with Jim. But that aside you can also use Spring's 
property-placeholder (or whatever it's called) to keep passwords in a 
property file, the values of which are then referenced inside the Spring 
config file.


This seems more like a Spring-ish topic, though.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Convention for keeping passwords out of struts.xml

2009-03-12 Thread Jim Kiley
Dave's right -- a good choice here is to keep that kind of data in a server
settings config file, and set up your application to pull the database
context info out of the JNDI context.  Check out
http://tomcat.apache.org/tomcat-5.5-doc/index.html
for
details on this sort of thing.
jk

On Thu, Mar 12, 2009 at 2:50 PM, Security Management <
list-subscripti...@secmgmt.com> wrote:

> OK, my bad, I meant out of the applicationContext.xml
>
> I basically want to be able to tell someone to deploy a war file, edit a
> file outside of the "webroot" that has the settings in it, and startup
> tomcat.
>
> Then, my app would load that properties file and make the connection.
>
>
>
> -Original Message-
> From: Dave Newton [mailto:newton.d...@yahoo.com]
> Sent: Thursday, March 12, 2009 2:40 PM
> To: Struts Users Mailing List
> Subject: Re: Convention for keeping passwords out of struts.xml
>
> Security Management wrote:
> > What's the convention for keeping database settings out of struts.xml?
>
> Hmm, I guess I never even considered putting them in there.
>
> JNDI, Spring, and property files are the obvious choices, most DB
> technologies support creating a datasource in their own config as well.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com


RE: Convention for keeping passwords out of struts.xml

2009-03-12 Thread Security Management
OK, my bad, I meant out of the applicationContext.xml

I basically want to be able to tell someone to deploy a war file, edit a
file outside of the "webroot" that has the settings in it, and startup
tomcat.

Then, my app would load that properties file and make the connection.



-Original Message-
From: Dave Newton [mailto:newton.d...@yahoo.com] 
Sent: Thursday, March 12, 2009 2:40 PM
To: Struts Users Mailing List
Subject: Re: Convention for keeping passwords out of struts.xml

Security Management wrote:
> What's the convention for keeping database settings out of struts.xml?

Hmm, I guess I never even considered putting them in there.

JNDI, Spring, and property files are the obvious choices, most DB 
technologies support creating a datasource in their own config as well.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Convention for keeping passwords out of struts.xml

2009-03-12 Thread Dave Newton

Security Management wrote:

What's the convention for keeping database settings out of struts.xml?


Hmm, I guess I never even considered putting them in there.

JNDI, Spring, and property files are the obvious choices, most DB 
technologies support creating a datasource in their own config as well.


Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to set an ActionValidatorManager to unittest?

2009-03-12 Thread Greg Lindholm



gordian yuan wrote:
> 
> Hi, All
> 
> I found this article, How do I unit test my action's validation logic
> ,
> 
> However, in struts2.1.6 have been removed ActionValidatorManagerFactory
> class
> My question is how can be obtain an ActionValidatorManager in unittest?
> Any input will be great! Thanks...
> 
> Gordian
> 
> 

I don't know anything about ActionValidatorManager but I use the following
to fully test my actions including validation, interceptors, and results.

http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/

Hopefully it's helpful.
-- 
View this message in context: 
http://www.nabble.com/How-to-set-an-ActionValidatorManager-to-unittest--tp22472794p22482351.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How can I tell if Struts is finding my messages file?

2009-03-12 Thread laredotornado

Hi,

I'm using Struts 1.  In my ActionForm's validate method, I have a section of
code ...

final ActionMessage am = new
ActionMessage("error.accountNum.wrong.length");
errors.add(ACCOUNT_NUM_PARAM_NAME,am);

My question is how can I verify that the property
"error.accountNum.wrong.length" is found in my message resource file?  Is
there a way I can get the value of the property,
"error.accountNum.wrong.length" within my validate method?

Thanks, - Dave



-- 
View this message in context: 
http://www.nabble.com/How-can-I-tell-if-Struts-is-finding-my-messages-file--tp22481715p22481715.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Convention for keeping passwords out of struts.xml

2009-03-12 Thread Security Management
What's the general convention for keeping database settings out of
struts.xml?  I have an app that will be sent to people that already have a
database setup, and they need to specify the hostname, username, etc.  I
need ideas on how to store this outside of the war that I send.

Can anyone help, I can't find much on the web (but I might just be missing
the search terms)

Thanks.




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: this is driving me nucking futs!

2009-03-12 Thread Musachy Barroso
"a" will support all the attributes that "url" does, it is almost
done, working on the tests at the moment.

musachy

On Thu, Mar 12, 2009 at 12:24 PM, dusty  wrote:
>
> Adding the action, namespace and params url constructing pieces to s:a would
> be cool, as long as we don't nerf the s:url function.  I rather like the
> pattern of using a central "routes" page as an include where urls are
> created and their ids referenced in links via JSTL in the main pages.
>
> -D
>
> newton.dave wrote:
>>
>> mitch gorman wrote:
>>>     I AM AN INSTRUMENT OF CHANGE!!!
>>
>> Hmm, when people say that about me they say I'm a tool.
>>
>> I'm not *entirely* sure they're being complimentary ;)
>>
>> Dave
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to hand out a param from request to request

2009-03-12 Thread Marc Eckart
Hi,

I want to "automatically" give a paramter from request to request. How
can I do this?

The context why I want something like this is:

We have many applications which runs on their own webservers. Now we
have an approach to put them all together in an portal application.
This application opens an iframe for every integrated application
which should be executed. This works fine. But now I have the problem
that each integrated application can call another webapplication which
does some search operations. The applications are connected with
return-urls.

The problem is that now all applications are in the same browser
(before most of them has theire own browser instance) and the session
id is the same. So the return url from the calling application is
overwritten from the returnurl of the next integrated application.

My idea is, that the inital request creates a unique token, which is
used to store the application specific params in the session. And this
token has to be given from request to request so that the different
searches don't cross each other.

Does this make sense?

Best regards,
Marc

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: this is driving me nucking futs!

2009-03-12 Thread dusty

Adding the action, namespace and params url constructing pieces to s:a would
be cool, as long as we don't nerf the s:url function.  I rather like the
pattern of using a central "routes" page as an include where urls are
created and their ids referenced in links via JSTL in the main pages.

-D

newton.dave wrote:
> 
> mitch gorman wrote:
>> I AM AN INSTRUMENT OF CHANGE!!!
> 
> Hmm, when people say that about me they say I'm a tool.
> 
> I'm not *entirely* sure they're being complimentary ;)
> 
> Dave
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How can I process form with custom index-like properties

2009-03-12 Thread dusty

The [] syntax is used to define collections or maps of values.   I don't
think your setters are going to work that way.  OGNL does not know how to
handle arbitrary new setter parameters.  

I think what you are trying to do is create a form with an arbitrary number
of fields, probably driven from some database Form definition and you are
trying to figure out a model to "catch" the data that comes in.

We could go down the route of discussing the patterns associated with this
common problem.  One of the approaches involves a "long and skinny" database
schema.  This means that your values are all stored in a single table as
key/value pairs as Strings, potentially with some type information you can
use for casting later.   Some have created different skinny tables for
different types to avoid the casting issue but that causes more complex
query mapping to your models..but where was I

I went there because you can use a Map in your action to "catch" all of the
key/value pairs you send through.  In the webwork days this was a popular
patterned called Map Backed Actions??I think or something like that.  You
could google it to see how it works.  You can use one map or several maps
and even store collections (checkbox select many) as map values.

But you will not be able to use the setters the way you are.   That syntax
is for collections and maps.



Alexander Dimitrov-2 wrote:
> 
> Hello,
> 
> I'm working on complicated data generated form
> 
> 
> 
> 
> 
> 
> name
> params
> comb1
> comb2
> comb3
> 
> 
> 
> 
> 
> 
> 
>  name="radio[%{formRadioGroupName}]" list="{item.id}"/>
> 
> 
> 
>  label="item.name"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> X:
> Y:
> 
> 
> Col: name="areaColParam[%{item.id}]"/>
> h: name="areaMmParam[%{item.id}]"/>
> 
> 
>  
> 
> 
> 
> 
> :
>  list="item.comb1.items" listKey="id" listValue="name" />
> 
> 
>  
> 
> 
> 
> 
> :
>  list="item.comb2.items" listKey="id" listValue="name" />
> 
> 
>  
> 
> 
> 
> 
> :
>  list="item.comb3.items" listKey="id" listValue="name" />
> 
> 
>  
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> I have defined getters and setters with additional parameter on the
> receiving action class:
> 
> 
> 
> public class OrdItm extends ActionSupport implements ParameterAware {
> ...
> public int getRadio(String radioGroupName) {
> ...
> }
> 
> public void setRadio(String radioGroupName, int value) {
> ...
> }
> 
> public boolean getCheckBox(int id) {
> ...
> }
> 
> public void setCheckBox(int id, boolean value) {
> ...
> }
> }
> 
> 
> 
> Too bad that none of the getters/setters are called when form is posted
> 
> I included parametersAware interceptor to see what I receive from post
> Here is list the list of received values
> 
> 
> 
> key=checkBox[226] value=[true]
> key=checkBox[223] value=[false]
> key=itemDate value=[]
> key=checkBox[221] value=[false]
> key=checkBox[222] value=[true]
> key=comb2[212] value=[100]
> key=areaMmParam[212] value=[]
> key=areaMmParam[211] value=[]
> key=checkBox[225] value=[false]
> key=checkBox[224] value=[true]
> key=areaMmParam[210] value=[25]
> key=areaColParam[211] value=[]
> key=comb1[211] value=[400]
> key=itemText value=[]
> key=comb1[212] value=[400]
> key=radio[RG201] value=[210]
> key=comb1[210] value=[401]
> key=areaColParam[212] value=[]
> key=areaColParam[210] value=[1]
> 
> 
> 
> 
> Thanks in advance for 

Struts 2.1.6 - Date parameters conversion failure due to missing locale

2009-03-12 Thread Andrea
Hi Lukasz,

my failing configuration:
- web client with italian locale
- server with english locale
- the user posts a form including datetimepicker (dd/mm/ format)

ex.

form field contains 29/01/2009 after submitted becomes 01/05/2011
form field contains 06/03/2009 after submitted becomes 03/06/2009

Can you help me?

THX

BR


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How can I process form with custom index-like properties

2009-03-12 Thread Alexander Dimitrov
Hello,

I'm working on complicated data generated form






name
params
comb1
comb2
comb3


























X:
Y:


Col:
h:


 




:



 




:



 




:



 











I have defined getters and setters with additional parameter on the
receiving action class:



public class OrdItm extends ActionSupport implements ParameterAware {
...
public int getRadio(String radioGroupName) {
...
}

public void setRadio(String radioGroupName, int value) {
...
}

public boolean getCheckBox(int id) {
...
}

public void setCheckBox(int id, boolean value) {
...
}
}



Too bad that none of the getters/setters are called when form is posted

I included parametersAware interceptor to see what I receive from post
Here is list the list of received values



key=checkBox[226] value=[true]
key=checkBox[223] value=[false]
key=itemDate value=[]
key=checkBox[221] value=[false]
key=checkBox[222] value=[true]
key=comb2[212] value=[100]
key=areaMmParam[212] value=[]
key=areaMmParam[211] value=[]
key=checkBox[225] value=[false]
key=checkBox[224] value=[true]
key=areaMmParam[210] value=[25]
key=areaColParam[211] value=[]
key=comb1[211] value=[400]
key=itemText value=[]
key=comb1[212] value=[400]
key=radio[RG201] value=[210]
key=comb1[210] value=[401]
key=areaColParam[212] value=[]
key=areaColParam[210] value=[1]




Thanks in advance for your help

Regards,
Alexander

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2.1.6 - Date parameters conversion failure due to missing locale

2009-03-12 Thread Lukasz Lenart
2009/3/12 Andrea :
> after migrating from 2.0.11 to 2.1.6 version i faced the above problem.
> can someone send me the xwork 2.1.3 jar file, or only the .class fixed ?
> I can't build it cause the enterprise firewall.
> I need to resolve the issue because our web app doesn't works.

You can find it here
http://www.lenart.org.pl/maven/com/opensymphony/xwork/


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts 2.1.6 - Date parameters conversion failure due to missing locale

2009-03-12 Thread Andrea
Hello all,
after migrating from 2.0.11 to 2.1.6 version i faced the above problem.
can someone send me the xwork 2.1.3 jar file, or only the .class fixed ?
I can't build it cause the enterprise firewall.
I need to resolve the issue because our web app doesn't works.
Thanks in advance.
BR



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Rest plugin and 2.1.6 - controllers not mapped

2009-03-12 Thread wkbutler

This is combination that I found worked, but using all 2.1.6.

* Name your action *Controller (as you have done)
* Make sure you have a simple struts.xml like is shipped with the
struts2-rest-showcase demo app (packaged with the plugin download) and no
other lingering struts properties
* Make sure your JSP template is available as
   WEB-INF/content/rest-show.jsp for URL: 
http://server/context/rest/1
   WEB-INF/content/rest-index.jsp for URL: 
http://server/context/rest

That should be enough. Get this working and then re-introduce your own
Struts mappings and packages.



boldt wrote:
> 
> Hi
> 
> I have a web application that uses Struts2 2.1.2 and the rest plugin. I'm
> developing using a combo of eclipse, maven and tomcat.
> 
> However, I have tried to upgrade to 2.1.6 and then the application stops
> to
> work. The problem is that my action classes does not get mapped anymore
> after I upgraded.
> 
> For instance running 2.1.2 I got the following line outputted during
> startup: class:class dk.bc.serverinterface.http.rest.RestController
> parent:null current:dk.bc.serverinterface.http.rest
> 
> Eg it maps restcontroller to an action. After the update no controllers
> are
> mapped, and all request to the application fails. Is there a fix to this
> problem or should I alter my configuration after updating.
> 
> Best Regards
> Niels
> -- 
> BinaryConstructors ApS
> Vestergade 10a, 4th
> 1456 Kbh K
> Denmark
> phone: +4528138757
> web: http://www.binaryconstructors.dk
> mail: n...@binaryconstructors.dk
> skype: nielsboldt
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Rest-plugin-and-2.1.6---controllers-not-mapped-tp22474233p22476512.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: this is driving me nucking futs!

2009-03-12 Thread Dave Newton

mitch gorman wrote:

I AM AN INSTRUMENT OF CHANGE!!!


Hmm, when people say that about me they say I'm a tool.

I'm not *entirely* sure they're being complimentary ;)

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: this is driving me nucking futs!

2009-03-12 Thread Martin Gainty

Mitch-

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


Numbers Game

var submitcount=0;
function submitForm()
{
  var url ='http://localhost:8080/struts2-showcase-2.1.2/action' + 
escape(document.form.select.value);
  document.form.action=url;
  alert(url);
  document.form.submit();
}
  



Numbers Game


 

   






OGNL and JSTL use back end (Bean) objects to store and retrieve  
back end objects
your submit tag can call JavaScript which will construct a url variable as 
illustrated here
just be sure to assign document.form.action=url before submitting as seen in 
submitForm()

HTH
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Wed, 11 Mar 2009 17:17:13 -0400
> From: mgor...@shadowtv.biz
> To: user@struts.apache.org
> Subject: Re: this is driving me nucking futs!
> 
> Musachy Barroso wrote:
> > That is something I have complained about for a long time, time to do
> > something about it I guess.
> >   
> 
> I AM AN INSTRUMENT OF CHANGE!!!
> 
> ;)
> 
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Express your personality in color! Preview and select themes for Hotmail®. 
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme

historyBack

2009-03-12 Thread PEGASUS84

good moorning;
does someone know How can I create an action which allows to go back to the
previous page? 
-- 
View this message in context: 
http://www.nabble.com/historyBack-tp22473940p22473940.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Rest plugin and 2.1.6 - controllers not mapped

2009-03-12 Thread Niels Boldt
Hi

I have a web application that uses Struts2 2.1.2 and the rest plugin. I'm
developing using a combo of eclipse, maven and tomcat.

However, I have tried to upgrade to 2.1.6 and then the application stops to
work. The problem is that my action classes does not get mapped anymore
after I upgraded.

For instance running 2.1.2 I got the following line outputted during
startup: class:class dk.bc.serverinterface.http.rest.RestController
parent:null current:dk.bc.serverinterface.http.rest

Eg it maps restcontroller to an action. After the update no controllers are
mapped, and all request to the application fails. Is there a fix to this
problem or should I alter my configuration after updating.

Best Regards
Niels
-- 
BinaryConstructors ApS
Vestergade 10a, 4th
1456 Kbh K
Denmark
phone: +4528138757
web: http://www.binaryconstructors.dk
mail: n...@binaryconstructors.dk
skype: nielsboldt


Re: Struts2 Standards, guidelines, recommendations

2009-03-12 Thread Norris Shelton
I was looking for something akin to the java code convention standard 
(http://java.sun.com/docs/codeconv/).  My guess is that there is nothing out 
there for that.  My guess that would boil down to things like naming 
conventions for Actions, execute methods, etc.

For recommendations (don't ask me why they want 2 separate documents), I was 
thinking more along the lines of use 2.1, use the struts2-convention-plugin and 
listing what that entails.

 
Norris Shelton
Software Engineer
Sun Certified Java 1.1 Programmer
Shelton Consulting, LLC
ICQ# 26487421
AIM NorrisEShelton
YIM norrisshelton





From: Dave Newton 
To: Struts Users Mailing List 
Sent: Wednesday, March 11, 2009 5:08:57 PM
Subject: Re: Struts2  Standards, guidelines, recommendations

Norris Shelton wrote:
> I am working to get Struts2 approved as a production technology.  Can you 
> point me
> to any standards or guidelines or implementation recommendations?

What kind of standards? What kind of guidelines or implementation 
recommendations are you looking for?

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


  

How to set an ActionValidatorManager to unittest?

2009-03-12 Thread Gordian Yuan
Hi, All

I found this article, How do I unit test my action's validation logic
,

However, in struts2.1.6 have been removed ActionValidatorManagerFactory
class
My question is how can be obtain an ActionValidatorManager in unittest?
Any input will be great! Thanks...

Gordian


Re: select problem

2009-03-12 Thread Paweł Wielgus
Hi Elyes,
which html field should post that label? There is only a select which
will post id. Also the name element of the optionsCollection is
missing.

Best greetings,
Pawel Wielgus.

2009/3/11, elyes sallem :
> Hello,
> i have a select component associated with a property selectedProject
> the problem is after calling the action (with an onchange event), in the
> action i get the correct project id , but i lost the project label
> so , after the action call, it displays the wrong project (as i said but the
> project id is corect)
> here is the code in the jsp and the getter and the setter of the properties
>
>
>   
>  onchange="form.action='EditSaisiProv.do?do=refreshProjet';form.submit();">
>  />
> 
> 
>
>
>   public Projet getSelectedProject() {
>   return selectedProject;
>   }
>
>   public void setSelectedProject(Projet selectedProject) {
>   this.selectedProject = selectedProject;
>   }
> java.util.List projetList = new ArrayList();
>   public java.util.List getProjetList() {
>   return projetList;
>   }
>
>   public void setProjetList(java.util.List projetList) {
>   this.projetList = projetList;
>   }
>
>
>
>
> Any one has an idea why?
>
> Thanks
> Regards
> Elyes.
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org