• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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
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
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic