zenshade said:
I have been tasked with creating a website for my company. It
basically just needs to hold some documents with emergency contact
numbers and instructions. Also, though, these documents need to be
updated via the website and saved to the server. My experience with
web site design is rather limited (mostly just simple html), but I do
know that javascript alone will not cut it. Though not strictly
required (I could get away with using PHP or perl cgi), I'm choosing
to use Tomcat and JSP since these are technologies my company uses for
other projects. I guess I'm just looking for something like an
architectural project outline, pitfalls to watch out for, and
suggestions how to quickly get the site up and running. I've got
Tomcat installed and working, so mostly I need help with the JSP side
of things, i.e. is JSP going to be enough, or will there also have to
be some servlet programming, etc. Or, are there any packages out there
to do this rather quickly and painlessly?
Heh, the thing you want to ask yourself is, do you want to get it done or
done right? I mean, you could just do the whole thing in servlets, but then
you'll have html, programming logic and sql in the same spots. If you do it
in jsps only, then you basically have a bunch of code in your html (like
php). Neither solution is very good, but even splitting them up into
jsp/servlet isn't very smart either since you'll be doing way too much
coding. On the other hand, using a bunch of frameworks and things to make
your life easier will take more time, but the solution will be "right".
Now, if you don't know java (not javascript - that has nothing to do with
it), then you have to learn that first. In the end, you should know the
following:
- java the language
- servlets, then jsp (since jsp's are basically servlets with a different
implementation focus - the view). You'll find that servlets on their own
are just for controlling/briding your application to your jsps and not much
else.
- Springframework (
www.springframework.org): an open source framework that
makes web stuff really nice, flexible and seperates concerns very well - but
learn only when you know the core stuff
- hibernate (
www.hibernate.org): a framework that maps your objects to the
database for you and does so transparently with very little effort or
overhead - I'd still only recommend using this when you know sql and jdbc
(java's way of doing sql).
- an application server, like orion/resin/tomcat (you can't deploy your
software without an app server to put it on, so spend some time learnign
this).
- your database. if you don't know databases, you can't store persistent
information. To be honest, most web projects aren't worth doing unless you
are backed with a database. Try mysql first since it's really lightweight
and easy, then move to postgres when you graduated from that.
- jakarta-commons: there are a lot of common programming tasks that you are
bound to do over and over eventually. Look at apache jakarta commons for
some libraries to make these tasks easier.
- sitemesh: if you are going to be doing web things, you definately want
this. It allows you to decorate html (or whatever) pages with a common
layout, thus making it a lot easier to code up specific pages since you
don't have to include the header and footer on every page and you can do
this on non-jsp pages as well.
If this isn't what you signed on for, then let them know. Granted you don't
need some of the things on this list, but people with experience would just
dive into these things because they already know the concepts and it would
definately save them time. If you have no idea of the core concepts that
make up these tools (which basically means you haven't done a lot of
programming), then you can try to rough it with the very basics (keep it
simple, just use what java gives you).
However, doing what should be simple is actually not that simple unless you
know what you are doing. It's just how it is. That's why people like PHP,
because it is easier getting the small projects going, but in the end, you
are just doing scripts that don't really mean anything, have poor reuse,
execute slower when they grow and generally are a mess when they get big.
That's the tradeoff. Do it right (java) or do it fast (php).