select multiple woes

2005-01-19 Thread Will Stranathan
I promise I google'd first I'm trying to use a multiple-select select box, for example: One Two Three Four And I've tried backing my form bean with String[] AND with an ArrayList. When I try to use a String[] as the backing, the form displays, but when I submit, I get an argument type mism

Re: Action Returning to previous page

2005-01-19 Thread Will Stranathan
Not positive I completely understand the question, so I'll make a very vague response. You can: 1) Use the input attribute of an Action to specify the page that fed it - if the validate() method on the ActionForm() returns a non-empty ActionErrors, the user will go back there. 2) Specify a for

Re: Struts token doesn't work problem

2005-01-20 Thread Will Stranathan
You have to do a couple of things: 1) While preparing the form, call generateToken(request); 2) Make sure you use the html:form tag - otherwise the token won't get put on the page. 3) When the user submits, do two things 3a) Check isTokenValid(request) - if it is, contiue, if not, warn the user.

Re: select multiple woes

2005-01-20 Thread Will Stranathan
ltiple="multiple" in the On Wed, 19 Jan 2005 20:54:05 -0600, Will Stranathan <[EMAIL PROTECTED]> wrote: I promise I google'd first I'm trying to use a multiple-select select box, for example: One Two Three Four And I've tried backing my form bean with String[] AND w

Re: Action Returning to previous page

2005-01-20 Thread Will Stranathan
On Wed, 19 Jan 2005 22:16:34 -0800 Dakota Jack <[EMAIL PROTECTED]> wrote: > 2) Specify a for the Action that sends the user back to > from whence they came. I don't think I can do this because they may come from a number of pages. You can specify a dynamic ActionForward return in your Actio

Re: Problem with html:radio when disabled is true

2005-01-20 Thread Will Stranathan
Browsers (AFAIK) don't send a request parameter with disabled radio buttons. You'll have to do some additional checking in the reset() method of your bean to set those to the proper values. w On Thu, 20 Jan 2005 02:02:34 -0400 Néstor Boscán <[EMAIL PROTECTED]> wrote: Hi I'm working with struts

Re: Session Strategy

2005-01-20 Thread Will Stranathan
Nope - Andrew is right - JSP's are only part of the configuation and support files in a well-written MVC webapp - it's only TEMPLATE text. Just like if you send a canned email, I'm sure you keep your email templates under WEB-INF, right? Well, JSP's are just out.println() template. w On Thu,

Re: Action Returning to previous page

2005-01-20 Thread Will Stranathan
Hello again, I've found this interesting and seemingly useful piece of information in a struts book I recently obtained. Dynamic Forwards ActionForward forward = new ActionForward("/do/itemEdit?action=edit"); Then it goes on to tell me to use the runtime parameter techniques in the previous s

Re: Struts token doesn't work problem

2005-01-21 Thread Will Stranathan
Just include a hidden element with the token name and value. Like: You'll have to look in the session to get the token value. I *think* the session key this is under is org.apache.struts.action.TOKEN (looking at the javadoc for that). w On Fri, 21 Jan 2005 09:21:44 +0800 Anthony Hong <[EMAI

Re: commons-logging

2005-01-21 Thread Will Stranathan
You have to configure the underlying logging package - such as Log4j if you're using that or Java 1.4 logging if you're using that. w On Fri, 21 Jan 2005 16:02:39 -0500 Alex Kravets <[EMAIL PROTECTED]> wrote: Couple of question about logging in Struts. I included commons-logging.jar in my classp

Re: Struts Web Service project on SF.net

2005-01-22 Thread Will Stranathan
Not to show how terribly behind the times I am, but isn't that precisely one of the things Axis does? You pop a war file into your container, add your existing business code, and voila, standard java methods are exposed as web services? Not saying your plans won't cure cancer, but are you rein

Select Multiple issues

2005-01-22 Thread Will Stranathan
Does anybody have a good example of an ActionForm/ combo that works? I've been banging my head against a wall for a week now trying to figure out what the issue is. With tracing turned on, the Struts RequestProcessor IS receiving a String[], but when BeanUtils attempts to call the setters in m

Select Multiple Issues

2005-01-24 Thread Will Stranathan
I had posted earlier concerning this, and haven't gotten any response, but I think it got lost in all the spirited discussions about constants interfaces, leadership voting, etc. over the past week. I've done a lot of searching, and AFAICT, I'm trying all the right things, but it's still not wo

