This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes about JSP's role in a j2ee project. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

about JSP's role in a j2ee project.

Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
I know that JSP is for presentation layer, Servlet for controller, and EJB for business layer.

I graduated last year and now involved a project that uses BACKBASE ajax framework as front end implementation,

it seems that JSP is not used at all in our project,

  • my question is that is JSP getting out of date?
  • or it is because jSP is not the best option for front-end tech in some context (e.g. in my project)?
  • is js dom the alternative to jsp?




  • ** SCJP 5.0 84% **
    ** SCWCD 1.5 76% **
    Jesus Angeles
    Ranch Hand

    Joined: Feb 26, 2005
    Posts: 2046
    Servlet/Jsp technology is good at what it does - at the server.

    Backbase's Ria runs on the front-end.

    They can run together.

    What web server technology are you using (e.g. php, asp) ? Arent you using its server technology below the Ria?
    Chrix Wu
    Ranch Hand

    Joined: Nov 15, 2009
    Posts: 121
    Jesus Angeles wrote:Servlet/Jsp technology is good at what it does - at the server.

    Backbase's Ria runs on the front-end.

    They can run together.

    What web server technology are you using (e.g. php, asp) ? Arent you using its server technology below the Ria?


    no php, no asp, etc.

    Backbase has its own java module (backbase dataService) that works in the back-end. this dataService module receives request sent from backbase front-end widget, and dispatch the request to corresponding back-end ActionHandlers, which then access the persistence layer, and returns data.

    Backbase back-end uses Servlet to implement the MVC pattern, but in the project there is no JSP, which should usually be the presentation layer.

    so what confused me is that , why no JSP? in what context JSP should be used? and what is the alternative to JSP in our project.
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 39576
        
      27
    Only you can find out what is used instead of JSP in your project.

    There are other templating frameworks which -although not as popular as JSP- work well, too; Apache Velocity and FreeMarker come to mind. (The latter is what gets used for running these very forums here - which use no JSPs.)


    Ping & DNS - updated with new look and Ping home screen widget
    Chrix Wu
    Ranch Hand

    Joined: Nov 15, 2009
    Posts: 121
    Ulf Dittmer wrote:Only you can find out what is used instead of JSP in your project.

    There are other templating frameworks which -although not as popular as JSP- work well, too; Apache Velocity and FreeMarker come to mind. (The latter is what gets used for running these very forums here - which use no JSPs.)


    the backbase front-end is using ajax widgets which based on js/css/html,

    so can i say that our project uses html/ajax rather than JSP to produce page??

    so html/ajax is a substitution for JSP?
    Jesus Angeles
    Ranch Hand

    Joined: Feb 26, 2005
    Posts: 2046
    Chrix Wu wrote:
    Jesus Angeles wrote:Servlet/Jsp technology is good at what it does - at the server.

    Backbase's Ria runs on the front-end.

    They can run together.

    What web server technology are you using (e.g. php, asp) ? Arent you using its server technology below the Ria?


    no php, no asp, etc.

    Backbase has its own java module (backbase dataService) that works in the back-end. this dataService module receives request sent from backbase front-end widget, and dispatch the request to corresponding back-end ActionHandlers, which then access the persistence layer, and returns data.

    Backbase back-end uses Servlet to implement the MVC pattern, but in the project there is no JSP, which should usually be the presentation layer.

    so what confused me is that , why no JSP? in what context JSP should be used? and what is the alternative to JSP in our project.


    Jsp IS (becomes) a servlet. You just dont need jsp as you have your own way to generate your html, whatever it is. You seem to focus on the fact that Jsp should be tight in user interface stuff. That would be nice; but its focus is on html generation, on the server, not on the browser.
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 39576
        
      27
    AJAX can't be the only solution. Something needs to create the HTML pages in which the AJAX JavaScript code is embedded. Or maybe that's static HTML?
    Jesus Angeles
    Ranch Hand

    Joined: Feb 26, 2005
    Posts: 2046
    Chrix Wu wrote:
    Ulf Dittmer wrote:Only you can find out what is used instead of JSP in your project.

    There are other templating frameworks which -although not as popular as JSP- work well, too; Apache Velocity and FreeMarker come to mind. (The latter is what gets used for running these very forums here - which use no JSPs.)


    the backbase front-end is using ajax widgets which based on js/css/html,

    so can i say that our project uses html/ajax rather than JSP to produce page??

    so html/ajax is a substitution for JSP?


    Not enough. You need a dynamic html language like jsp, asp, or those mentioned by Ulf. Html alone, as you know, is dead static.
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 39576
        
      27
    Jesus Angeles wrote:Html alone, as you know, is dead static.

    Not if it's got JavaScript embedded that retrieves data via AJAX and creates HTML on the client accordingly.
    Chrix Wu
    Ranch Hand

    Joined: Nov 15, 2009
    Posts: 121
    Jesus Angeles wrote:

    Jsp IS (becomes) a servlet. You just dont need jsp as you have your own way to generate your html, whatever it is. You seem to focus on the fact that Jsp should be tight in user interface stuff. That would be nice; but its focus is on html generation, on the server, not on the browser.


    OK. now that is clear. thank you.

  • if we do it in JSP/SERVLET, the JSP is compiled into a SERVLET, which in turn produces the html page.
  • however, in our project, the page is produce/refresh on the client side using ajax. so no need to use JSP. and SERVLET is still used to represent the Controller Layer.


  • Chrix Wu
    Ranch Hand

    Joined: Nov 15, 2009
    Posts: 121
    forget to mention that this project is a single page project that serves as a dashboard , and the single page has a set of widgets. these widgets send ajax request to server side, and updates its view.

    actually, my question is:

    In what kind of project, JSP is the best way to go?
    Jesus Angeles
    Ranch Hand

    Joined: Feb 26, 2005
    Posts: 2046
    Chrix Wu wrote:forget to mention that this project is a single page project that serves as a dashboard , and the single page has a set of widgets.



    Ya, and as mentioned, ajax can give you a lot of things. The page seems to be a single page, but ajax is enough to serve an entire website, just as Ulf has mentioned - it could be a front-end framework, and at a extreme, as single html, that uses ajax to get all stuff from the server, and that single html (with javascript) displays what the ajax extracted from the server.
    Jesus Angeles
    Ranch Hand

    Joined: Feb 26, 2005
    Posts: 2046
    Chrix Wu wrote:forget to mention that this project is a single page project that serves as a dashboard , and the single page has a set of widgets. these widgets send ajax request to server side, and updates its view.

    actually, my question is:

    In what kind of project, JSP is the best way to go?


    Jsp is nice, but may be boring if used alone. We have struts, and other frameworks to make working with jsps better.

    Jsp can be enough in many cases (assuming with a framework like struts, or spring mvc, etc.). Many enterprise applications use just that. And of course, jsp can work will all that nice stuff - ajax, dojo, etc.

    There also are non-jsp alternatives that Ulf mentioned, like FreeMarker.

    Really, there has to be something that backbase is using: pure html+ajax is very extreme. Maybe you can help us understand what backbase is, by finding out what backbase uses in addition to html and ajax - especially, on what it uses on generating html - if it does?
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 60072
        
      65

    Jesus Angeles wrote:Jsp is nice, but may be boring if used alone. We have struts, and other frameworks to make working with jsps better.

    There are those, myself included, who would say that such frameworks makes JSPs harder to use, not easier. But that's another topic...

    To answer the original question, JSP is a server-side templating engine. It is used whenever dynamic data needs to be merged into client-side markup before the page is sent to the browser.

    If there is no need to merge dynamic data into the markup, no templating is needed. I'd say that such projects and environments are rare on the general web.

    The project I am working on right now uses no JSPs because the server is an under-powered embedded system that can barely manage page serving. Thus, all work is relegated to the client using client-side templating. This is a very unique and rare situation.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    sheng tadena
    Greenhorn

    Joined: Feb 01, 2013
    Posts: 4

    hi..
    may i ask, what is/are the possible job/s if you have finish studying JSP or ??
    just wondering...maybe someone would want to answer my question..thanks...!
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 60072
        
      65

    Please ask that sort of question in the jobs discussion forum; it has little to do with the original question.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: about JSP's role in a j2ee project.
     
    Similar Threads
    SCEA Part II - Client side
    Where to place the context.xml correctly.
    Question about transactional attribute and session beans....
    Reference material on Struts, Hibernate, Business laye
    Using stored procedures in entity beans