(SOLVED) Indexed nested beans

2008-04-21 Thread Scott Van Wart
I was missing the getPackages() method :( - Scott Scott Van Wart wrote: Hi all, I'm trying to get multiple levels of indexed, nested beans working. I've tried a variety of solutions but I keep getting xwork or ognl exceptions. Here's what I've tried (loosely): p

Indexed nested beans

2008-04-21 Thread Scott Van Wart
Hi all, I'm trying to get multiple levels of indexed, nested beans working. I've tried a variety of solutions but I keep getting xwork or ognl exceptions. Here's what I've tried (loosely): public class MyAction implements Action, StrutsStatics { private List packages; public Li

Re: Oracle AS jsp:setProperty problem, Struts alternative?

2006-09-20 Thread Scott Van Wart
Chris Pratt wrote: That's basically what the Struts bean: taglib and JSTL c: (core) taglib's are for. Give them a look. (*Chris*) c:set looks like it will work. I figured bean:... would have all I need, but IIRC some tags were deprecated because of some of the jsp:XXX tags. Thanks, Scott

Oracle AS jsp:setProperty problem, Struts alternative?

2006-09-20 Thread Scott Van Wart
Is there a Struts (1.3.5) alternative to the tag? works fine when it's close to the tag, but when it's farther down the page, Oracle's JSP translator might put the setProperty translation in a separate method than the bean declaration in the output .java file. Kind of like this (simplified

Re: Out of topic, Oracle SEQUENCE

2006-09-15 Thread Scott Van Wart
In PL/SQL: DECLARE new_user_id NUMBER; BEGIN INSERT INTO users ( user_id, user_name ) VALUES ( user_seq.NEXTVAL, 'userName' ) RETURNING user_id INTO new_user_id; END; So, similarly (though a little bit of a hack), in JDBC (since generatedKeys() or whatever they call it isn't supporte

Re: empty fields of an input form get default value after submitting

2006-09-14 Thread Scott Van Wart
Laurie Harper wrote: Sandra Reichert wrote: Hi, I have an input form in jsp. After submitting empty fields (user entered nothing in input field) are set by default with specific values depending on their data typ. So an empty Integer field is set to 0, an String field to "" an so on. But i wan

Re: "name" Attribute in tag

2006-09-06 Thread Scott Van Wart
Ashish Vijaywargiya wrote: Hi, Anybody of you know the specific reason of "Why the "name" attribute is not provided in the tag???". Thanks in advance. Regards Ashish Vijaywargiya Struts uses the "name" attribute to repopulate your form on submit. So if you have an action /someAction m

1.3.5 - Exception handler ignoring 'bundle' attribute?

2006-09-01 Thread Scott Van Wart
I can't get the exception handler in struts-config.xml to use the 'bundle' attribute: It always tries to look in the default (MessageResources.properties). Is this a known issue or am I doing something bad? - Scott --

Extending tag libraries

2006-08-30 Thread Scott Van Wart
This is a little OT, but it, uh, kind of has to do with Struts :). I'm interested in adding a few attributes to some of the struts tags. They're really only useful in the context of a specific web project I'm working on, so I'd really prefer not to edit the Struts TLD and implementation (for

Re: HttpSession facade

2006-08-29 Thread Scott Van Wart
Madhav Bhargava wrote: I was going thru the struts source code and was in particular reading the way they have implemented the synchronizer token pattern for preventing multiple submits on transacional pages. I saw that they have synchronized on session ID attribute. Is it possible that multiple

Re: Creating new Session without invalidating the old one

2006-08-29 Thread Scott Van Wart
[EMAIL PROTECTED] wrote: Hello! Is it possible to create a new session for an already logged in person (which has an actual session) without invalidating the existing session? It's necessary for me to have the old session before creating an additional one, because I have to get few datas from th

Re: [OT] migrate Struts app from jdk 1.4 to jdk1.5

2006-08-26 Thread Scott Van Wart
Thibaut wrote: I migrate a Struts app from jdk 1.4 to jdk1.5 I have warnings I would like to solve : 1) the clone() function I have a "Type Safety" exeption with this kind of code : current.setUserRights((TreeSet) this.userRights.clone()); 2) Cast make a warning : TreeSet mySet = (TreeSet) req

Re: SELECT ... FOR UPDATE

2006-08-25 Thread Scott Van Wart
Konrad Billewicz wrote: I know that my problem hasn't do much with JBoss but I decided to post it here. If you know more suitable place, show me it please. I have a Session EJB deployed on JBoss. I'm using JDBCTemplate (from Spring framework) to connect with Oracle 9i database (defined as dat

Re: [JAVA]How to get datatbase connection from lookup to datatsource name in a standalone java application

2006-08-25 Thread Scott Van Wart
Jimmy Emmanual wrote: 1. Bind datasource to a file system context try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); env.put(Context.PROVIDER_URL, "file:/C:/temp/jndi"); Problem with that is, if

Re: [1.3] Session ActionMessages won't go away

2006-08-25 Thread Scott Van Wart
Niall Pemberton wrote: Dam, looks like I missed updating the tiles version of the chain-config.xml - the version in struts-core-1.3.5.jar has that command. Could you file a JIRA issue for this please: https://issues.apache.org/struts/browse/STR Okie, https://issues.apache.org/struts/browse/STR

Re: Tiles & JSP question

2006-08-25 Thread Scott Van Wart
Adam Gordon wrote: Duh I was thinking to myself how rude a reply this was... then I noticed the sender was the same. Nicely done :). - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: [1.3] Session ActionMessages won't go away

