Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All constants are variables.


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

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

1
benefits of servlet mapping?

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

  copy mid

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

  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.programmer@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.rocksolidbbs.com/devel/article-flat.php?id=101&group=comp.lang.java.programmer#101

  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: arne@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.

Re: benefits of servlet mapping?

<cfd9295c-12e1-4c31-ab1d-9f0a054e5aa0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.java.programmer
X-Received: by 2002:ac8:7083:0:b0:2eb:b6b9:acec with SMTP id y3-20020ac87083000000b002ebb6b9acecmr5649477qto.465.1649209302557;
Tue, 05 Apr 2022 18:41:42 -0700 (PDT)
X-Received: by 2002:a05:6870:f21d:b0:e1:cb99:bd46 with SMTP id
t29-20020a056870f21d00b000e1cb99bd46mr2813065oao.140.1649209301943; Tue, 05
Apr 2022 18:41:41 -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 18:41:41 -0700 (PDT)
In-Reply-To: <624cdef1$0$692$14726298@news.sunsite.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=98.237.40.232; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host: 98.237.40.232
References: <e337fb3a-35c3-4e4c-9516-309d5d26d8f8n@googlegroups.com> <624cdef1$0$692$14726298@news.sunsite.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cfd9295c-12e1-4c31-ab1d-9f0a054e5aa0n@googlegroups.com>
Subject: Re: benefits of servlet mapping?
From: e.d.programmer@gmail.com (e.d.pro...@gmail.com)
Injection-Date: Wed, 06 Apr 2022 01:41:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 21
 by: e.d.pro...@gmail.com - Wed, 6 Apr 2022 01:41 UTC

> 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

Consistency is the first issue, as I pulled together decades of old code into one clean maven project with many modules. Some modules create wars, some create jars. Two of the war modules have spring framework config files. I'm wondering if we'll see benefits in setting all modules up for Spring, as we're modifying literally all the code anyway doing linting and unit tests, or if it makes any sense to use all Spring controllers in 2 modules and clean the rest up with a different style. There's literally one class using the servlet-mapping servlet, I don't see any upside to that syntax, the rest that aren't Spring are using WebServlet. All I know is the different syntax, I'm not aware of functional or performance benefits of any style choice.

Re: benefits of servlet mapping?

<624da3f5$0$700$14726298@news.sunsite.dk>

  copy mid

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

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Wed, 6 Apr 2022 10:30:05 -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>
<624cdef1$0$692$14726298@news.sunsite.dk>
<cfd9295c-12e1-4c31-ab1d-9f0a054e5aa0n@googlegroups.com>
From: arne@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <cfd9295c-12e1-4c31-ab1d-9f0a054e5aa0n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 37
Message-ID: <624da3f5$0$700$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: ac29abe2.news.sunsite.dk
X-Trace: 1649255413 news.sunsite.dk 700 arne@vajhoej.dk/68.9.63.232:57174
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Wed, 6 Apr 2022 14:30 UTC

On 4/5/2022 9:41 PM, e.d.pro...@gmail.com wrote:
>> 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

> Consistency is the first issue, as I pulled together decades of old
> code into one clean maven project with many modules. Some modules
> create wars, some create jars. Two of the war modules have spring
> framework config files. I'm wondering if we'll see benefits in
> setting all modules up for Spring, as we're modifying literally all
> the code anyway doing linting and unit tests, or if it makes any
> sense to use all Spring controllers in 2 modules and clean the rest
> up with a different style. There's literally one class using the
> servlet-mapping servlet, I don't see any upside to that syntax, the
> rest that aren't Spring are using WebServlet. All I know is the
> different syntax, I'm not aware of functional or performance benefits
> of any style choice.

If you only have one servlet using web.xml then I would change that
to annotation. There should not be any runtime performance difference
after startup. I don't remember if the annotations support all the
functionality in web.xml, but if the annotation support the
functionality you need then you are good.

Regarding cleanup - are you planning to stay on servers
(Tomcat or JBoss or whatever) or are you planning on moving
entirely to SpringBoot or are you planning to do both?
That may influence the road forward a lot.

Arne

Re: benefits of servlet mapping?

