This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about servlet-mapping

 
venkataramana raju
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • 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...
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Scheepers, Thanks for ur Explanation
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic