You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Xinsheng [mike] Huang" <xi...@yahoo.com> on 2005/06/08 20:56:38 UTC
100% declarative token management and validation; multiple values of action config "parameter"
I identified following issues in current struts and about to write articles to propose solutions:
1) token management. The current implemention of token management requires individual actions do themselves, i.e., "insert" token management code and logic into you action classes. That is simply not good. because it couples with yor application control code. My proposed sulotion is move the token management code out of action hirachy, instead, put in Controller and declare whether to use and how to use in struts-config.xml. Thus achive 100% declarative token management.
2)Validator. the validator "float" and "long" failes when the input number has trailing "f" and "l" respectively. the validwhen uses hard-coded variable name "test" to indentified the expression and make it impossible to use multiple validwhen on the same field. the validwhen fails when comapre numbers and java.util.Date or java.sql.Date, because they are compared by the string value.
3) muti-valued action config attribute "parameter". The action config attribute "parameter" is designed to pass additional config parameters. But it is no longer available if you use DispatchAction, because DispatchAction monoplized the parameter, only one single parameter that specified the method name to be called. Reimplement getMethodName()
in DispatchAction will solve this problem. The mutilple parameters should be pared, saved into requtest and available to action/jsps. This process should be done in Controller, not the actions.
I have solutions for all of problems and proved works. Any one can tell me whether any of the problems is already solved?
Xinsheng [Mike] Huang
SCJP -- Sun Certified Programmer for Java 2 Platform
SCJD -- Sun Certified Developer for Java 2 Platform
SCEA -- Sun Certified Enterprise Architect for J2EE
410-790-7462(C)
---------------------------------
Discover Yahoo!
Stay in touch with email, IM, photo sharing & more. Check it out!
Re: 100% declarative token management and validation; multiple values
of action config "parameter"
Posted by Riyaz Mansoor <rm...@gmail.com>.
Xinsheng [mike] Huang wrote:
> 1) token management. The current implemention of token management requires individual actions do themselves, i.e., "insert" token management code and logic into you action classes. That is simply not good. because it couples with yor application control code. My proposed sulotion is move the token management code out of action hirachy, instead, put in Controller and declare whether to use and how to use in struts-config.xml. Thus achive 100% declarative token management.
+1 on declarative token management ( where ever it is handled :) )
> 2)Validator. the validator "float" and "long" failes when the input number has trailing "f" and "l" respectively. the validwhen uses hard-coded variable name "test" to indentified the expression and make it impossible to use multiple validwhen on the same field. the validwhen fails when comapre numbers and java.util.Date or java.sql.Date, because they are compared by the string value.
my last problem wit Validator was passing Date validation (with pattern
yyyy-MM-dd) for values such as "1980". :)
riyaz
note; am not a struts committer (since it appears u're asking the struts
guru's here :)) just my $0.02
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org