2006-08-25 Thread Scott Van Wart
Niall Pemberton wrote: The functionality to automtaically remove messages cached in the session was missing from Struts 1.3.x and only added recently in the Struts 1.3.5 version: http://issues.apache.org/struts/browse/STR-2883 http://svn.apache.org/viewvc?view=rev&revision=412834 Are you

Re: [OT] request.getServletPath() val not same in Filter & Servlet

2006-08-24 Thread Scott Van Wart
pantichd wrote: Hello, Sorry for posting this in Struts mailing list but I can't seem to get an answer on any other discussion groups. I've always had great results getting good answers here so here goes... I have a Filter in my app that uses the request.getServletPath() method to get the name

[1.3] Session ActionMessages won't go away

2006-08-24 Thread Scott Van Wart
Hi, I have something very close to the following in each of my pages (actually, just in the layout page for tiles, but whatever). Worked fine in Struts 1.2.9 (even though I'm not so sure it's the best way to print messages and errors, but oh well...)

Re: [JAVA]How to get datatbase connection from lookup to datatsource name in a standalone java application

2006-08-24 Thread Scott Van Wart
Caroline Jen wrote: Context ctx = new InitialContect(); DataSource ds = (DataSource)ctx.lookup("java:com/env/jdbc/DBName"); Connection con = ds.getConnection(); Right, but that's assuming it's already bound, which is the hard part, and unless he's running it under OC4J, no such luck... - Sc

Re: [JAVA]How to get datatbase connection from lookup to datatsource name in a standalone java application

