wood burning stoves 2.0*
The moose likes Servlets and the fly likes Front-End To Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Front-End To Servlets" Watch "Front-End To Servlets" New topic
Author

Front-End To Servlets

topher rigor
Greenhorn

Joined: Sep 15, 2003
Posts: 5
what is the best or most appropriate (and easy to make) front end to use?
im making a web-based program that accesses a database. i'll be using a servlet and jdbc to connect to the database. but how about front-end? html forms is an option. but on some pages i'll use applets because it would be easier.
the program includes users having accounts. so when i use applets (for example, in the login page) i send data to the servlet, the servlet makes the query/validation, and return results to the browser. but what will i use to return results? ObjectOutputStream? If ill use OutputStreams, it means the results are sent back to the same html page containing the applet that sent the query. but i need to be on another page( not the login page ) with the results. (is there a way to go to another page from the servlet?)
Alternatively( which seems to be the better choice ) I can print html forms with a new applet from the servlet. Then i will have a new page. But if this is the case, then i can do WITHOUT the servlet. since i can connect my applets to the databases( although i do not know how i know this is possible)
What are my other options for the making the front-end?
P.S.
I am new to servlets, jdbc, and html forms.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

JSP's are the most common front end to Servlets. That is what I would use. I won't go into my opinion on Applets except just to tell you I don't like them.
If you are unfamiliar with Java Server Pages (JSP) you can learn about them here:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html
Keep in mind, JSP's are not the only option. You could just use straight HTML if you wanted so long as your app wasn't very dynamic. But if you are unfamilar with dynamic web page design and want to use servlets, JSP's are probably the best approach for you. My opinion anyway.
[ September 15, 2003: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
topher rigor
Greenhorn

Joined: Sep 15, 2003
Posts: 5
thanks for the reply.
hmm, thats the problem, there is at least one page that is dynamic. im unfamiliar with jsp so i thought of applets. html for the static pages and applets for the dynamic ones.
i have read somewhere that there are good alternatives to jsp. like velocity, tea, etc. although i haven't checked them out. i don't have much time.
I actually need to make a page where I can drag and drop "things". It's a class schedule so i will use a table (grids). If i want to change my schedule, all i need is to drag from one cell( just like in excel ) and drop to another cell. Applets, i think, are nice but takes a lot of time to make. What can i use?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I actually need to make a page where I can drag and drop "things". It's a class schedule so i will use a table (grids). If i want to change my schedule, all i need is to drag from one cell( just like in excel ) and drop to another cell. Applets, i think, are nice but takes a lot of time to make. What can i use?
For drag and drop, nothing. Aside from Applets really. Which mixing applets with html content is just a bad idea from the start.
Does it HAVE to be drag and drop? You could use javascript and move things from one field to another. You could just have to click buttons instead of dragging and dropping.
On an aside, are you sure a Web App is the way to go? Are you required to write a web app or could this just be a Desktop App.
You need to look at the requirements of your app and decide whether or not you can do a web app. Another option for you is to use Java Web Start. They still fall into the same security sandbox as Applets, but they launch just like a Desktop app from the web. So they are easier to maintain and run a little better outside of the browser.
topher rigor
Greenhorn

Joined: Sep 15, 2003
Posts: 5
web app is a requirement. it doesn't need to be drag and drop. im thinking of using a mouseclick to move fields.
how do applets connect to the database directly? or is it better for the applet to connect first to the servlet then the servlet to the database?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Front-End To Servlets
 
Similar Threads
jdbc and java
Applet-Servlet Programming
Jr. & Sr. Java Developers needed in FL!!!!!!
J2EE & EJB roles in Ireland
some java interview Questions