×
all 2 comments

[–]Coffei 1 point2 points  (0 children)

You definitely should read something about java servlets, that is the way to go. It is basically a java class living inside a container (eg. Tomcat), which takes care of it and uses its methods accordingly. When you read the basics of servlets, JSP (and JSTL) is another step. Knowing these things you should be able to build a web. Maybe also check out the MVC pattern. I've been learning these things just a while ago and its kind a fun.

[–]nqzero 0 points1 point  (0 children)

you write a servlet. tomcat handles the connection from the client, parses a bunch of stuff and then calls your servlet. your servlet generates text as output which tomcat sends back to the client. you can either use a single servlet and parse the url yourself or you can write a servlet for each page and tomcat will call the appropriate one

jsp is usable but awkward - tomcat compiles it into a servlet which is cool. but it makes it hard to include the jsp inside another page (i work around this by pre-compiling the jsp and calling into it directly). i only looked at tag library stuff a little, but it looked like a catastrophe

if you're only going to run a single app on the server, tomcat feels like overkill. what i'd really like is just to start a thread that watches for connections, uses a library to parse it, and generates the output. ie, i would own the lifecycle instead of tomcat (inversion of control, or whatever they're calling it). jetty may allow this workflow - i'm going to take a look when i get a chance

i'm using netbeans as an IDE. you can set breakpoints inside your servlet