<62a34314-732d-4768-9b4b-1e36231afd2dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.java.programmer
X-Received: by 2002:a05:6214:1c83:b0:443:6749:51f8 with SMTP id ib3-20020a0562141c8300b00443674951f8mr8196910qvb.74.1649269763506;
Wed, 06 Apr 2022 11:29:23 -0700 (PDT)
X-Received: by 2002:a05:6808:191c:b0:2f9:4621:641a with SMTP id
bf28-20020a056808191c00b002f94621641amr4171725oib.226.1649269763235; Wed, 06
Apr 2022 11:29:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.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: Wed, 6 Apr 2022 11:29:23 -0700 (PDT)
In-Reply-To: <624da3f5$0$700$14726298@news.sunsite.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=98.237.40.232; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host: 98.237.40.232
References: <e337fb3a-35c3-4e4c-9516-309d5d26d8f8n@googlegroups.com>
<624cdef1$0$692$14726298@news.sunsite.dk> <cfd9295c-12e1-4c31-ab1d-9f0a054e5aa0n@googlegroups.com>
<624da3f5$0$700$14726298@news.sunsite.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <62a34314-732d-4768-9b4b-1e36231afd2dn@googlegroups.com>
Subject: Re: benefits of servlet mapping?
From: e.d.programmer@gmail.com (e.d.pro...@gmail.com)
Injection-Date: Wed, 06 Apr 2022 18:29:23 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 17
 by: e.d.pro...@gmail.com - Wed, 6 Apr 2022 18:29 UTC

> If you only have one servlet using web.xml then I would change that
> to annotation. There should not be any runtime performance difference
> after startup. I don't remember if the annotations support all the
> functionality in web.xml, but if the annotation support the
> functionality you need then you are good.
>
Definitely, if the old web.xml doesn't add functionality we want to get rid of that one.
I don't know if it's worth adding the spring framework functionality for web servlets to modules that don't have it other than the syntax sugar of mapping one url directly to a method.

> Regarding cleanup - are you planning to stay on servers
> (Tomcat or JBoss or whatever) or are you planning on moving
> entirely to SpringBoot or are you planning to do both?
> That may influence the road forward a lot.
>
> Arne

Yeah I looked at spring boot, seems like that's for using spring as the web server. We are running on tomcat, planning to move to AWS which I believe also runs it on tomcat (in a docker container?).
We have a local test configuration of tomcat in eclipse, someone else handles setting up the servers.

Re: benefits of servlet mapping?

<87fsmnylmu.fsf@xyz.invalid>

  copy mid

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

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!aioe.org!zIjElcU2JW4EI82yXJDBwg.user.46.165.242.75.POSTED!not-for-mail
From: pankaj@xyz.invalid (Pankaj Jangid)
Newsgroups: comp.lang.java.programmer
Subject: Re: benefits of servlet mapping?
Date: Sat, 09 Apr 2022 09:05:21 +0530
Organization: Aioe.org NNTP Server
Message-ID: <87fsmnylmu.fsf@xyz.invalid>
References: <e337fb3a-35c3-4e4c-9516-309d5d26d8f8n@googlegroups.com>
<624cdef1$0$692$14726298@news.sunsite.dk>
<cfd9295c-12e1-4c31-ab1d-9f0a054e5aa0n@googlegroups.com>
<624da3f5$0$700$14726298@news.sunsite.dk>
<62a34314-732d-4768-9b4b-1e36231afd2dn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="58881"; posting-host="zIjElcU2JW4EI82yXJDBwg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:ZqZnEmmjVL2m6/sTnlu65c8ZGkA=
 by: Pankaj Jangid - Sat, 9 Apr 2022 03:35 UTC

"e.d.pro...@gmail.com" <e.d.programmer@gmail.com> writes:

>> Regarding cleanup - are you planning to stay on servers (Tomcat or
>> JBoss or whatever) or are you planning on moving entirely to
>> SpringBoot or are you planning to do both? That may influence the
>> road forward a lot.
>>
>> Arne
>
> Yeah I looked at spring boot, seems like that's for using spring as
> the web server. We are running on tomcat, planning to move to AWS
> which I believe also runs it on tomcat (in a docker container?). We
> have a local test configuration of tomcat in eclipse, someone else
> handles setting up the servers.

AWS has almost all the deployment options. You can deploy a war or a
jar. If you are planning to use AWS configured Tomcat (like
elasticbeanstalk option) then go for war build. Springboot bundles the
servlet container and outputs a jar. This can be run on any machine
where you have standard JRE installed.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor