RE: [s1] security filter for EventDispatchAction

2007-07-31 Thread Strachan, Paul
Hi, Does Struts1 provide an example anywhere of how to use Servlet Filter to access the struts config? Thanks, Paul -Original Message- From: Strachan, Paul [mailto:[EMAIL PROTECTED] Sent: Friday, 27 July 2007 3:47 PM To: user@struts.apache.org Subject: [s1] security filter for

[s1] security filter for EventDispatchAction

2007-07-26 Thread Strachan, Paul
Hi, For security/authorisation we use a servlet filter which checks the url against our security database. We've recently upgraded to Struts 1.2.9 and tried using EventDispatchAction, but the problem is the filter does not know which event to secure against (as the event name is arbitory value

RE: Re: EL expression in html:form action

2007-03-15 Thread Strachan, Paul
It should work OK if you're using the http://struts.apache.org/tags-html-el taglib. -Original Message- From: Lim Hock-Chai [mailto:[EMAIL PROTECTED] Sent: Friday, 16 March 2007 4:08 AM To: Struts Users Mailing List Subject: RE: Re: EL expression in html:form action I'm pretty sure that c

RE: [s1] handle exception in processPopulate?

2007-03-11 Thread Strachan, Paul
I resolved this myself by simply overriding the set(String, Object) method in my form, to ignore certain request parameter names that are not of type String in my LazyValidatorForm. From: Strachan, Paul Sent: Saturday, 10 March 2007 4:51 PM To: user

[s1] handle exception in processPopulate?

2007-03-09 Thread Strachan, Paul
Hi, struts 1.2.9 beanutils 1.7.0 I receive a 500 'org.apache.commons.beanutils.ConversionException' originating from the RequestProcessor.processPopulate() displayed on the web page. I can usually make this type of error occur by "hacking" the http parameters, e.g. specifiying a request parame

RE: [DESIGN] struts dialog / wizard

2007-02-26 Thread Strachan, Paul
? Thanks, Paul -Original Message- From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 February 2007 10:53 AM To: Struts Users Mailing List Subject: Re: [DESIGN] struts dialog / wizard On 2/25/07, Strachan, Paul <[EMAIL PROTECTED]> wrote: > Hi, > > I'

html:button

2007-02-25 Thread Strachan, Paul
Hi, I realise this is probably not a struts problem and I feel a bit silly posting this question but here goes: I'm using html:button with EventDispatchAction but my button properties do not appear in the request - the html source fragment goes something like: function doEdit(id) { docu

[DESIGN] struts dialog / wizard

2007-02-25 Thread Strachan, Paul
Hi, I'm looking at implementing a struts wizard flow (of about 12 pages) into my struts-1.2.9 application. The struts dialogue project seems to be along the lines of what I need (pattern-wise). I have some extra quirements such as: 1. A progress menu (synch with the wizard) 2. Some pages hav

RE: Please Help: Problem in implementing Tiles Controller

2007-02-21 Thread Strachan, Paul
I can't see "q1Choice" defined in your tiles, it looks like you have defined the attribute only on request scope. "header","contact","footer" are tiles attributes - just comment out the and you might be OK. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thur

RE: [s1] Global-forwards with Tiles

2007-02-06 Thread Strachan, Paul
you have to use a valid url with an anchoryour browser cannot make a new HTTP request to a Tile. what were you expecting the link to contain? From: Pierre Thibaudeau [mailto:[EMAIL PROTECTED] Sent: Wed 2/7/2007 10:40 AM To: Struts Users Mailing List Subject:

RE: Design issue

2007-02-02 Thread Strachan, Paul
Hi, I usually access my cached droplist data directly from the jsp - eg have placed a bean called "ReferenceDataCache" on application scope with getter methods. In jsp I can simply call: I also try to keep my struts forms only containing properties for the http posted data. The co

RE: Check if field exists in Validator

2007-02-01 Thread Strachan, Paul
What vaildator method - If you have 2 forms, why not just have 2 validator form definitions (one for each form). Or is it you actually have one form where for one mapping the field is mandatory, and the other mapping the field is optional, and you wish to validate in both actions? Some solutions

RE: Struts 1.3.5 - Validate for "&" in mask validator

2007-01-30 Thread Strachan, Paul
try: & From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wed 1/31/2007 2:58 PM To: user@struts.apache.org Subject: Struts 1.3.5 - Validate for "&" in mask validator Hi, Maybe this is more of a Regular Expressions question than struts, but please h

RE: Re: Loss of request attributes after validation form

2007-01-29 Thread Strachan, Paul
Hi, Can you be more specific regarding the data you are losing on validation? e.g. 1. request attributes when a new request is sent from the browser, the validation may occur before you have an opportunity to add further request attributes - in this case you should validate in your action c

RE: external javascript file linking problem?

2006-12-11 Thread Strachan, Paul
From: Mallik [mailto:[EMAIL PROTECTED] Sent: Tue 12/12/2006 4:53 PM To: user@struts.apache.org Subject: external javascript file linking problem? Hi friends i am converting a project into struts i want to use my javascript(js) calender file in strtus applicat

RE: how to initialize an edit page?

2006-12-11 Thread Strachan, Paul
I'm using struts 1.2.9 but your case seems pretty standard. 1. yes, you should include the form name in your mapping 2. if necessary, in your action access the "id" from either the request or the form 3. get your data and populate the form 4. do not create form beans yourself If you still have

RE: html:link

2006-12-11 Thread Strachan, Paul
a) The displayTag library can sort for you b) you can only pass one parameter using html:link (unless you use a Map) c) if "function" is a Dispatch method you could use javascript onclick event handler to submit to the "sort" method, passing the sortOrder parameter - then toggle it in your action

RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?

2006-12-08 Thread Strachan, Paul
ist Subject: Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: >> Have you tried calling yourFormBean.get("yourArrayList") an

RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?

2006-12-08 Thread Strachan, Paul
2006 3:24 AM To: Struts Users Mailing List Subject: Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? -----BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: > Chris, In my DynForm I'm actually using a jav

RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?

2006-12-08 Thread Strachan, Paul
there a recommended solution? From: Strachan, Paul [mailto:[EMAIL PROTECTED] Sent: Sat 9/12/2006 2:54 AM To: Struts Users Mailing List Subject: RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE? Ch

RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?

2006-12-08 Thread Strachan, Paul
UEST scope!" TRUE or NOT TRUE? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, Strachan, Paul wrote: > A request scoped "out of the box" DynaValidatorForm is also unable to > handle indexed properties e.g. throws IndexOutOfBoundsException in > DynaActionForm.get(string, int)

RE: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?

2006-12-08 Thread Strachan, Paul
Hi, I've only recently started putting my forms on request scope, and encountered this issue with DynaValidatorForm. A request scoped "out of the box" DynaValidatorForm is also unable to handle indexed properties e.g. throws IndexOutOfBoundsException in DynaActionForm.get(string, int) - I gu

RE: SimpleMenuItem and tiles/putList

2006-12-04 Thread Strachan, Paul
HTH -Original Message- From: Adam Gordon [mailto:[EMAIL PROTECTED] Sent: Tuesday, 5 December 2006 10:20 AM To: user@struts.apache.org Subject: SimpleMenuItem and tiles/putList We have a home grown menu system we're using to display our web app's

RE: Map backed properties

2006-12-04 Thread Strachan, Paul
try something like: ... -Original Message- From: Gundersen, Richard [mailto:[EMAIL PROTECTED] Sent: Monday, 4 December 2006 11:00 PM To: user@struts.apache.org Subject: Map backed properties Hi I've been happily working with map based properties in my forms for a while now, but I

RE: initial values and reset method relation

2006-11-27 Thread Strachan, Paul
Hi, According the struts documentation the default implementation of reset() does nothing, so calling super() will have no effect. When you override a method it is up to you to call super() or not, in this case I do not believe it is required. You only need to reset form elements that DO NOT sub

RE: Tiles & menus

2006-11-22 Thread Strachan, Paul
what is the trouble?...all looks good to me do you need to include: classtype="org.apache.struts.tiles.beans.SimpleMenuItem" ? From: Java Programmer [mailto:[EMAIL PROTECTED] Sent: Thu 23/11/2006 12:07 AM To: user@struts.apache.org Subject: Tiles & menus

RE: Date validation

2006-11-22 Thread Strachan, Paul
Hi, what exact value did you enter with the date pattern MM/dd/yy? I dont like datePatternStrict because you have to enter the leading zero for dd and MM; and the year should format according to java.text.SimpleDateFormat rules. I use dd/MM/ (not strict) and the user can type the full yea

RE: another html:link issue

2006-11-21 Thread Strachan, Paul
You could also try define a second form and use javascript to post parameters using onclick event...maybe something like: function submitForm2() { self.document.Action2Form.variable.value=self.document.Action1Form.varia ble.value; self.document.Action2Form.submit(); } then...

reusing jsp with different action

2006-11-15 Thread Strachan, Paul
Hi, I have a JSP that submits to /actionA which forwards to tileA. I now want that JSP to alternatively submit to /actionB which forwards to tileB. Now both /actionA and /actionB execute the same action code, and return the same forward name. So in my struts-config its really easy to simply p

RE: Radio buttons and iterate

2006-11-07 Thread Strachan, Paul
If you view the html source you would notice the 'name' attribute is the same for each radio field; this field is what groups the radios together. With struts, typically you would apply indexProperties feature e.g. ... N/C Approve Deny ... And your formdef may look like Each bean in the

RE: Rolling back form changes

2006-10-30 Thread Strachan, Paul
To "clone" a DynaValidatorForm perhaps something like this will work: LazyDynaBean obj = new LazyDynaBean(); // create a lazy dyna bean BeanUtils.copyProperties(obj, dyForm); // save your form properties session.setAttribute("saved.obj", obj); ... LazyDynaBean obj = session.getAttribute("saved

RE: Form not found for locale 'en_US' warning message

2006-10-25 Thread Strachan, Paul
could it be you have validate="true" but no form validations defined ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, 24 October 2006 9:38 PM To: user@struts.apache.org Subject: Form not found for locale 'en_US' warning message Hi, I am the getting

RE: Problem with hidden String[] object

2006-10-20 Thread Strachan, Paul
To populate the string array your http request would take the structure: name=value1&name=value2&name=value3 etc where you have a java.lang.String[] name; property on your form. So there are many ways to do this in html, with Struts tags (eg populated from form) you could try: Not

RE: requiredif help?

2006-10-10 Thread Strachan, Paul
alidwhen" e.g. 1. lunch from is invalid if: (lunchFrom == null and lunchbreak != null) now turn it around... 2. lunch from is valid if: (lunchFrom != null or lunchbreak == null) Hope that helps Paul -----Original Message- From: Strachan, Paul [mailto:[EMAIL PROTECTED] Sent: Tuesd

RE: requiredif help?

2006-10-09 Thread Strachan, Paul
try using validwhen - something like: test ((lunchBreak == 'N') or (*this* != null)) test ((lunchBreak == 'N') or (*this* != null)) -Original Message- From: Mallik [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 October 2006 4:49 PM To: user@struts.a

newbie action,form,validation design problem

2006-10-04 Thread Strachan, Paul
Hi All, (Struts 1.2.4, Validator 1.1.3) I have a DispatchAction which forwards to 3 possible Jsps (populated by a single DynaForm) Next, I added validations for each of the 3 JSP pages but now each validation is different, it seems I need to clone the forms ??? But, also it doesn't

RE: Array of DynaForms

2006-10-04 Thread Strachan, Paul
Thanks -Original Message- From: Strachan, Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 October 2006 10:17 AM To: user@struts.apache.org Subject: Array of DynaForms Is it possible to define an ArrayList of DynaValidatorForm for working with indexed properties? Or can I construct a

Array of DynaForms

2006-10-04 Thread Strachan, Paul
Is it possible to define an ArrayList of DynaValidatorForm for working with indexed properties? Or can I construct a DynaForm class in my action class to add it to the Parent DynaForm array? ** This message is intended for th

RE: How to set

2006-10-04 Thread Strachan, Paul
maybe you can wrap your anchor in a Form and use the onclick event handler to set the value and submit the form by "post" method, using hidden attributes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 October 2006 4:49 PM To: user@struts.apache.or

DynaForm and Indexed properties

2006-10-04 Thread Strachan, Paul
Hi All, I'm already familiar with the basic process of using DynaForm with String properties (to capture the HTTP request params) and then copying the DynaForm values to a business object. Now I want to use indexed properties (eg multi-row edit screen). So my DynaForm looks something

RE: Form conversion problem String to Date

2006-09-27 Thread Strachan, Paul
you could write a beanutils converter and plugin for struts config e.g. Your plugin class should register converters for each type e.g. Converter converter = new SqlDateConverter(..., sqlDateFormat, sqlDateAllowNull) ConvertUtils.register(converter, java.util.Date.class); etc -

RE: sort the list

2006-09-26 Thread Strachan, Paul
You could create your own sort class which implements java.util.Comparator e.g. public class MySort implements Comparator { compare(o1, o2) { String name1 = (String) o1.getLastName(); String name2 = (String) o2.getLastName(); return name1.compareTo(name2); } } th

RE: Question about session time-out using Listener

2006-09-24 Thread Strachan, Paul
perhaps use a servlet filter to do this - you can simply map the filter to whatever urls you wish to apply rather than remembering to include some code in each and every jsp/action class etc e.g. in your doFilter(ServletRequest, ServletResponse, FilterChain) method: 1. HttpSession session = reque

RE: Indexed Properties. Maintaining Order

2006-09-21 Thread Strachan, Paul
Hi Puneet, When I re-read your original mail I notice you use DHTML to add rows, so my approach/thoughts may not be appropriate for you. I use DynaForms with ArrayLists of objects. In the form I use the logic:iterate with indexed=true on the html tags. If I need to "dynamically" add another row

RE: Indexed Properties. Maintaining Order

2006-09-21 Thread Strachan, Paul
A List is an ordered collection so it doesnt make sense that the order changes. Also, depending on which Map implementation you use ordering may not be guaranteed. I frequently use indexed properties with List and have not experienced this problem. You may need to check the generated html sou

RE: Validation on String[]

2006-09-21 Thread Strachan, Paul
in your action class: ArrayList list = new ArrayList(); Location location = new Location(); location.setLocationName("A Location"); list.add(location); dyForm.set("locations", list); I'm not sure how to validate a simple array of strings (eg

reset index properties

2006-09-20 Thread Strachan, Paul
Hi everyone, I have a multi-row edit page with linked dropdowns which I render using logic:interate (using indexed properties) The struts html tags documentation mentions about needing the reset trick for the html:select tag. I'm a bit stuck how this java code should be applied in the reset me

RE: validation

2006-09-18 Thread Strachan, Paul
I think just make sure any existing messages object is not replaced e.g. ActionMessages errors = new ActionMessages(); errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("my.error.key")); saveErrors(request, errors); ... // then later errors = form.validate(mapping, request); // retur

RE: set value to an html:hidden in jsp page

2006-09-16 Thread Strachan, Paul
the property is just a normal property defined in your form, and you can set a value... or via javascript: function submitForm(var) { self.document.yourform.command.value=var; self.document.yourform.submit(); } From: Heidy Gutiérrez Guzmán [mailto:[EM

RE: calling method of a bean from JSP

2006-09-16 Thread Strachan, Paul
you could move the logic into the view/jsp layer...something like: or maybe a custom tag library... From: Lixin Chu [mailto:[EMAIL PROTECTED] Sent: Sat 16/09/2006 1:25 PM To: Struts Users Mailing List Subject: Re: calling method of a bean fr

RE: Problems with validator framework

2006-09-13 Thread Strachan, Paul
what I would do is: 1. keep form properties as String (and consider using DynaValidatorForm) 2. use the "required,float" or "required,int" validation 3. use BeanUtils.populate method to map the form onto a typed object (property names must match) From: Heidy Guti

RE: Hi Need help .. on javascript & validation framework when used together

2006-09-12 Thread Strachan, Paul
would something like this work? function validateRadio() { if ( self.document.mystrutsform.myradio.value = "a good value" ) { return true; } else { alert('Error with radio'); return false; // should prevent submit } } Also validate on the server side if the javascript coul

RE: FW: focus on first error

2006-09-12 Thread Strachan, Paul
listElementHTML.length > 0) { var elementHTML = listElementHTML[fieldIndex]; if (elementHTML.disabled == false) { /*if (elementHTML.type == "text") elementHTML.select(); else */ elementHTML.focus(); }

RE: default error page with tiles? (repost)

2006-09-12 Thread Strachan, Paul
add something like this to your struts config... public class GlobalExceptionHandler extends ExceptionHandler { /* * Static Logger */ private static LogsLogger = LogFactory.getLog(GlobalExceptionHandler.class); public ActionForward execute(Exception e

FW: focus on first error

2006-09-11 Thread Strachan, Paul
maybe we could do something like this in the JSP - the idea is taken from the TextTag.java which knows to use the errorStyleClass when theres an error. ... <%@ page import="java.util.Iterator" %> <%@ page import="org.apache.struts.Globals" %> <%@ page import="org.apache.struts.taglib.TagUtils" %

RE: Each tiles:insert invokes ServletFilter

2006-09-11 Thread Strachan, Paul
I find all my request based filter-mapping is for *.do,index.jsp (requests) e.g. request comes in something.do (filter is invoked) struts forward to tile --> includes various *.jsp (no filter mapping so no filters invoked) Are all your filter-mappings really needed for *.jsp (responses)? -Or

Struts Flow + Continuations

2006-08-29 Thread Strachan, Paul
Hi All, I am investigating the use of continuations for a page flow wizard. Can anyone report the status of Struts Flow sandbox project? There has not been an official release since 2004 (0.5 is not yet released). Has this project stalled or been superseded by something else? Is continuations fo