• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

about servlet-mapping

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i am using struts-1.

1) if we use *.xyz instead of *.do in <servlet-mapping> of struts-config.xml
what is the effect.
in fact i tried this one but it is working properly(with *.xyz)

2) when ever we using DynaActionForm, how can we validate the inputs?

plz help me...
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the servlet mapping side I can be of some assistance.

What your servlet-mapping tag does, is identify exactly which URL patterns will cause the request to be handled by which servlet.

E.g:


Any request received by the web server that is (a)in your application's context, and (b)conforms to the pattern '*.gif' (e.g. http://myserver/myappcontext/abc/123/cookie.gif, or http://myserver/myappcontext/cookie.image.gif) will be forwarded to the imageServlet servlet.

You can add multiple patterns as well:
 
venkataramana raju
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Scheepers, Thanks for ur Explanation
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by venkataramana raju:

2) when ever we using DynaActionForm, how can we validate the inputs?



If you're using DynaActionForm and you want to validate, one way to do it would be to change to DynaValidatorForm and use the Struts Validation Framework to validate. DynaValidatorForm has all the features of DynaActionForm, but adds validation through the framework (If you're unfamiliar with the validation framework, just Google "Struts Validation Framework")

Of course you also have the option of validating by subclassing DynaActionForm and including a validate() method in your subclass, but if you're going to write a new class anyway, you might as well subclass ActionForm and put your properties in as well.

Another option is simply to do the validation in the Action class by populating an ActionMessages object and calling the addErrors() method.
 
reply
    Bookmark Topic Watch Topic
  • New Topic