Re: RequestHeaderAware in Struts 2?

2010-10-25 Thread Chris Pratt
As far as I'm aware, there's not. But it wouldn't be hard to write one. You could use the ParameterInterceptor as a pattern, but have it take it's data from the headers rather than the parameters and you'd be done in 1/2 hr. You could get fancier, to make sure Parameters and Headers with the same

RequestHeaderAware in Struts 2?

2010-10-25 Thread Jose Luis Martinez Avial
Hello, I'm working on an application that for security reasons needs to access to the request headers from an action. I know I can access to the request, but I'm also aware that that is not recomended. Is there a RequestHeaderAware or something like that, that fits that the same behaviour as Par

Re: checkbox problem

2010-10-25 Thread Peter Bliznak
Sounds good I will try it first thing in the morning. Thank you for your time spent with me Peter. On Mon, Oct 25, 2010 at 10:44 PM, Dave Newton wrote: > Ultimately they're all going to handle it more-or-less the same way: > persistent state on the server, or hidden fields in the form. If the >

Re: checkbox problem

2010-10-25 Thread Dave Newton
Ultimately they're all going to handle it more-or-less the same way: persistent state on the server, or hidden fields in the form. If the code is invisible to the developer, I don't see much of a difference. I also gave you another option: use a map, keyed by an ID, with an object value. On Monda

Re: checkbox problem

2010-10-25 Thread Peter Bliznak
checked CheckboxInterceptor and see what it does. I guess no way around it PS as for what I checked before - that was lift and wicked..somehow I found it friendlier but hey that might be just my opinion :-) On Mon, Oct 25, 2010 at 10:09 PM, Dave Newton wrote: > Hidden parameters are the only

Re: checkbox problem

2010-10-25 Thread Dave Newton
Hidden parameters are the only way to get a value for an unchecked checkbox, that's just how HTML works. But yes, you're wrong; the checkbox interceptor does the work for you. Please read the documentation and just try it. Dave (Cumbersome? Compared to what?) On Monday, October 25, 2010, Peter B

Re: checkbox problem

2010-10-25 Thread Peter Bliznak
Sorry about "of course" we have over two dozens of s1 apps and evaluating if s2 makes sense to switch to or go with something else. And for that we have over 50 items to cover to see how difficult/easy it is in s2. I am really surprise that such a trivial task has to be done using hidden parameters

Re: checkbox problem

2010-10-25 Thread Dave Newton
Same way they're generated now, with the checkbox tag, or by hand. Or use a map. And there's no "of course": people use both versions. Dave On Monday, October 25, 2010, Peter Bliznak wrote: > Hi Dave, > using S2 of course. > not sure I am getting what you suggested. I have dynamic list and have

Re: checkbox problem

2010-10-25 Thread Peter Bliznak
Hi Dave, using S2 of course. not sure I am getting what you suggested. I have dynamic list and have no idea what size is going to be (inside my jsp which was created prior to that call)-- how would you then create hidden parameters dynamically? On Mon, Oct 25, 2010 at 9:19 PM, Dave Newton wrote:

Re: checkbox problem

2010-10-25 Thread Dave Newton
Which version of Struts? Struts 2 uses a hidden field to deal with default (unchecked) values. Struts 1 ActionForms used the reset() method to pre-load default values. Dave On Mon, Oct 25, 2010 at 9:16 PM, Peter Bliznak wrote: > Hi, > I have a list over which I am iterating - it has checkbox an

checkbox problem

2010-10-25 Thread Peter Bliznak
Hi, I have a list over which I am iterating - it has checkbox and other fields. I know I can define array associated with checkbox's values but that only returns values which were checked. In my other column I have date and I have to make that date associated with checkbox's state. How am I suppose

Re: export to excel - displaytag

2010-10-25 Thread Dave Newton
You might have better luck asking on a DisplayTag list/forum. Dave On Mon, Oct 25, 2010 at 4:41 PM, Struts User wrote: > Hi all, > > I am trying to export data to excel using diplaytag. I am able to save the > excel file but the file is empty. Any help is greatly appreciated. > I am setting the

export to excel - displaytag

2010-10-25 Thread Struts User
Hi all, I am trying to export data to excel using diplaytag. I am able to save the excel file but the file is empty. Any help is greatly appreciated. I am setting the export filter and display-tag properties as below. *web.xml:* ResponseOverrideFilter org.displaytag.filter.ResponseOver

Re: Validation in Struts 1

2010-10-25 Thread Qiang Li
On Mon, 2010-10-25 at 14:01 -0400, Anjib Mulepati wrote: > ok so is this mean both is server side validation and client side > validation is done with Javascript? > > Also between these two(.xml and execute() method) which one is better? > Any pros and cons? > > Anjib > > On 10/25/2010 1:55 PM

Re: Validation in Struts 1

2010-10-25 Thread Dave Newton
On Mon, Oct 25, 2010 at 2:01 PM, Anjib Mulepati wrote: > ok so is this mean both is server side validation and client side validation > is done with Javascript? ??? No. Client-side validation is done with JavaScript, because that's what runs inside browsers. Server-side validation is done in Ja

Re: Validation in Struts 1

2010-10-25 Thread Anjib Mulepati
ok so is this mean both is server side validation and client side validation is done with Javascript? Also between these two(.xml and execute() method) which one is better? Any pros and cons? Anjib On 10/25/2010 1:55 PM, Dave Newton wrote: That's not combining client- and server-side valida

Re: Validation in Struts 1

2010-10-25 Thread Dave Newton
That's not combining client- and server-side validation, that's combining declarative and programmatic validation, unless you're talking about the JavaScript validation method. Dave On Mon, Oct 25, 2010 at 1:52 PM, Anjib Mulepati wrote: > Hi > > Can we combine client side validation and server s

Validation in Struts 1

2010-10-25 Thread Anjib Mulepati
Hi Can we combine client side validation and server side validation? i.e. using validation.xml as well as validation in validate() method as well. Does it make any sense? Thanks

Re: How to get the value of Constants defined in struts.xml

2010-10-25 Thread Andy Law
Heading off at a slight tangent, is it possible to use the constant values in action configurations within the struts XML? I have long thought it a code smell that I have magic strings in my XML configuration that get repeated in my code. If I could handle those by reference to a single point in

Re: How to get the value of Constants defined in struts.xml

2010-10-25 Thread Dave Newton
Simplicity: it's just an @Inject. On Mon, Oct 25, 2010 at 2:55 AM, SudhirJava wrote: > > Struts Constants. > I can define in web.xml and get the value in Action class too. > Then what is the use of Struts Constants? > > > ~SK > > > Maurizio Cucchiara wrote: >> >> I'm not sure what you mean. >> Wh