• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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
Hi,

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?

Thanks,
Saurabh.
[ December 21, 2007: Message edited by: Saurabh Joshi ]
 
Greenhorn
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"));
}


Regards,
Chinmay
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic