Re: adding a custom attribute to a Struts tag

2010-12-17 Thread Maurizio Cucchiara
Your attribute break w3c standard and considering you're going to realize a cms and not an intranet, you should avoid such non-standard elements. In order to accomplish what you need I use to assign css classes: input type ="text" class ="data-length-50" ... After I handle it with jquery. Maurizio

Re: Is it possible to add Action configuration dynamically after the struts has been loaded

2010-12-17 Thread Maurizio Cucchiara
Maybe there is a better way than orchestrating directly a low level api. What do you need exactly? Why don't you simple use wildcard mapping [1]? [1] http://struts.apache.org/2.1.8/docs/wildcard-mappings.html Maurizio Cucchiara On Dec 18, 2010 2:04 AM, "wusheng zhang" wrote: > I have some actio

Is it possible to add Action configuration dynamically after the struts has been loaded

2010-12-17 Thread wusheng zhang
I have some action definition xml fragments generated by some general-action, I just want to update the action mapping by the so called 'general-action' at run time, and let them serves the following requests. I found the org.apache.struts2.config.StrutsXmlConfigurationProvider object can be retr

Re: Parameter manipulation

2010-12-17 Thread Marcus Bond
David, didn't your original post say that this is an action that loads an object to display it rather than to modify it? In which case I'm not sure why you even need to use Preparable (as I'm guessing it's during prepare that the instance is initialised which makes it available for struts to po

adding a custom attribute to a Struts tag

2010-12-17 Thread Scott Koenig
Hello, I am trying to add a character countdown to certain fields in the CMS I work on. The key is that I only want it to apply to certain fields for certain asset types. So, in our DB model, both asset A and asset B use the Headline field, but only asset A needs to worry about SEO and the 50-char

RE: Q: How do I combine struts 2 and another servlet in one application?

2010-12-17 Thread Jonathan.Lewis
Thanks, I just added the Filter interface to my servlet, put the my filter before the struts filter, and now the servlet works like a champ. You simply call the servlet service() method without forwarding to the next filter chain. public void doFilter(ServletRequest servletrequest, ServletRes

RE: Parameter manipulation

2010-12-17 Thread Altenhof, David Aron
One approach I've through of is to create an interceptor that would parse through your -validation.xml (assuming one uses them) and then only allow parameters that have an associated validator. This would actually serve two goals: 1) Preventing parameter fiddling 2) Mandating the wise practice o

Re: No tag "" defined in tag library imported with prefix "html"

2010-12-17 Thread Dave Newton
I'm randomly bitten by funky input files, too, like when people cut-and-paste from something like Word. I don't think that's it, but when it's something weird, you never know. Also, which line is that? It's impossible to tell where the lines are in your file. Dave On Fri, Dec 17, 2010 at 1:24 PM

Re: No tag "" defined in tag library imported with prefix "html"

2010-12-17 Thread Maurizio Cucchiara
It smells like missing dependency? 2010/12/17 Amit Oberoi : > Maurizio, > > Thanks for your prompt response. It doesn't works, still getting the same set > of exceptions. > > Amit Oberoi > > > -Original Message- > From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] > Sent: Fri

Re: Parameter manipulation

2010-12-17 Thread stanlick
That would certainly eliminate the email being set! :) Sorry about that. What I have done is combine a security system based on user/role/url/valid-parameter list with the ParametersInterceptor and throw away any unauthorized parameters. This was quite an undertaking and my company is not willin

Re: Parameter manipulation

2010-12-17 Thread Chris Pratt
Maybe if the OP moves the bean creation out of the prepare() method (so the bean isn't available during parameter injection) and then retrieves it at the start of validate() or execute() that might solve the problem. (*Chris*) On Fri, Dec 17, 2010 at 10:05 AM, Chris Pratt wrote: > If the bean a

Re: Parameter manipulation

2010-12-17 Thread Chris Pratt
If the bean already exists, struts doesn't have to set it. It just has to modify the retrieved bean. (*Chris*) On Fri, Dec 17, 2010 at 9:48 AM, wrote: > I agree S2 will create the bean (if null) but it can't set a property that > is private and has no accessible setter method. > > P.S. What a

Re: Parameter manipulation

2010-12-17 Thread Maurizio Cucchiara
So, in case of the OP, are you suggesting to remove setter method from User's email? 2010/12/17 : > I agree S2 will create the bean (if null) but it can't set a property that > is private and has no accessible setter method. > > P.S. What am I missing here? > > Scott > > On Fri, Dec 17, 2010 at 1

RE: No tag "" defined in tag library imported with prefix "html"

2010-12-17 Thread Amit Oberoi
Maurizio, Thanks for your prompt response. It doesn't works, still getting the same set of exceptions. Amit Oberoi -Original Message- From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] Sent: Friday, December 17, 2010 11:11 PM To: Struts Users Mailing List Subject: Re: No t

Re: Parameter manipulation

2010-12-17 Thread stanlick
I agree S2 will create the bean (if null) but it can't set a property that is private and has no accessible setter method. P.S. What am I missing here? Scott On Fri, Dec 17, 2010 at 11:45 AM, Maurizio Cucchiara < maurizio.cucchi...@gmail.com> wrote: > This happens because bean is null, otherwis

Re: Parameter manipulation

2010-12-17 Thread Maurizio Cucchiara
This happens because bean is null, otherwise struts will populate. 2010/12/17 : > Guys -- > > If the action has no setter and the property is private, S2 will not > populate it. > > Scott > > On Fri, Dec 17, 2010 at 11:10 AM, Maurizio Cucchiara < > maurizio.cucchi...@gmail.com> wrote: > >> David,

Re: No tag "" defined in tag library imported with prefix "html"

2010-12-17 Thread Maurizio Cucchiara
Probably I'm wrong, but you should try to declare html struts library in the following way: <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %> 2010/12/17 Amit Oberoi : > Hi, This may sound a dumb question; however, I am new to struts & JSP > and this indeed is my first code to

Re: Parameter manipulation

2010-12-17 Thread stanlick
Guys -- If the action has no setter and the property is private, S2 will not populate it. Scott On Fri, Dec 17, 2010 at 11:10 AM, Maurizio Cucchiara < maurizio.cucchi...@gmail.com> wrote: > David, > I get your point. > > Scott is right, you could overwrite PI or maybe write your custom > interc

No tag "" defined in tag library imported with prefix "html"

2010-12-17 Thread Amit Oberoi
Hi, This may sound a dumb question; however, I am new to struts & JSP and this indeed is my first code to do a login. I am using Netbeans 7.0 Beta as the IDE and while executing I am getting the below error message. Please can anyone help me in sorting this out. org.apache.jasper.JasperExceptio

Re: Q: How do I combine struts 2 and another servlet in one application?

2010-12-17 Thread Maurizio Cucchiara
You could have different way: 1. You could change url pattern for struts filter as the following code: /struts2/* or simply *.action 2. alternately you could write your custom filter, place its filter-mapping before struts's one 2010/12/17 : > Hi all, > > I am trying to incorporate a servlet i

Re: Parameter manipulation

2010-12-17 Thread Maurizio Cucchiara
David, I get your point. Scott is right, you could overwrite PI or maybe write your custom interceptor (though I think you should consider to file an issue on JIRA). Maybe it would use java annotations to hide/expose fields, or alternately it could behave as you supposed (expose only field with wr

Q: How do I combine struts 2 and another servlet in one application?

2010-12-17 Thread Jonathan.Lewis
Hi all, I am trying to incorporate a servlet into my struts 2 application. It seems that the struts 2 filter fires before the servlet has a chance to execute, thereby causing the struts engine to process the servlet url as a struts action. This of course results in a "no action found for url /

Re: Parameter manipulation

2010-12-17 Thread stanlick
David -- You could override the ParametersInterceptor with your own that validates requester role/parms/url. I have used this approach to throw away not-authorized parms altogether. Scott On Fri, Dec 17, 2010 at 8:54 AM, Altenhof, David Aron wrote: > The model objects are initialized in prepar

Re: Parameter manipulation

2010-12-17 Thread Chris Pratt
You should be able to initialize the objects in the interceptor instead, you could even retrieve them from the request or some other method in the action. Probably a more comprehensive fix than trying to white-list everything by hand. (*Chris*) On Fri, Dec 17, 2010 at 6:54 AM, Altenhof, David A

Validation/Restriction

2010-12-17 Thread CRANFORD, CHRIS
Our application is designed to allow users to query information from our backend database. The records in this database are stored with an association to a data hierarchy. Each record contains a facilityId value and this facilityId is the deepest child in the tree of customer->region->facility.

RE: Parameter manipulation

2010-12-17 Thread Altenhof, David Aron
The model objects are initialized in prepare() ... other techniques just aren't as practical for our application. I'm just going to keep doing lots of whitelisting with ParameterNameAware... -David -Original Message- From: Steven Yang [mailto:kenshin...@gmail.com] Sent: Friday, Dece

Re: Convention Plugin, Inheriting from existing projects action

2010-12-17 Thread Arne Stabenau
Ok, after a little more code reading I think I understand a bit better. Action names are checked for duplicates only for pre-existing configuration, which probably means the XML config. If I annotate in the same class with the same action name, again that is checked. Only (and this is what I think

Re: Struts2 IDE, eclipse plugins to manage struts2 xml file, areyou interested?

2010-12-17 Thread Angelo zerr
Hi Johannes, Frans, Hansty, Thank a lot for your answer. Today it doens't exists Update Site for Struts2 IDE (I have developped that this Thursday in 2 hours). But if you know how test Eclipse Plugins you can get sources plugin from SVN (the attached doc tell you where you can find sources ): * h