Which do I use for web design?

J

jmDesktop

If you were starting a web project from scratch, which technology
would you use? I have looked at various. I saw "regular" jsp
scriplets, servlets emitting html, JavaBeans, JSTL, EL, JSF, and then
frameworks (or is JSF a framework?)

Outside of using frameworks, what would you use? It is a webpage that
could develop into a homemade CMS. Probably use MySQL to store
account information.

I've been thinking about it and I can't bring myself to use any
embedded code like PHP, Classic ASP or older JSP constructs, or
emitted HTML. So, it appears that I would use JavaBeans, servlets to
talk to those JavaBeans and HTML files that have EL in them.

Is this a "good" way to do things? Or should I try JSF which seems
very popular.

I digress, but the security aspect of it seems like something that is
missing from many of the frameworks I have seen and nothing in JSP
like ASP.NET has, which is why I mention the MySQL above.

Thank you.
 
M

Mark Space

jmDesktop said:
If you were starting a web project from scratch, which technology
would you use? I have looked at various. I saw "regular" jsp
scriplets, servlets emitting html, JavaBeans, JSTL, EL, JSF, and then
frameworks (or is JSF a framework?)

All those, except the part about emitting HTML.
Outside of using frameworks, what would you use? It is a webpage that
could develop into a homemade CMS. Probably use MySQL to store
account information.

There are CMS systems available that are written in Java. Do a search.

I've been thinking about it and I can't bring myself to use any
embedded code like PHP, Classic ASP or older JSP constructs, or
emitted HTML. So, it appears that I would use JavaBeans, servlets to
talk to those JavaBeans and HTML files that have EL in them.

Talking to JavaBeans seems ok to me. Maybe look into a framework like
Hibernate and Spring. The rest are I don't care for either.

Is this a "good" way to do things? Or should I try JSF which seems
very popular.

Look into a few of the frameworks. Make some mock ups and decide which
works well for you. Don't ignore IDEs, builders, etc., which can make
you life much easier.

JSF is a framework, and I think really just for user interface
components. It's like AJAX. Centered on stuff that runs in the
browser. It's not a full framework, JSF sites still use Hibernate or
whatever to manage back-end stuff.

You will need a mix of frameworks. Each one does something specific.
None that I know of is a "full" framework.

I digress, but the security aspect of it seems like something that is
missing from many of the frameworks I have seen and nothing in JSP
like ASP.NET has, which is why I mention the MySQL above.

What does ASP.NET do? I'd think that no security framework replaces
good design, technical understanding and rigorous testing, but I bet MS
promotes their products that way.
 
A

Arne Vajhøj

jmDesktop said:
If you were starting a web project from scratch, which technology
would you use? I have looked at various. I saw "regular" jsp
scriplets, servlets emitting html, JavaBeans, JSTL, EL, JSF, and then
frameworks (or is JSF a framework?)

+: servlet, JSP, JavaBeans, EL, JSTL, JSF

-: scriptlet in JSP, emitting HTML in servlets
Outside of using frameworks, what would you use? It is a webpage that
could develop into a homemade CMS. Probably use MySQL to store
account information.

I've been thinking about it and I can't bring myself to use any
embedded code like PHP, Classic ASP or older JSP constructs, or
emitted HTML. So, it appears that I would use JavaBeans, servlets to
talk to those JavaBeans and HTML files that have EL in them.

the request get routed to a servlet (very likely one in the framework
not written by you), that servlet calls some Java code and in the end
forward to a JSP page where EL, JSTL and possible other taglibs extract
data from JavaBeans to produce output.
I digress, but the security aspect of it seems like something that is
missing from many of the frameworks I have seen and nothing in JSP
like ASP.NET has, which is why I mention the MySQL above.

All servlet containers support container managed security and has
for many many years.

Arne
 
R

Roedy Green

If you were starting a web project from scratch, which technology
would you use

Giant projects will go J2EE routes.

Tiny ones JSF.

Ones you have get ready soon without a long learning curve, pure
Servlets.

Mid size ones templates.

Commercial ones are all going AJAX which I consider nuts.

I think the word SHOULD be using either a combination of client/server
side Java with either generic Applets or generated Applets.
 
J

jmDesktop

All those, except the part about emitting HTML.




