Transform values - Type conversion

2010-02-01 Thread Diego Manilla Suárez
Hi. I have a simple problem: I need to divide by 100 user's input in some fields when I'm going to store values in DB and perform the opposite operation when loading the form again. I thought Struts 2 type conversion was what I needed, so I created a simple PercentageConverter, implementing co

Re: Problems with tokenSession interceptor

2009-11-30 Thread Diego Manilla Suárez
using Tiles). I don't remember why I mapped the servlet to all dispatchers, but I suppose some day I'll find out the reason ;) Diego Manilla Suárez escribió: Hi. I'm trying to use the tokenSession interceptor to prevent double submit problems. The problem is that this line in

Problems with tokenSession interceptor

2009-11-30 Thread Diego Manilla Suárez
Hi. I'm trying to use the tokenSession interceptor to prevent double submit problems. The problem is that this line in TokenHelper.setToken (invoked from tag) always return null: ActionContext.getContext().getSession() I'm also using the createSession interceptor, but it's still not working.

File upload exceeds limit -> form fields lost

2009-10-16 Thread Diego Manilla Suárez
Hi. If I set struts.multipart.maxSize to, say, 2 MB, and I try to upload a file larger than that, I get a validation error and my form fields lose their value. Is there anything I can do so the form doesn't lose all data? Thanks in advance. ** * ***

Testing with Spring + Struts 2 + TestNG

2009-09-11 Thread Diego Manilla Suárez
Hi. I've been struggling to have tests for my Struts 2 actions working. I'm using Struts 2 actions created by Spring, by the means of the Struts 2 Spring plugin. Both Struts 2 and Spring provide their own base classes to create test units, and since Java doesn't allow multiple inheritance, I'

[S2] JSP Exception handling

2008-09-25 Thread Diego Manilla Suárez
Hi. It seems that Struts 2 is ignoring the JSP standard approach to exception handling. If I write a JSP that throws an exception, the error JSP is not loaded even if I put a page directive with errorPage pointing to a JSP with isErrorPage="true". The exception is written to stdout. What do

Re: [S2] Proper way to clear error messages in session scope

2008-08-13 Thread Diego Manilla Suárez
working. Regards, Diego. Diego Manilla Suárez escribió: Hi. I have an action in session scope. The problem is that action errors are never cleared and thus are shown repeatedly whenever the user sends the form with validation errors. At first I put a call to clearErrors() at the beginning of mi

[S2] Proper way to clear error messages in session scope

2008-08-12 Thread Diego Manilla Suárez
Hi. I have an action in session scope. The problem is that action errors are never cleared and thus are shown repeatedly whenever the user sends the form with validation errors. At first I put a call to clearErrors() at the beginning of mi validate() method, but now I'm using also the validati

Send a 403 response

2005-05-31 Thread Diego Manilla Suárez
Hi! I need to implement some kind of security inside of an Action. When the user doesn't meet certain criteria, I must send him to the "forbidden" page. Right now I'm doing this: if (!allowed) { response.sendError(HttpServletResponse.SC_FORBIDDEN); return null; } The problem is that the

Re: Add action mappings on the fly

2005-02-22 Thread Diego Manilla Suárez
Thanks everyone for your replies. I didn't know the wildcard matching feature in action mappings. With this feature and map-backed ActionForms now I can do more or less what I wanted to do. Regards, Diego. Joe Germuska wrote: At 12:39 PM +0100 2/21/05, Diego Manilla Suárez wrote: Hi! I

Add action mappings on the fly

2005-02-21 Thread Diego Manilla Suárez
Hi! I'm trying to add an ActionMapping definition dinamically (using ModuleConfig.addActionConfig method), but I get an IllegalStateException (configuration is frozen). Is there a way to do what I want? Thanks in advance. - To u

Process tiles definition from a different module

2005-01-27 Thread Diego Manilla Suárez
Hi! I need to process a tiles definition that is located in a different module. I have this ActionForward declared on the module I want to invoke: And on the main module, I have this code (in an action) to get that forward definition. ActionForward forward = null; ServletContext context = getS

Re: Problems initializing form objects

2004-12-14 Thread Diego Manilla Suárez
is sort of thing, I usually put it in an "initializer" Action that I always link to in place of the JSP. -- Jeff Diego Manilla Suárez wrote: Hi! I have a problem with form members initialization. I have this form. public class BasicContentForm extends ValidatorForm { prot

Re: Problems initializing form objects

2004-12-14 Thread Diego Manilla Suárez
but I dont recall the details :-( Jeff Beal wrote: When I have this sort of thing, I usually put it in an "initializer" Action that I always link to in place of the JSP. -- Jeff Diego Manilla Suárez wrote: Hi! I have a problem with form members initialization. I have this for

Problems initializing form objects

2004-12-13 Thread Diego Manilla Suárez
Hi! I have a problem with form members initialization. I have this form. public class BasicContentForm extends ValidatorForm { protected java.util.List propertyValues; public BasicContentForm() { this.propertyValues = new java.util.ArrayList(); } public void setPropertyValu