Which do I use for web design?

Discussion in 'Java' started by jmDesktop, Jun 3, 2008.

  1. jmDesktop

    jmDesktop Guest

    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.
    jmDesktop, Jun 3, 2008
    #1
    1. Advertising

  2. jmDesktop

    Mark Space Guest

    jmDesktop wrote:
    > 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.
    Mark Space, Jun 4, 2008
    #2
    1. Advertising

  3. jmDesktop

    Arne Vajhøj Guest

    jmDesktop wrote:
    > 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
    Arne Vajhøj, Jun 4, 2008
    #3
  4. jmDesktop

    Roedy Green Guest

    On Tue, 3 Jun 2008 13:55:03 -0700 (PDT), jmDesktop
    <> wrote, quoted or indirectly quoted someone
    who said :

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

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jun 4, 2008
    #4
  5. jmDesktop

    Arne Vajhøj Guest

    Roedy Green wrote:
    > On Tue, 3 Jun 2008 13:55:03 -0700 (PDT), jmDesktop
    > <> wrote, quoted or indirectly quoted someone
    > who said :
    >> If you were starting a web project from scratch, which technology
    >> would you use

    >
    > Giant projects will go J2EE routes.
    >
    > Tiny ones JSF.


    JSF is part of Java EE.

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


    Why not pure JSP's ?

    > Mid size ones templates.


    Velocity ??

    > Commercial ones are all going AJAX which I consider nuts.


    AJAX is client side.

    Arne
    Arne Vajhøj, Jun 4, 2008
    #5
  6. jmDesktop

    jmDesktop Guest

    On Jun 3, 7:19 pm, Mark Space <> wrote:
    > jmDesktop wrote:
    > > 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 know about them. I've seen them. I don't want one yet. I want to
    learn myself.



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


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


    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.
    jmDesktop, Jun 4, 2008
    #6
  7. jmDesktop

    jmDesktop Guest

    On Jun 3, 8:52 pm, Arne Vajhøj <> wrote:
    > Roedy Green wrote:
    > > On Tue, 3 Jun 2008 13:55:03 -0700 (PDT), jmDesktop
    > > <> wrote, quoted or indirectly quoted someone
    > > who said :
    > >> If you were starting a web project from scratch, which technology
    > >> would you use

    >
    > > Giant projects will go J2EE routes.

    >
    > > Tiny ones JSF.

    >
    > JSF is part of Java EE.


    I thought all of these were parts of J2EE.

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

    >
    > Why not pure JSP's ?


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

    > > Mid size ones templates.

    >
    > Velocity ??
    >
    > > Commercial ones are all going AJAX which I consider nuts.

    >
    > AJAX is client side.
    >
    > Arne


    Thanks.
    jmDesktop, Jun 4, 2008
    #7
  8. jmDesktop

    Arne Vajhøj Guest

    jmDesktop wrote:
    > On Jun 3, 8:52 pm, Arne Vajhøj <> wrote:
    >> Roedy Green wrote:
    >>> On Tue, 3 Jun 2008 13:55:03 -0700 (PDT), jmDesktop
    >>> <> wrote, quoted or indirectly quoted someone
    >>> who said :
    >>>> If you were starting a web project from scratch, which technology
    >>>> would you use
    >>> Giant projects will go J2EE routes.
    >>> Tiny ones JSF.

    >> JSF is part of Java EE.

    >
    > I thought all of these were parts of J2EE.


    To maximize confusion SUN changed the name of J2EE to Java EE.

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

    >> Why not pure JSP's ?

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


    Pure xxxx = a solution with only xxxx.

    Arne
    Arne Vajhøj, Jun 4, 2008
    #8
  9. jmDesktop

    Arne Vajhøj Guest

    jmDesktop wrote:
    > On Jun 3, 7:19 pm, Mark Space <> wrote:
    >> 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.


    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
    Arne Vajhøj, Jun 4, 2008
    #9
  10. jmDesktop

    Mark Space Guest

    jmDesktop wrote:

    >
    > 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.
    Mark Space, Jun 4, 2008
    #10
  11. jmDesktop

    Roedy Green Guest

    On Tue, 03 Jun 2008 20:52:46 -0400, Arne Vajhøj <>
    wrote, quoted or indirectly quoted someone who said :

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

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

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jun 4, 2008
    #11
  12. jmDesktop

    Roedy Green Guest

    On Tue, 3 Jun 2008 18:46:14 -0700 (PDT), jmDesktop
    <> wrote, quoted or indirectly quoted someone
    who said :

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

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jun 4, 2008
    #12
  13. jmDesktop

    Roedy Green Guest

    Roedy Green, Jun 4, 2008
    #13
  14. jmDesktop wrote:
    > 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
    Silvio Bierman, Jun 4, 2008
    #14
  15. jmDesktop

    David Segall Guest

    jmDesktop <> wrote:


    >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.
    David Segall, Jun 4, 2008
    #15
  16. jmDesktop

    jmDesktop Guest

    On Jun 4, 12:42 am, Mark Space <> wrote:
    > jmDesktop wrote:
    >
    > > 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.


    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.
    jmDesktop, Jun 4, 2008
    #16
  17. jmDesktop

    jmDesktop Guest

    On Jun 4, 8:41 am, Lew <> wrote:
    > Mark Space wrote:
    > > jmDesktop wrote:
    > >> 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.

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


    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.
    jmDesktop, Jun 4, 2008
    #17
  18. jmDesktop

    Arne Vajhøj Guest

    Roedy Green wrote:
    > On Tue, 03 Jun 2008 20:52:46 -0400, Arne Vajhøj <>
    > wrote, quoted or indirectly quoted someone who said :
    >>> Ones you have get ready soon without a long learning curve, pure
    >>> Servlets.

    >> Why not pure JSP's ?

    >
    > 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
    Arne Vajhøj, Jun 5, 2008
    #18
  19. Lew wrote:
    > 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
    Arne Vajhøj, Jun 5, 2008
    #19
  20. Lew wrote:
    > Arne Vajhøj wrote:
    >> I would argue that the XML and database stuff belong in the model.

    >
    > 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
    Arne Vajhøj, Jun 6, 2008
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page