Re: Select Multiple Issues

2005-01-24 Thread Will Stranathan
THANKS! After all that work, I *think* BeanUtils was having issues with setNumber(int, String) for some reason - when I took out the setters for indexed values, and just have setters/getters for the arrays - it works like a champ! Thanks a TON! Will Stranathan On Mon, 24 Jan 2005 15:16:55

Re: Select Multiple Issues

2005-01-24 Thread Will Stranathan
Well, I understand the way HTTP is working there, it just SEEMS to be that having the additional method (setBar(int, String)) confused BeanUtils or something - because removing those methods (making no other changes) cleared the problem up. w On Mon, 24 Jan 2005 17:15:01 -0500 Jeff Beal <[EMAI

Re: OT - Evaulating JSP as internal template?

2005-01-25 Thread Will Stranathan
Fantastic! That's exactly what I was looking for! And since I've got so much stuff in the form bean, I can just access the stuff directly from the form bean. (I know it's not the RIGHT way to do it, but with as many attributes as there are to this, it'd be nice to not have to rewrite existin

Re: struts and java script and jsp

2005-01-25 Thread Will Stranathan
That code is being put in because you set the focus attribute of the html:form tag, but there is no attribute called username. w On Tue, 25 Jan 2005 11:20:36 -0500 "Nadia Kunkov" <[EMAIL PROTECTED]> wrote: Hi, I'm not sure if this question is really about struts even though it occures in my str

Re: OT - Evaulating JSP as internal template?

2005-01-25 Thread Will Stranathan
Which was one thing I had already done - didn't use comments, but did all my up-front work in one line. w On Tue, 25 Jan 2005 11:32:41 -0500 Kris Schneider <[EMAIL PROTECTED]> wrote: For the paranoid, you probably want to be sure that the email template ("EmailTestTemplate.jsp") doesn't actuall

Re: redirectig to WORD files

2005-01-26 Thread Will Stranathan
Could you show us the relevant parts of your config? And anything in the logs? What I typically do is rather than redirect, make a DownloadAction and put any downloadables under /WEB-INF (or in a database or somewhere) so that the user can't type in a URL to do directly do it. Then, just mak

Re: Flow Control, Is there a good way?

2005-01-26 Thread Will Stranathan
While the token is ALSO used for double submit protection, it also validates that the user got to your form the right way. i.e., if they don't go to page A and submit, their token won't be valid. w On Wed, 26 Jan 2005 10:28:49 -0500 "ckl" <[EMAIL PROTECTED]> wrote: I have read two books (Strut

Re: OT - Evaulating JSP as internal template?

2005-01-26 Thread Will Stranathan
In the JSP that you .include - - creates a string called emailStuff, whose content is everything that gets evaluated inside the tag. Personally, I REALLY like the HttpServletResponseWrapper approach better - MUCH more elegant, and looks like less of a hack. w On Wed, 26 Jan 2005 11:23:49 -05

Re: Flow Control, Is there a good way?

2005-01-26 Thread Will Stranathan
Yes - there is that possibility. w On Wed, 26 Jan 2005 11:58:23 -0500 "ckl" <[EMAIL PROTECTED]> wrote: Interesting ... Does the following use case break this? If a malicious user goes to page A and submits, gets page B with a valid token as a hidden form field. They then try to submit this valid

Re: (newbie) html:select problem

2005-01-26 Thread Will Stranathan
This seems to come up frequently. You have to add some Javascript on the client side to either populate hidden form fields or to iterate through the entire target set and select them all - the values don't get passed in the HTTP request unless it's selected. w On Wed, 26 Jan 2005 23:01:19 +053

Re: [OT] a java question

2005-01-26 Thread Will Stranathan
Or, keep all your static shared junk in your initializer class, then make the mutator private, accessor public. w On Wed, 26 Jan 2005 11:29:53 -0800 (PST) [EMAIL PROTECTED] wrote: However, as another poster said, why not just set the value in a static initializer block, and only expose a getter

Re: WEB-INF and non-JSP files

2005-01-27 Thread Will Stranathan
If I remember the same thread, I think the thrust of the argument was that JSP belongs under WEB-INF because it's TEMPLATE artifacts, NOT web artifacts. However, images and javascripts, unless you have a custom servlet or Struts action to retrieve those artifacts, would NOT belong under WEB-IN