#how to create a java socketserver for a html css js frontend

26 messages · Page 1 of 1 (latest)

sonic forge
#

i want to create a backend for a simple chat site in java, but i cant seem to find any good resouces on how to interface the frontend with a java backend. not asking anyone to program it for me, just looking for some help since im completely new to webdev.

inland flame
sonic forge
#

do i have to use spring?

#

my friend said i dont have to

inland flame
#

You didn't specify what framework you're using so I just defaulted to the industry standard lol

#

you could go with the raw jakarta websockets or whatever that package is called

sonic forge
#

oh okay... yeah so then i guess the problem im having is i odnt understnad how to link up the backend with the frontend

#

in java

#

sorry i only started doing anything web dev like 4 days ago 💀 i got sockets working with node.js but i dont like using js that much

inland flame
#

So you get the general concept of how the client/server interaction works with websockets?

sonic forge
#

yeah i think so

inland flame
#

The client implementation shouldn't differ regardless of whether you're running a Node or Java backend

sonic forge
#

hmm well, maybe the issue is that since i looked at a tutorial to setu p the backend in node that i dont entirely understand then.

inland flame
#

So I'd suggest you start with the backend part first

#

like just getting that up and running, maybe testing it with a tool like Postman

sonic forge
#

even though ive already got my frontend set up?

inland flame
#

I mean in that case you can just reuse the frontend code

sonic forge
#

so its the exact same process of setting up a server and setting up websockets like in node

#

hmm

#

sorry im really new to webdev

inland flame
#

I mean pretty much

sonic forge
#

im gonna go for a walk and think about it

inland flame
#

you install the dependency, set up your websocket handler (aka endpoint)

Java might add some weird ugly OOP stuff around it

#

but it's just bidirectional JSON really

sonic forge
inland flame
#

Java doesn't run in the browser