There are CMS systems available that are written in Java.  Do a search.

I know about them. I've seen them. I don't want one yet. I want to
learn myself.


Talking to JavaBeans seems ok to me.  Maybe look into a framework like
Hibernate and Spring.  The rest are I don't care for either.




Look into a few of the frameworks.  Make some mock ups and decide which
works well for you.  Don't ignore IDEs, builders, etc., which can make
you life much easier.

I'm using NetBeans. Not really wanting a framework yet. Trying to
learn myself.
JSF is a framework, and I think really just for user interface
components.  It's like AJAX.  Centered on stuff that runs in the
browser.  It's not a full framework, JSF sites still use Hibernate or
whatever to manage back-end stuff.

You will need a mix of frameworks.  Each one does something specific.
None that I know of is a "full" framework.




What does ASP.NET do?  I'd think that no security framework replaces
good design, technical understanding and rigorous testing, but I bet MS
promotes their products that way.

It has a "thing" where you can use security components and using MS
Sql Server and Visual Studio you can create a login portal app fairly
quickly.

Thanks.
 
A

Arne Vajhøj

jmDesktop said:
I thought all of these were parts of J2EE.

To maximize confusion SUN changed the name of J2EE to Java EE.
What is "pure servlets"? I don't want to emit html code from
servlets.

Pure xxxx = a solution with only xxxx.

Arne
 
A

Arne Vajhøj

jmDesktop said:
It has a "thing" where you can use security components and using MS
Sql Server and Visual Studio you can create a login portal app fairly
quickly.

Java EE has supported something similar since before .NET 1.0 was
released.

Container managed security is the term.

To be fair - the out of the box functionality is typical
simpler than what ASP.NET provides - just usernames, passwords
and roles in the database, but that is sufficient for a simple app.

Arne
 
M

Mark Space

jmDesktop said:
I'm using NetBeans. Not really wanting a framework yet. Trying to
learn myself.

Ah ha. Well check out this site and their Java EE page, it will help.

http://javapassion.com/

http://www.javapassion.com/j2ee/

It's a confusing, broad subject. Sang Shin does a good job of sorting
out the basics. It looks like the next course is starting up in one
month, so you're well just in time to jump on the site and take his free
course.
 
R

Roedy Green

Why not pure JSP's ?

It is one less thing to learn. JSP is one of a dozens of template
engines all of which strike me as bailing wire. They smell of
Dartmouth basic in their ugly syntax.

A JSP-like language is possible, but it needs someone like Niklaus
Wirth to define a clean syntax. I have yet to see anything even as
clean as Java.
 
R

Roedy Green

What is "pure servlets"? I don't want to emit html code from
servlets.

If you did not know any of the server side technology, and needed to
put a tiny bit of server-side intelligence into a web page in minimal
elapsed time, then pure Servlet would be the way to go, on the
grounds you would not need to learn any template engine. You could use
something like Quoter to convert web pages into Java string literals.

http://mindprod.com/applet/quoter.html

you could whip up a web page or two as Java literals far faster than
you could figure out one of the template engines including all the
deployment.

If the project were to grow or to require frequently maintenance, then
it would pay to invest the time learning a template engine.

Doing one small project that way might be a good intermediate learning
step before tackling the complexity of a template engine. Then you
would much better understand what the template engine were up to.
 
S

Silvio Bierman

jmDesktop said:
If you were starting a web project from scratch, which technology
would you use? I have looked at various. I saw "regular" jsp
scriplets, servlets emitting html, JavaBeans, JSTL, EL, JSF, and then
frameworks (or is JSF a framework?)

Outside of using frameworks, what would you use? It is a webpage that
could develop into a homemade CMS. Probably use MySQL to store
account information.

I've been thinking about it and I can't bring myself to use any
embedded code like PHP, Classic ASP or older JSP constructs, or
emitted HTML. So, it appears that I would use JavaBeans, servlets to
talk to those JavaBeans and HTML files that have EL in them.

Is this a "good" way to do things? Or should I try JSF which seems
very popular.

I digress, but the security aspect of it seems like something that is
missing from many of the frameworks I have seen and nothing in JSP
like ASP.NET has, which is why I mention the MySQL above.

Thank you.

