• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

newb Java/JSP/Servlet question

Wingy

[H]ard|Gawd
Joined
Dec 18, 2000
Messages
1,294
I'm writing a distributed application in Java and I have a quick question. Java itself is quite simple to learn, but I'm finding that that the other things you can do with Java are immense.

For example, my application consists of a central server app, which receives data from a client, and disperses it to other clients on the net. It's sort of a form of an Instant Messenger, so being able to getupdates from the central server asap is necessary.

I'm wondering how I can make a web interface for a client to fit into the application. My confusion is that Java now offers a TON of options for web development. Would this need to be an applet on a page?? Or is JSP/Servlet technology suited for this?

Thanks
 
well, using an applet would create the "purest" client/server model, if you want to create a sort of webbased IM system, as it would allow you to basically just write a stand alone client in the form of that applet. I would however, not use an applet for this, ive seen to many annoying java applets to consider them a good idea. although i have seen some nice java applet irc clients iirc.

on the servlet/jsp side of things, it gets a bit more hairey, the main problem here is that you cant easily have the server send a message to one of the clients (it is all request based), so you would need to have a client which continiously polls the server for new messages, bassically a small ajax based chat client, which uses asynchronous javascript queries to post and get data to and from the server. The downside to this is obvious, in order for the system to feel anywhere near responsive, you would need to have every client ask the server each second or so if there are any new messages, eating up unneeded bandwidth when you are idling, and causing higher server load (not too bad with a few dozen clients, but this wouldnt easily scale up to say, 100.000 users)

why not use a real client side app? write a small java client that people can download and run?
 
Well I'm trying to learn Java with this project. I wanted to learn more than just one aspect of it, so I was actually going to do this both ways. With a web interface, and a client side app.
 
ah i see

well if you want to learn a lot, then making the web version an applet wont teach you much, since it will probably work the same as the full client app, but this time running as an applet in a browser

if you are gonna do both, then the servlet/jsp/ajax approach will be the most valuable as a learning project for the web side
 
Thanks, thats what I was looking for.

Also, I wanted to ask, do you recommend any book or resources for working with those?

I havn't done extensive research yet, but I'm sure there's a wealth of info out there.

Also, can you recommend any hosting that supports JSP and servlets? Right now I'm looking at lunarpages (Dont remember the address at this point). I looked through the whole hosting thread last night, and went through a ton of sites, and there are very few that support it.

Thanks.
 
well, i learned my jsp/servlet stuff from a "head first" book, which imho kinda sucked, but then again, if you have to go through it yourself, then it might be good (i had a teacher insistant on covering each and every page), sadly i cant really recommend anything better, most of my knowledge i leanred by getting dumped into a project.

as for hosting, not a clue, im currently doing jsp/servlet stuff for my job, so the web-app will be hosted by the company itself

good luck!
 
Thanks, thats what I was looking for.

Also, I wanted to ask, do you recommend any book or resources for working with those?

I havn't done extensive research yet, but I'm sure there's a wealth of info out there.

Also, can you recommend any hosting that supports JSP and servlets? Right now I'm looking at lunarpages (Dont remember the address at this point). I looked through the whole hosting thread last night, and went through a ton of sites, and there are very few that support it.

Thanks.

You dont actually need a hosting provider, read on:

If I were you, I'd download a free version of MS SQL Server 2005 ( express) and java IDE ( I prefer netbeans 6.0 ) like Eclipse or Netbeans, also download and install a Application Server (which is something you will need).

Sun provides a nice little Java EE package with Netbeans 6.0, GlassFish V2 Application Server, etc.

This way you have your own App Server, Database Server and a very nice IDE in which you can easily test, develop and debug real world applications.

Then if you feel like you're ready for deployment to the world you can find a good host that supports everything you need. Why pay while still learning when there are so many open source enterprise level things available ;).

Also, I suggested SQL Server 2005 since its just pretty easy to set up, but I would also learn some sort of ORM framework ( I prefer Hibernate ) which will basically make your web application database independant ;)

Good luck!
 
Back
Top