Need help with Tomcat/JSP website design

Z

zenshade

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?
 
J

Job Numbers

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).
 
R

Roedy Green

Or, are there any packages out there
to do this rather quickly and painlessly?

Nothing you said requires JSP, Servlets or anything other than a
vanilla HTTP server.
 
J

Job Numbers

Roedy Green said:
Nothing you said requires JSP, Servlets or anything other than a
vanilla HTTP server.

No, they need to update the info, which means you need a database, which
means you need to write software to read from and to the database.
 
R

Roedy Green

No, they need to update the info, which means you need a database, which
means you need to write software to read from and to the database.

Not necessarily. You might do that statically as I do, and upload the
results every hour or so.

I saw a demo of a tool for collaborative website generation. It
sounds very much like what you need. It was a Canadian company.

I ask around to see if anyone remembers what it was called.
 
S

Sudsy

Job said:
No, they need to update the info, which means you need a database, which
means you need to write software to read from and to the database.

No, you need J2EE! (ROTFLMAO)

There are many ways of achieving persistence short of running a
database. What about java.util.pref.Preferences or XML?
There's more than one way to skin a cat.
[Please don't call PETA or the ASPCA on me for that comment! :-( ]
 
J

Job Numbers

Sudsy said:
Job said:
No, they need to update the info, which means you need a database, which
means you need to write software to read from and to the database.

No, you need J2EE! (ROTFLMAO)

There are many ways of achieving persistence short of running a
database. What about java.util.pref.Preferences or XML?
There's more than one way to skin a cat.
[Please don't call PETA or the ASPCA on me for that comment! :-( ]

I guess, just setting up hibernate with hsql or mysql is pretty damn simple
and I could have the whole thing running a few hours.
 
S

Sudsy

I guess, just setting up hibernate with hsql or mysql is pretty damn simple
and I could have the whole thing running a few hours.

Sigh! Never approach a battle of wits unarmed.
What if the OP doesn't have access to, or any desire to, use a database?
You claim that "you need a database". No, you don't.
I offered a couple of alternative approaches. You responded that you
"could have the whole thing running a few hours". Using an outside join
perchance?
Roedy called it correctly.
Perhaps you should offer your considerable consulting experience to the
OP?
 
Z

zenshade

Job Numbers said:
Heh, the thing you want to ask yourself is, do you want to get it done or
done right? ... 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".

I definitely want to do things right (assuming I can cram enough of
the requisite knowledge into my head within a few weeks); there's a
high probability that this project could grow into many other areas.
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

I've only used Java on a few CIS lab projects, so I wouldn't say that
I knew it very well. On the other hand, I do know some other object
oriented, imperative languages (c++, python, perl), so the learning
curve is not steep at all.
- 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).

This is exactly the kind of advice I was looking for. Thank you so
much.
- 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).

I've spent the last few days wrestling with tomcat. It's workin' :).
- 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.

Have SQL, will travel.
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).

How about do it fast while also doing it as right as possible, within
some time constraints? I'm not looking for long term shortcuts,
because I do need and want very much to learn the right way, but I
also need to be able to have a preliminary but mostly functional site
within a week or two at most. In other words, I don't have time to
fully digest Java the language nuances, servlets, and JSP's, and then
frameworks. Can you recommend a somewhat safe path that doesn't lead
through a dark, entangled forest I'd have to take a few months to hack
my way out of before seeing any results?
 
J

Juha Laiho

(e-mail address removed) said:
Nothing you said requires JSP, Servlets or anything other than a
vanilla HTTP server.

.... perhaps using WebDAV functionality for updating the documents?
 
D

David Ashe

Hi zenshade,

You could use a content management system like magnolia
(www.magnolia.info) - its the best i've seen for java, and the install comes
with tomcat ready to run.

Otherwise, if this does not suit your needs, i would get eclipse
(www.eclipse.org) and use plugins like hibernator, the tomcat plugin and the
spring network plugin to make your life a lot easier developing with
hibernate, spring and tomcat.

For example, in eclipse you just save the file and its compiled, and if you
use the tomcat plugin your file is updated automatically ready to roll.. a
lot easier and quicker than making a change, saving the file, running a
compile script and [restarting tomcat or reloading the context]!!

here is a good tutorial on hibernator -
http://www-106.ibm.com/developerworks/db2/library/techarticle/0306bhogal/0306bhogal.html

and a good one on eclipse and tomcat -
http://www.3plus4software.de/eclipse/tomcat_en.html

all of these tools are open source and free.

hope this helps!

dave
realisation
 
J

Jim Cochrane

Hi zenshade,

You could use a content management system like magnolia
(www.magnolia.info) - its the best i've seen for java, and the install comes
with tomcat ready to run.

Otherwise, if this does not suit your needs, i would get eclipse
(www.eclipse.org) and use plugins like hibernator, the tomcat plugin and the
spring network plugin to make your life a lot easier developing with
hibernate, spring and tomcat.

(Sorry for the tangent.) How good (easy to use for a developer,
powerful, aiding in producing a high-quality product, etc.) are these
tools - The spring framework and hiberate (or whatever it's called)?
I'm looking at potential tools for an "open source for government" project
(Java-based web applications) and these sound like good candidates.

We also may use the eXo platform. Will these two tools integrate well with
eXo?

(These questions are for David and for anyone else who can contribute, of
course.)

Thanks!
 
M

Michael Borgwardt

Jim said:
(Sorry for the tangent.) How good (easy to use for a developer,
powerful, aiding in producing a high-quality product, etc.) are these
tools - The spring framework and hiberate (or whatever it's called)?

I don't know anything about Spring, but at my company, we've had very
good experiences with Hibernate. It's stable, full-featured, performant
and very well-documented for an open source project.
 
S

Sam

How about do it fast while also doing it as right as possible, within
some time constraints? I'm not looking for long term shortcuts,
because I do need and want very much to learn the right way, but I
also need to be able to have a preliminary but mostly functional site
within a week or two at most. In other words, I don't have time to
fully digest Java the language nuances, servlets, and JSP's, and then
frameworks. Can you recommend a somewhat safe path that doesn't lead
through a dark, entangled forest I'd have to take a few months to hack
my way out of before seeing any results?

Why not Struts? It's a framework that has been around for a while and
is widely used. You could probably download some sample code and
modify it to do a simple update in a short amount of time. It's built
around the MVC paradigm, and designed to incorporate tag libraries.
You could get into the framework wars, but I don't think you can go to
far wrong with Struts, and then branch out from there if need be.

Sam90
 
S

Sudsy

zenshade wrote:
How about do it fast while also doing it as right as possible, within
some time constraints? I'm not looking for long term shortcuts,
because I do need and want very much to learn the right way, but I
also need to be able to have a preliminary but mostly functional site
within a week or two at most. In other words, I don't have time to
fully digest Java the language nuances, servlets, and JSP's, and then
frameworks. Can you recommend a somewhat safe path that doesn't lead
through a dark, entangled forest I'd have to take a few months to hack
my way out of before seeing any results?

In that case, you could just use a servlet/JSP combination. You'll have
to perform your own session management but you could readily migrate to
Struts down the road.
- your URLs map to servlets
- the servlets perform the necessary work, and
- forward to a JSP for display
 
A

Alex Hunsley

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?

It sounds a little like you're trying to stroke a kitten with a hammer:
overkill.
If you need a database backed site, consider looking at existing content
management systems rather than trying to write one from scratch in a
very short amount of time (when you're not experienced in the field
either)...

alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top