The first thing is to try and understand the basic mechanisms. Servlets
will expose these most clearly. Write some servlet code emitting HTML
and handling user input sent back from the browser. Just to get a feel
of what happens at the core level.

I will assume you are already familiar with databases and have possibly
already decided upon some data storage strategy. If not you will have to
learn about that as well.

Then start looking at frameworks and try to discover what they cover and
how they do it. Focus on what the consequences are for the code you have
to write. Decide if you find it sufficiently simple, fast (coding-time
wise) and easy to modify when the target system evolves.

Try not to become dogmatic. Emitting HTML from servlets is not a bad
thing, in fact all frameworks use servlets to emit HTML. Writing
application level code that use print-like commands to generate HTML,
however, is bad and you should stay away from that.

My main point is that a smart and layered design is much more important
than conforming to monkey-rules. It is not bad to use plain JDBC but if
you do you should do it wisely and create an isolated layer that embeds
the JDBC logic and hides it for the rest of the system. The same thing
goes for emitting HTML from servlets or using plain TCP sockets. If a
sufficiently fitting framework for some required functionality is
available do not hesitate to use it. On the other hand, a set of good
frameworks does not a good system make.

Silvio
 
D

David Segall

I'm using NetBeans. Not really wanting a framework yet. Trying to
learn myself.
In that case I suggest you visit
<http://www.netbeans.org/kb/trails/web.html> and choose the Visual Web
Application Development tutorial that most closely matches the
application you want to write. In a day you will have a working Java
Server Faces application. From there, you can admire all the work that
NetBeans did for you and modify the code to learn how JSF, Beans and
Java server code work together.
 
J

jmDesktop

Ah ha.  Well check out this site and their Java EE page, it will help.

http://javapassion.com/

http://www.javapassion.com/j2ee/

It's a confusing, broad subject.  Sang Shin does a good job of sorting
out the basics.  It looks like the next course is starting up in one
month, so you're well just in time to jump on the site and take his free
course.

Believe it or now that is where I have been already (from a suggestion
here.) The subject is so broad though that I don't know where to
start. It's not really like it was when I started asp.net. It was
pretty straight forward. Using Sun's web technologies, while not so
hard to understand when broken down, are hard when you put them all
together. I'm left feeling, they had a way of doing it, added a new
way, kept the old way, just kept adding new stuff. And a new person
is left not know where to start to sit down and just write a web app
from scratch.
 
J

jmDesktop

Ditto, except the part about scriptlets.  Good thing the OP put the "regular"
in quotes.  Scriptlets and servlets emitting HTML are two sides of the same
bad penny.

What exactly, OP, do you mean by "JavaBeans"?  One can hardly write any Java
program these days without using Beans at least a little.

Also your axiom is flawed.  "If you were starting a web project from scratch"
is vague and overbroad.  If you were building a house, would you use pine or
marble?

I simply meant using JavaBeans in the program somewhere because that
seems to be the right way to build things. Probably to do database
communications.

Scratch was in the context of the given tools. I meant using those
tools and technologies, unless I should be using something else, what
should I do. I think I look around at the netbeans web application
learning trail for a while and see what they have.
 
A

Arne Vajhøj

Roedy said:
It is one less thing to learn. JSP is one of a dozens of template
engines

JSP is not a template engine.

And JSP is standardized.
> all of which strike me as bailing wire. They smell of
Dartmouth basic in their ugly syntax.

It is significant easier to write JSP pages than servlets.

Arne
 
A

Arne Vajhøj

Lew said:
The Model instance munches on the parameters and their values, and
creates some kind of result, perhaps an instance of a custom Result type.

The Controller pops the Result (or possibly the Model object itself)
into a request attribute (not a parameter), then compares the screen
name and the outcome of the Model against yet another Map.
The JSP contains only tags, EL and HTML. The JSTL can handle XML and
database stuff,

I would argue that the XML and database stuff belong in the model.

Arne
 
A

Arne Vajhøj

Lew said:
I agree with you.

However, for the OP's purpose the availability of tags for some of that
might be a cheesy shortcut.

Yep.

And those tags are actually quite cool.

But if you start creating model classes, then I believe that
it will be difficult avoiding moving the persistence to those
(or below those).

Arne
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top