Hello Jacques, First of all, thank you for your response, while we declare Servlet definition in web.xml file we can also do it the java file itself. Here is an example of declaring a Servlet through annotation:
@WebServlet(name = "/mypluginweb/WelcomeServlet", urlPatterns = "/mypluginweb/WelcomeServlet", loadOnStartup = 1, description = "Welcome Servlet") and for Filters: @WebFilter(filterName = "MyFilter", displayName = "MyFilter", initParams = @WebInitParam(name = "allowedPaths", value = "/error:/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images"), @WebInitParam(name = "redirectPath", value = "/control/main")) Web components are configurable through annotations it reduces ceremony of 1) Writing XML files 2) Validating and storing Document 3) And finally converting them into Java objects. 4) Annotations based configuration is concise in comparison to XML based configuration. On Mon, Sep 18, 2017 at 12:27 PM Jacques Le Roux < [email protected]> wrote: > Hi Pradhan, > > Could you give us a quick example of what you want to do with it exactly? > > Actually more to the point, what advantages this gives to us? > > TIA > > Jacques > > > Le 18/09/2017 à 07:19, Deepak Dixit a écrit : > > Hi Yash, > > > > Your email has been moderated, > > Please subscribe to mailing list > > > > http://ofbiz.apache.org/mailing-lists.html > > > > > > Thanks & Regards > > -- > > Deepak Dixit > > www.hotwaxsystems.com > > www.hotwax.co > > > > > > ---------- Forwarded message ---------- > > From: Pradhan Yash Sharma <[email protected]> > > To: [email protected] > > Cc: Yash Sharma <[email protected]> > > Bcc: > > Date: Sun, 17 Sep 2017 15:52:51 +0530 > > Subject: Proposal to use Servlet annotations for configuration. > > Hello All, > > > > I would like to propose to use annotations for configuring Servlets. We > > have declared web.xml file in every webapp to modularize code. I would > like > > to use Web Servlet annotations > > < > http://docs.oracle.com/javaee/6/api/javax/servlet/annotation/package-summary.html > > > > to > > configure: > > > > 1) context params > > 2) filters > > 3) listeners > > 4) servlet > > 5) session configurations > > > > Please let me know your thoughts. > > > > -- Thanks, *Pradhan Yash Sharma*
