Re: labelizing submit buttons
maybe it is a little late, but here is a "legal" way to put a label on s:submit: With btn.search defined in .properties file. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: labelizing submit buttons
I think your tag has a leak of attribute "method" Your code: will generate HTML likes: When you click this button, there will be a http request parameter like "btn.search=Search". Struts2 will accept this parameter, and try to save it to your action property. So, there will be a property setting, which cause method invoking likes: YourAction.getBtn().setSearch("Search") But your action does not have a property named "btn", so getBtn() will get a null, and of cause the setSearch part will fail. If you add a "method" attribute to submit tag, like: It will generate HTML like: Notice, the "name" is now "method:search" So, when you click this button, the http request will be: "method:search=Search". Struts will recognize the prefix "method:", so it know that this is a flag to specify which method to execute, but not a input data which need to be set in to property of Action. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: labelizing submit buttons
There is an easy trick: Define all your buttons in your global.properties starting with word ‘*dojo*’ like this: dojo.btn.eliminar=Borrar dojo.btn.editar=Editar dojo.btn.inscripcion=Inscribirse dojo.btn.buscar=Buscar That way you avoid ParametersInterceptor to search for unimplemented setters as a result of the excludeParams configuration parameter: dojo\..*,^struts\..* Hope this helps! 2010/11/30 webmeiker > It doesn’t work… > > Neither putting ‘btn.search=Search’ in: my-global-messages.properties, > package.properties, my-action.properties > > > > ¿?¿? > > > 2010/11/29 M. Rakowski > > >> i have exactly the same problem: >> >> >> >> with event.name set in the package.properties file: works ok. >> >> >> >> with button.create set in the same .properties-file >> causes exception. >> >> Suggestion: >> It works only if you use ActionClassName.properties file >> instead of package.properties? >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > -- > > > --
Re: labelizing submit buttons
It doesn’t work… Neither putting ‘btn.search=Search’ in: my-global-messages.properties, package.properties, my-action.properties ¿?¿? 2010/11/29 M. Rakowski > > i have exactly the same problem: > > > > with event.name set in the package.properties file: works ok. > > > > with button.create set in the same .properties-file > causes exception. > > Suggestion: > It works only if you use ActionClassName.properties file > instead of package.properties? > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > --
Re: labelizing submit buttons
i have exactly the same problem: with event.name set in the package.properties file: works ok. with button.create set in the same .properties-file causes exception. Suggestion: It works only if you use ActionClassName.properties file instead of package.properties? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: labelizing submit buttons
You shouldn't need a setSearch method inside your action: the bEst way to make it work is to verify that your ActionClassName.properties contains a btn.search entry. 2010/11/29 webmeiker : > Hi all, > > Could somebody help me with the next issue? > > > > In a submit button I want to use a customized label (which is extracted from > a .properties file). > > The problem is that I get the next exception: > > > > Error setting expression 'btn.search' with value > '[Ljava.lang.String;@1ed56e2' > > *ognl.OgnlException*: target is null for setProperty(null, "search", > [Ljava.lang.String;@1ed56e2) > > at ognl.OgnlRuntime.setProperty(*OgnlRuntime.java:1651*) > > > > Here is the code involved: > > > > …in the .properties: > > btn.search=Search > > > > …in the .jsp: > > > > > > Does somebody know how to avoid this exception without implementing a method > ‘setSearch()’ in the action? > > > > Thanks in advance! > > > -- > -- Maurizio Cucchiara - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
labelizing submit buttons
Hi all, Could somebody help me with the next issue? In a submit button I want to use a customized label (which is extracted from a .properties file). The problem is that I get the next exception: Error setting expression 'btn.search' with value '[Ljava.lang.String;@1ed56e2' *ognl.OgnlException*: target is null for setProperty(null, "search", [Ljava.lang.String;@1ed56e2) at ognl.OgnlRuntime.setProperty(*OgnlRuntime.java:1651*) Here is the code involved: …in the .properties: btn.search=Search …in the .jsp: Does somebody know how to avoid this exception without implementing a method ‘setSearch()’ in the action? Thanks in advance! --