#What is Tomcat and servlets

34 messages · Page 1 of 1 (latest)

rain nest
#

i am coming from a node js background and i find this Tomcat and servlets confusing asf. like what's going on?

so till now what i have gathered has been like Tomcat is a server that runs servlets.

cant servlet run on their own
what's the point of even having a tech like that ? that cant run independently

also while i am at it i would like to know if i need to know servlets and tomcat to work on spring?

sullen daggerBOT
#

This post has been reserved for your question.

Hey @rain nest! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

mortal panther
#

These days you don't need a standalone Tomcat (it's embedded), you can start your project with simple mvn spring-boot:run. If you see an application running within an app container it's usually some old stuff.

#

Servlets are only an implentation detail in Spring, you don't need to know them to use the Spring MVC stuff. Which could do all what servlets can do, but is much nicer to use.

sullen daggerBOT
# rain nest aight man thanks

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

rain nest
#

also

#

i have a very specific string jpa doubt

#

when you create a one to one mapping

#

like this

#

you have to pass entire item object that will be stored

but what if i already have an item existing in db and i just wanna associate it with Customer

#

like using its id can i do that?

#

using a foreign key reference or something

mortal panther
#

First of all, it doesn't look like 1-1 to me, considering the names.

#

Can the user have multiple items?

rain nest
#

true ignore the usecase tho its just a tutorial

rain nest
#

its like each order has one user associated with it

#

that will be one to one

#

so i need to use @OnetoOne only

#

this is what i am cooking

mortal panther
#

I haven't use JPA for a while, but I'm pretty sure it was possible to only pass an id.

rain nest
#

what do you use?

#

asking for knowing the latest tech in market ig

mortal panther
#

Currently nothing, because we don't have a db at this project, but recently jOOQ and even Spring Data R2DBC.

#

But R2DBC is too limited in my opinion.

rain nest
#

Yo wat

#

also what is your preferred mode of learning like do you follow docs or videos?

mortal panther
#

I usually read official docs.

rain nest
#

gotcha thanks man

sullen daggerBOT
# rain nest gotcha thanks man

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.