[Logo] Mentawai Recipes
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register / 
[Login] Login 
Validation through a separate filter  XML
Forum Index » Official Recipes
Author Message

Joined: 10/01/2008 08:20:15
Messages: 39

And the internationalized messages would be inside the /validation/HelloValidator_loc.i18n file, where loc is the locale (ex: HelloValidator_en_US.i18n). OBS: If you are using a master i18n file through LocaleManager.useMasterI18N(true), then your messages will be inside the /i18n/master_en_US.i18n.

Now if you don't want to put your messages in a separate file, then you can just hardcode your messages:

Now to display your message in the JSP, you can use the menta tag. You can choose from mtw:hasError and mtw:outError tag.

Note that this tags are conditional tags, in other words, nothing will be shown if there is no error for the field.

To add the HelloValidator as an action specific filter inside your application manager, you can just do this:

TIP: Use the Mentawai HTML form tags mtw:input, mtw:select, etc. so you don't have to worry about re-displaying the values that the user typed in case of validation error. We know you don't want to place a bunch of scriptlets in your JSPs to do this.
Forum Index » Official Recipes
Go to:   
Powered by JForum 2.1.8 © JForum Team