2006-08-24 Thread Scott Van Wart
temp temp wrote: My java standalone application wants connection to database with lookup to datasource name which is configured in the oc4j app server. Please guide me with some ideas to achieve this. You need to bind it yourself, to some provider. I use the DBCP provided with Tomcat (nam

[SOLVED] Re: Auto render form bean as hidden fields

2006-08-23 Thread Scott Van Wart
In case anyone's curious, here's the synopsis of my solution: - Manually annotate (Java 1.5) the private fields I want to "track". - Have a base class that stores the original state (when a record is first loaded from the database, for editing, for example). - Write a class that walks through th

Re: Can we specify variables in html form tags action attribute

2006-08-23 Thread Scott Van Wart
Chetan Pandey wrote: pageContext.setAttribute(propertyaction,"propertyaction");%> pageContext.setAttribute() is a standard map-based pattern. All of these use (key, value) and not (value, key) as you have above. Swap the two arguments. Remember your scope (third parameter). - Scott ---

Re: TagExtraInfo ,getVariableInfo

2006-08-23 Thread Scott Van Wart
Raghuveer wrote: WHy exactly TagExtraInfo to be implemented. What makes difference it this is used and not used in in TLD file Example: MessagesTei extends TagExtraInfo { TagExtraInfo { public IterationTEI() { super(); } public VariableInfo[] getVariableInfo(TagData data) {

Re: Form Validation

2006-08-23 Thread Scott Van Wart
Chetan Pandey wrote: Is their a way to specify multiple inputs. Nope. A wise man once told me that validate="true" is there only for convenience. So the workaround is to do something like 'validate="false"', omit the input= tag, and add forwards like, public void create( ActionM

Re: When my JSP calls the action class SErvlet Exception is thrown.

2006-08-23 Thread Scott Van Wart
sheetal wrote: _Does anybody has any idea why is it so...(Why is the servlet exceotion thrown) Couple of things to check: - In struts-config.xml, make sure your package names and class names of your and tags are all spelled correctly, including case. - Do the same for your ActionForm and

Re: about overriding the excute method

2006-08-23 Thread Scott Van Wart
Gomathi wrote: hai, what will happen when the execute () of action class is overrided by the subclass called dispatch action?. Regards gomes If you mean extending DispatchAction, your execute() method will get called. Unless you have a call to super.execute() (which then calls DispatchA

Creating a DynaBean from an ActionForm on the fly

2006-08-23 Thread Scott Van Wart
Is it possible to get a DynaBean object from an ActionForm programmatically? I need to create a copy of a form, but cloneBean isn't working. I have a map-based nested bean (which lets me do stuff like 'myform.child(ABC).name), but cloneBean does a SHALLOW (argh!) copy of the map so the origin

Re: Question about Lookup dispatch action

2006-08-23 Thread Scott Van Wart
mosho wrote: Hi Scott, I added a unspecified() method in my action class and it works now. I am not able to understand though how it is working, unspecified() is called when parameter name doesn;t exist, right? I have a parameter name= navigation and its value is shown as {submitText}. But it c

Re: Question about Lookup dispatch action

2006-08-23 Thread Scott Van Wart
mosho wrote: Yes, that's exactly the way it works. My navigation with lookupDispatchAction works perfectly. The problem arises when I have another to link instead of button to submit the form, how do I pass navigation parameter value then? The javascript with hidden field doesn't solve the proble

Re: Question about Lookup dispatch action

2006-08-22 Thread Scott Van Wart
mosho wrote: Request[/planName] does not contain handler parameter named navigation In your struts-config.xml, are you including 'parameter="navigation"' in your action mapping? A la: name="planNameForm" parameter="navigation"> ... The parameter gives you a place to pass additio

Re: Question about Lookup dispatch action

2006-08-19 Thread Scott Van Wart
Puneet Lakhina wrote: OK One more thing, if you need to call this javascript method even from ur submit button, to set the property value then you can do /> Notice the return false there. In case of a link simply do I hope this was what you wanted. The "return false;" would have to g

Re: Question about Lookup dispatch action

2006-08-18 Thread Scott Van Wart
mosho wrote: Hi Scott, It doesn't seem to work. My submit buttons look like this:     Now, if I have a link, how can I set the property navigation for it. " onClickSubmit() pic.gif " Well first you should probably get rid of 'value="Previous"', since you should be (an

Re: Ready-made function somewhere to escape HTML?

2006-08-17 Thread Scott Van Wart
Frank W. Zammetti wrote: Hi Scott... have a look at the ResponseHelpers class in Java Web Parts: http://javawebparts.sourceforge.net More precisely: http://javawebparts.sourceforge.net/javadocs/index.html The encodeEntities() method should do the trick. Ahh... that class name you mentioned

Re: Question about Lookup dispatch action

2006-08-17 Thread Scott Van Wart
Christopher Goldman wrote: On Thu, 2006-08-17 at 14:26 -0700, mosho wrote: Hi All, I have multiple buttons on my form and I am using LookUpDistpatchAction to submit the form depending on which button is clicked. I have another requirement now, I have multiple images that are going to be lin

Re: Auto render form bean as hidden fields

2006-08-17 Thread Scott Van Wart
Laurie Harper wrote: Scott Van Wart wrote: We have a requirement that the user be prompted if any changes have been made on a form, and they try to navigate away. I've divided this up Firstly, is the requirement to detect changes to the form compared to how it was last rendered, or com

Ready-made function somewhere to escape HTML?

2006-08-17 Thread Scott Van Wart
Hello, I have user-entered input managed by a few custom tags (Java classes, not tag files), and I need to encode this stuff to escape any special HTML characters the user might type. Is there a special one in Struts I can/should use, or should I write my own? (Struts 1.2.9, Tomcat 5.5.17)

Re: What's the difference between struts-base and struts-el?

2006-08-16 Thread Scott Van Wart
Michael Cheung wrote: Hi, all; What's the difference between struts-base to struts-el. My general understanding is: - struts-el is so you can use EL expressions in your Struts tags without having to use servlet 2.4. The JSP compiler won't compile the EL, so it's up to Struts to do it. Us

Re: Forwards between webapps

2006-08-16 Thread Scott Van Wart
Saeed, Rada wrote: Forwards between webapps are not supported, cuz both have different contexts, this's what I got from running this : Is there any other way to achieve this forward between different web applications ? I think the class 'org.apache.struts.actions.SwitchAction' might do the t

Re: Validator Client-Side and Custom Classes

2006-08-16 Thread Scott Van Wart
Mississippi John Hurt wrote: Hi, I want to do client-side validation using a custom class I can specify in the validator.xml section. But my question is if I use a custom class, then how the heck can Struts generate the custom javascript for it in the jsp if I'm using a custom java class I wr

Auto render form bean as hidden fields

2006-08-16 Thread Scott Van Wart
We have a requirement that the user be prompted if any changes have been made on a form, and they try to navigate away. I've divided this up into sub tasks: - Iterating through properties of a bean. - Render properties as hidden fields. - Render some JavaScript to check for modifications. The

Re: LookupDispatchAction using wrong resource bundle!

2006-08-16 Thread Scott Van Wart
LookupDispatchAction checks ALL the resource bundles (and doesn't even stop when it finds the key). Does anyone see any reason why it can't use the same mechanism as everything else, or has this been fixed in a later version? - Scott --

Re: I can't put 'maxlength' validator values in my .properties file?

2006-08-16 Thread Scott Van Wart
David Friedman wrote: Right, but the invoked Resources.getActionMessage() has calls inside it for the bundle in the current trunk: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apa che/struts/validator/Resources.java?view=markup It looks like it hasn't changed from the

Re: I can't put 'maxlength' validator values in my .properties file?

2006-08-16 Thread Scott Van Wart
David Friedman wrote: Right, but the invoked Resources.getActionMessage() has calls inside it for the bundle in the current trunk: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apa che/struts/validator/Resources.java?view=markup It looks like it hasn't changed from the

Re: I can't put 'maxlength' validator values in my .properties file?

2006-08-16 Thread Scott Van Wart
David Friedman wrote: I think you need to have at least Struts v1.2.8 unless you manually upgraded the Commons Validator jar up to version 1.2.0. If I understand correctly, validator versions before 1.2.0 (Struts < 1.2.8) don't actually make use of the "bundle" attribute in your validator xml fi

Re: I can't put 'maxlength' validator values in my .properties file?

2006-08-16 Thread Scott Van Wart
David Friedman wrote: I think you need to have at least Struts v1.2.8 unless you manually upgraded the Commons Validator jar up to version 1.2.0. If I understand correctly, validator versions before 1.2.0 (Struts < 1.2.8) don't actually make use of the "bundle" attribute in your validator xml fi

Re: [OT]Scriptlets

2006-08-16 Thread Scott Van Wart
Rahul Akolkar wrote: Yes, for reasons such as avoiding a heterogeneous programming model, improving readability etc. It also lets you trick your web design team into doing some coding through tag libraries without actually forcing them to write classic code :). j/k -

I can't put 'maxlength' validator values in my .properties file?

2006-08-16 Thread Scott Van Wart
I tried the following: Now I figured that this would cause the maxlength validator to get the value for maxlength from message resources, rather than hardcoding it with var, var-name and var-value tags. But it doesn't! It only uses this to pass to the {0} in the error message (i

LookupDispatchAction using wrong resource bundle!

2006-08-16 Thread Scott Van Wart
I have multiple resource bundles in addition to the default one in struts-config.xml: key="constraints" factory="ca.indosoft.common.resource.ConstraintResourcesFactory" null="true" /> In my Action: protected void create( ... ) { ... } // and so on... protected Map getKeyMetho

[SOLVED?] Re: Map-based nested bean--No bean specified?

2006-08-14 Thread Scott Van Wart
oticed the typo (was creating a new child, putting it into the map, but then STILL returning null. Note that setChild( String id, ChildPerson child ) never gets called by the framework. So my final question: Is all this a good idea? :) - Scott Scott Van Wart wrote: I posted on this before, so

Map-based nested bean--No bean specified?

2006-08-14 Thread Scott Van Wart
I posted on this before, so I thought I'd post a more concrete example this time. I'm using a map-based nested bean, and I'm getting the following error: java.lang.IllegalArgumentException: No bean specified org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyU

Map-based nested bean

2006-08-09 Thread Scott Van Wart
(Struts 1.2.9, Tomcat 5.5.17) I have something similar to the following in my ActionForm: public class MyForm extends ActionForm { public static class NestedBean { private String name; private String value; // String getName(), String getValue(), void

Determine whether or not a string is a Tiles definition

2006-08-03 Thread Scott Van Wart
Is there a method anywhere I can use to quickly determine whether or not a given String is a tiles definition? - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Accepting multiple date masks with the "date" validator

2006-08-03 Thread Scott Van Wart
Adam Gordon wrote: Heh. Regular Expressions aren't for everyone - I happen to work w/ two engineers who live and die by them. In your bean setter for the date, I'd make sure no exceptions could be thrown, or handle them - the code I took over from an engineer we had that left had this issue

Thread-safe MessageResources[Factory]

2006-08-03 Thread Scott Van Wart
I'm implementing my own MessageResources and MessageResourcesFactory-derived classes. Do these need to be thread-safe, specifically, the 'String MessageResources.getMessage( Locale locale, String key )'? Thanks, Scott - To

Re: Accepting multiple date masks with the "date" validator

2006-08-03 Thread Scott Van Wart
Adam Gordon wrote: IIOC, the only way you can do this with the stock validator is to use "mask" rather than "date" as the validator. Then, you can use a regex to dictate your mask. I'll warn you though, if you use a regular expression it's going to be VERY long because it will also need to vali

Accepting multiple date masks with the "date" validator

2006-08-02 Thread Scott Van Wart
I have a requirement in my project that I be able to accept two different date masks. One with slashes (thus, 10 characters) and one without (8 digits). Is there any way to do this with the stock date validator, or do I need to roll my own wrapper? Thanks, Scott ---

[FRIDAY][OT] Joke - Job descriptions

2006-07-28 Thread Scott Van Wart
I wouldn't have thought to submit this but for the programmer reference :). --- 1. A banker is a fellow who lends you his umbrella when the sun is shining and wants it back the minute it begins to rain. 2. An economist is an expert who will know tomorrow why the things

Re: (Struts validation) Different message resource keys rather than placeholders

2006-07-26 Thread Scott Van Wart
Givler, Eric wrote: But can't you just define a message specific to the field and validator for each definition in the validations.xml file? min0 max50 Yes, yes I can... good old struts documentation. :) I fi

(Struts validation) Different message resource keys rather than placeholders

2006-07-25 Thread Scott Van Wart
The validator, by default uses stuff like this: errors.required={0} is required. I'd like to be able to use entirely different message keys depending on the field, rather than always using errors.required. The solution for the "required" validator was to simply use a passthrough key like this

Re: Problem with map-based property in ActionForm

2006-07-21 Thread Scott Van Wart
--Original Message----- From: Scott Van Wart [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 2:54 PM To: Struts Users Mailing List Subject: Problem with map-based property in ActionForm I have an action form defined like this: public MyForm extends ActionForm { private Map values = n

Re: Problem with map-based property in ActionForm

2006-07-21 Thread Scott Van Wart
2.9/faqs/indexedprops.html I think it remains for you to provide a method a la: public Object getKey(String key) { return values.get(key); } Regards, M -Original Message- From: Scott Van Wart [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 2:54 PM To: Struts Users Mailing List

Problem with map-based property in ActionForm

2006-07-21 Thread Scott Van Wart
I have an action form defined like this: public MyForm extends ActionForm { private Map values = new TreeMap(); public Map getValues() { return this.values; } public Set getKeys() { return this.values.keySet(); } } and in my JSP, value="first">First value="second">Second When I acce

Re: Converting an object to integer

2006-07-21 Thread Scott Van Wart
. } for those "just in case" situations. If it's an attribute of the request, you need to first cast it to a String, if that's the way it was stored: Integer someInt = new Integer( (String)request.getAttribute( "attr" ) ); - Scott Scott Van Wart <[EMAIL

Re: Converting an object to integer

2006-07-21 Thread Scott Van Wart
temp temp wrote: What is the best way to convert an object to an Integer .If casting dosen't work? Object probablyAnInteger = ; Integer someInt; if ( probablyAnInteger == null || probablyAnInteger.equals( "" ) ) { someInt = null; } else { try { someInt = new Integer( probablyAnI

[OT] Apologies for double post

2006-07-21 Thread Scott Van Wart
I've been having trouble posting to the list. It apparently works now :). Sorry folks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Passing two fields to a custom validator

2006-07-21 Thread Scott Van Wart
I have a custom validation routine (class mapped through validator-rules.xml). I'd like to be able to pass two fields to my routine rather than just one. Is there any way of doing this? - Scott - To unsubscribe, e-mail: [EMAI

Re: Quick Struts/Validator version question

2006-06-29 Thread Scott Van Wart
David Friedman wrote: And now for the simple and exact way: check the jar's META-INF/MANIFEST.MF file. I have 1.2.9 and the commons-validator.jar has a META-INF/MANIFEST.MF file with this in it: I've found that this isn't always reliable -- commons-beanutils.jar in struts 1.2.9, for example,

Re: html:password not listening to value attribute

2006-06-22 Thread Scott Van Wart
Niall Pemberton wrote: Its a DynaBean - just use set("password", "") Yeah but I'd rather not do it in Java, for various reasons... - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

html:password not listening to value attribute

2006-06-22 Thread Scott Van Wart
Hi, I have a LazyValidatorForm with a "password" property. I always want this input field to be blank when the page loads. I also can't clear the value out of the form in Java (code is too generic and I'd rather not hack it for this single case). So I tried: But the password shows up in

Re: Accessing LazyValidatorForm properties with EL

2006-06-22 Thread Scott Van Wart
Niall Pemberton wrote: You can get a reference to the Map underlying the LazyValidatorForm ${myForm.map.myProperty} Excellent, thanks! - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: validating checkbox

2006-06-22 Thread Scott Van Wart
The Jasper wrote: hi, I think I shoul've looked more closely at your question. There are 2 problems I see. One is you want to make sure at least one checkbox is checked. This could be done with validwhen. The other is that checkbox values are only sent if checked, otherwise they are null. I don'

Accessing LazyValidatorForm properties with EL

2006-06-22 Thread Scott Van Wart
I have a class MyForm extends LazyValidatorForm, mapped with name myForm to myAction: ${myForm.myProperty} The EL fails with a complaint about accessing myProperty of bean myForm (since there's no getMyProperty() accessor). How can I access properties with EL? I have value="${myFor

Re: Why My JSTL Tag Cannot Do What Struts Tag Does?

2006-06-21 Thread Scott Van Wart
. <% User user = (User)pageContext.getAttribute( "user" ); %> I don't use this method at all (I prefer jsp:useBean), but maybe the "user" in getAttribute() should be capitalized as "User"? - Scott - To u

Re: Struts Design question

2006-06-21 Thread Scott Van Wart
Monkeyden wrote: If your implementation is similar to what Scott has mentioned (i.e. different operations on the same type of object), then I consider this a classic example of a DispatchAction, where type of business entity doesn't change...just the selected operation on the business entity, th

Re: Struts Design question

2006-06-21 Thread Scott Van Wart
Kavita Mehta wrote: Hi, I have a form which has 3 submit buttons . which is a gud ides ... 1) having seperate 3 action classes for each 2) having a single action class which manages the submit action based on the button which has called this action class. It's up to you ;). I typically divide

Re: how to catch unchecked checkbox values

2006-06-21 Thread Scott Van Wart
Kavita Mehta wrote: i am trying to recieve the status of all checkboxes in my JSP file using form bean . I am using tag in my JSP . Can anybdy suggest me how to get the status of all checkboxes . presently, the form bean just returns me the selected checkbox's value array .. That's how checkbo

Re: Variable parameters in tiles

2006-06-21 Thread Scott Van Wart
Antonio Petrelli wrote: Anyway I don't think it is a good way of doing this kind of things. I'd write two definitions (one for create and one for edit) sharing the same layout page The original method you proposed (two different puts in the same definition) wouldn't work, as it's layout.jsp tha

Variable parameters in tiles

2006-06-20 Thread Scott Van Wart
Hello, I have a tiles-defs.xml similar to the following (layout page with banner on top, content on bottom): So let's say my layout.jsp looks something like this: It's not quite enough to do what I want to do. I have a

Re: BeanUtils, Form Bean and POJO Bean

2006-06-17 Thread Scott Van Wart
Caroline Jen wrote: The Java "types" of the properties in my form bean sometimes are not the same as those of the data fields in my database. The request.getParameter(); always return a String. I can use the copyProperties() method of the BeanUtils to convert all the String(s) read from the web

Re: JSP does not display error message from validate()

2006-06-17 Thread Scott Van Wart
[EMAIL PROTECTED] wrote: I am trying to display error message in JSp page using the following: The code in my validate method is: errors.add("invalidDate", new ActionMessage( endDate + " must be greater than " + startDate )); return errors; Any clue whats wrong? Couple things: 1) Try usin

Re: passing parameters to tiles include files

2006-06-17 Thread Scott Van Wart
Don Vawter wrote: I am setting the attribute in the Action class Check to make sure you don't have redirect="true" set for the action mapping. Otherwise, everything request-related is lost. - Scott - To unsubscribe, e-mail:

Re: Defining dyna forms on the fly

2006-06-16 Thread Scott Van Wart
Wendy Smoak wrote: Let us know how the multiboxes work with lazy forms -- I had trouble with lists in regular DynaValidatorForms until I switched to using Commons Collections 'GrowthList' instead of String[] or ArrayList. Hi Wendy, The multibox thing seems to be a little tricky... I looked thro

Re: Defining dyna forms on the fly

2006-06-16 Thread Scott Van Wart
Wendy Smoak wrote: Let us know how the multiboxes work with lazy forms -- I had trouble with lists in regular DynaValidatorForms until I switched to using Commons Collections 'GrowthList' instead of String[] or ArrayList. Yeah I honestly don't understand why multiboxes don't work. The request h

Re: Defining dyna forms on the fly

2006-06-16 Thread Scott Van Wart
Wendy Smoak wrote: Let us know how the multiboxes work with lazy forms -- I had trouble with lists in regular DynaValidatorForms until I switched to using Commons Collections 'GrowthList' instead of String[] or ArrayList. I figured everything would work the same, but now that you mention it, it

Re: struts version of session.getAttribute() ?

2006-06-16 Thread Scott Van Wart
Brian Long wrote: Hi folks - newbie here with a quick question: I'm converting JSPs to struts, and they have a lot of stuff that looks like this: Service managedService = (Service) session.getAttribute("managedService"); . . . <% if (group.getExpirationDate() != null) { %> . . . What's

Re: Defining dyna forms on the fly

2006-06-16 Thread Scott Van Wart
Wendy Smoak wrote: On 6/16/06, Scott Van Wart <[EMAIL PROTECTED]> wrote: I'd like to define the structure of a DynaValidatorForm on the fly instead of through struts-config.xml. I had a look at FormBeanConfig and DynaActionFormClass (which says "Application developers never

Defining dyna forms on the fly

2006-06-16 Thread Scott Van Wart
I'd like to define the structure of a DynaValidatorForm on the fly instead of through struts-config.xml. I had a look at FormBeanConfig and DynaActionFormClass (which says "Application developers never need to consult this documentation" :), but I'm not sure where to start. I'd like to do som

Re: How to skip validation?

2006-06-15 Thread Scott Van Wart
Dave Newton wrote: Scott Van Wart wrote: The only problem there is you can't rely on the "input" attribute of the action to return to the form and would have to use an action forward instead Why's that? I've been using mapping.getInputForward (or whatever th

Re: Help on Validation

2006-06-15 Thread Scott Van Wart
Vishal Seth wrote: Yep I agree. But writing plugins would not help as plugin would be loaded during the application load time. Can there be some thing which can be looked at or any ideas on what could be the better way to implement this sort of condition? Thanks for your help. Can you give

Re: How to skip validation?

2006-06-15 Thread Scott Van Wart
Jennifer Jacobs wrote: Hello, I have a number of Struts forms that are using the Validator. This works great except for on a couple of the forms. The ones in question have two submit buttons on them. One updates the form somehow - calculates a subtotal, or adds an attachment to a list of att

Re: accessing form in jsp : urgent

2006-06-15 Thread Scott Van Wart
Abhimanyu Koul wrote: hi all! is there a way where we can access an attribute of actionform (in request scope) inside a jsp. actually, i want to do some operations in jsp based on the value of a variable of the actionform. Regards, Abhimanyu Koul FinEng Solutions (P) Ltd. Mobile : +91 9819510

Re: Help on Validation

2006-06-15 Thread Scott Van Wart
Vishal Seth wrote: I got the first point mentioned where I would need to override the validationKey method and not the second one. Problem here is it is not only required during login time but throughout the application there can be different validations for each form or some of the forms. Hen

Re: Help on Validation

2006-06-15 Thread Scott Van Wart
Vishal Seth wrote: Hi, Can I do validation for same form on basis of some session key. Currently all the validations are stored in application scope. I want depending upon user logged the validation fired should be different on same form. I would be having different validation files for

Advanced MessageProperties file

2006-06-14 Thread Scott Van Wart
I'm working on a slightly more flexible way of getting messages out of the .properties file, and am posting this to the list for a few reasons: 1) To make sure it hasn't already been done 2) To see if it's useful to anyone else 3) If this is the right approach to whatever it is I seem to think I

Re: accssing object in JSP

2006-06-14 Thread Scott Van Wart
Frank W. Zammetti wrote: One option might be a static HashTable in some class... key the table by some calculated ID representing the request.. for that, see the RequestHelpers.generateGUID() method in Java Web Parts: Scott Van Wart wrote: Sonu S wrote: I can not store bean in request or

Re: Pass dates between two windows

2006-06-14 Thread Scott Van Wart
José María Tristán wrote: Again, very thanks I think that the second option es better that our needs. When the uses press teh button "search" a pop-up it's open. This pop-up contains the list whith the employers and a "close" button. The fist windows is always visible and it's possible to intera

Re: Default value for text field

2006-06-14 Thread Scott Van Wart
Pankaj Gupta wrote: Please tell me in Struts context. What do I need to write in my html:text tag? " type="text"> Not sure how well that works... if you're using a JSP 2.4-compliant container and the JSTL (which you would need to above to use fmt:), you could use this: <%@ taglib

Re: accssing object in JSP

2006-06-14 Thread Scott Van Wart
Sonu S wrote: I can not store bean in request or session or any scope (design issues...) If you can't store the bean in any scope, then you really have no way of getting anything from the action to the jsp... I see no solution to your problem with this constraint. - Scott --

Customizing message translation

2006-06-14 Thread Scott Van Wart
I'd like to expand the message translation with a few things. I was wondering where I should look for plugging in my own processing of keys->message text. Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

  1   2   >