Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

<<<<< EVACUATION ROUTE <<<<<


devel / comp.lang.java.programmer / Re: benefits of servlet mapping?

SubjectAuthor
* benefits of servlet mapping?e.d.pro...@gmail.com
`- Re: benefits of servlet mapping?Arne Vajhøj

1
benefits of servlet mapping?

<e337fb3a-35c3-4e4c-9516-309d5d26d8f8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9968&group=comp.lang.java.programmer#9968

  copy link   Newsgroups: comp.lang.java.programmer
X-Received: by 2002:a05:622a:5d1:b0:2e0:70c7:1678 with SMTP id d17-20020a05622a05d100b002e070c71678mr3472077qtb.43.1649172672617;
Tue, 05 Apr 2022 08:31:12 -0700 (PDT)
X-Received: by 2002:a05:6830:2648:b0:5cd:bac6:7b7a with SMTP id
f8-20020a056830264800b005cdbac67b7amr1415539otu.364.1649172672310; Tue, 05
Apr 2022 08:31:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.java.programmer
Date: Tue, 5 Apr 2022 08:31:12 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=98.237.40.232; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host: 98.237.40.232
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e337fb3a-35c3-4e4c-9516-309d5d26d8f8n@googlegroups.com>
Subject: benefits of servlet mapping?
From: e.d.prog...@gmail.com (e.d.pro...@gmail.com)
Injection-Date: Tue, 05 Apr 2022 15:31:12 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 3
 by: e.d.pro...@gmail.com - Tue, 5 Apr 2022 15:31 UTC

Our application currently using 3 different servlet mapping syntax, wondering if there's a benefit to setting them all up one way aside from personal preference on the syntax of the routing.
1. <servlet> and <servlet-mapping> tags in web.xml pointing to Java class which extends HttpServlet, all requests go into service() method. This is built into JDK?
2. @WebServlet annotation on class, routes requests into doGet() or doPost() methods, requires javax.servlet-api dependency.
3. @RestController, @RequestMapping/@GetMapping/@PostMapping annotation, routes requests directly into individual methods, requires spring-framework dependency and apparently custom initializer class setup.

Re: benefits of servlet mapping?

<624cdef1$0$692$14726298@news.sunsite.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9969&group=comp.lang.java.programmer#9969

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Tue, 5 Apr 2022 20:29:34 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Subject: Re: benefits of servlet mapping?
Content-Language: en-US
Newsgroups: comp.lang.java.programmer
References: <e337fb3a-35c3-4e4c-9516-309d5d26d8f8n@googlegroups.com>
From: arn...@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <e337fb3a-35c3-4e4c-9516-309d5d26d8f8n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 20
Message-ID: <624cdef1$0$692$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 3e00c6b7.news.sunsite.dk
X-Trace: 1649204977 news.sunsite.dk 692 arne@vajhoej.dk/68.9.63.232:56144
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Wed, 6 Apr 2022 00:29 UTC

On 4/5/2022 11:31 AM, e.d.pro...@gmail.com wrote:
> Our application currently using 3 different servlet mapping syntax, wondering if there's a benefit to setting them all up one way aside from personal preference on the syntax of the routing.
> 1. <servlet> and <servlet-mapping> tags in web.xml pointing to Java class which extends HttpServlet, all requests go into service() method. This is built into JDK?
> 2. @WebServlet annotation on class, routes requests into doGet() or doPost() methods, requires javax.servlet-api dependency.
> 3. @RestController, @RequestMapping/@GetMapping/@PostMapping annotation, routes requests directly into individual methods, requires spring-framework dependency and apparently custom initializer class setup.

I believe that as usual consistency is more important than what is
chosen.

I would:
* use the Spring annotations for Spring web services as that is the
standard for those
* decide on either web.xml or @WebServlet for anything not Spring web
service

Arne

PS: All the servlet stuff is part of Java EE / Jakarta EE not part
of Java SE / JDK.


devel / comp.lang.java.programmer / Re: benefits of servlet mapping?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor