• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Can I validate my form using Struts-Portlet framework functionality

Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have few questions, I am using Liferay Portal for development

Question: Where is MessageResource.propertiesfile for entering keys/values which is to be displayed after form validation fails

Desc: I want to do form validation using struts validate() method. For this i need few things like

1) validate() method
2) entry of this in struts-congif.xml as validate=true
3) and most important the MessageResource.properties.

But i am using StrutsPortlet.
So do we have all this functionalities in StrutsPortlet framework?
or is there any other method other than validate() and any other file other than MessageResource.properties to handle form validation?

And if we cannot use validate(), so how to handle form validation using Struts-Portlet framework?

[ December 21, 2007: Message edited by: Saurabh Joshi ]
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The struts validation works fine with struts portlet.
It can be done in same way as a simple struts application.
Incase if struts validator is not invoking itself, invoke it in execute method using following piece of code

ActionErrors errors = form.validate( mapping, (ServletRequest) request );
if ( errors != null && !errors.isEmpty() ) {
saveErrors((HttpServletRequest) request, errors);
return (mapping.findForward("credit"));

30 seconds to difuse a loaf of bread ... here, use this tiny ad:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic