Difference between JSP and JSF

What is the difference between JSP and JSF?
Is it necessary to learn JSP before starting with JSF?

JSP is a view technology providing a template to write plain HTML/CSS/JS in. JSP supports Java based taglibs to generate output and/or control the page flow dynamically. A well known example is JSTL. JSP also supports access to backend data with help of EL (Expression Language).
JSF is a component based MVC framework which provides taglibs for use in JSP, the JSF core tags in <f:xxx> and the JSF HTML tags in <h:xxx>. Those tags generate HTML output and are tied to JSF component tree in the server memory so that the FacesServlet can work on them to gather request parameters, validate/convert them, update the model values (javabean properties), invoke some actions (javabean action methods) and render the response.
You can use JSF on top of either JSP or Facelets. Facelets is another view technology. JSP is ancient and has its shortcomings when JSF comes into picture. Facelets is designed with JSF in mind and much more well-suited for it and provides great templating/composition capabilities to reuse specific groups of components without the need to wrap them in another custom component (so that you don't duplicate the same code over and over, e.g. label+input+message.

Similar Messages

  • What's the difference between jsp and jsf?

    who can tell me what's the difference between jsp and jsf?
    I'm puzzled when I found some of the technology in jsp is so similar to the ones in jsp( javaserver page)

    Hi,
    Find the difference between JSP and JSF
    1. A developer has more control with JSP, but (should) get easier development with JSF
    2. Event handling is done differently in JSP (HTTP) and JSF (Java)
    3. The UI is designed differently (or should be at least) with JSP (markup) and JSF (components).
    4. The end product should also be defined differently - JSP page versus a JSF application.
    Is this the only thing that is need to make a decision for either or? Probably not. There are other pieces that need to be taken in account when deciding which technology to use - tools support, enough components, type of application etc.... At this point there are not enough JSF components (although there are some interesting projects underway - Ajaxfaces, Myfaces, ADF Faces, and WebChart 3d) and enterprise tools support is still limited to a few tools vendor. Looking at our ADF Faces components they are currently available as early access (not production) and demands for these components are stacking up, literally, outside my office doorstep. Although I would love to make them production - now! - it is not a viable solution since we are still checking features and fixing critical bugs.
    All this combined - not enough enterprise level components in production, lacking tools support etc... - leave customers in a vacuum where the decision is either to continue with JSP, since it is mature and has a wide developer base, or move forward with JSF not sure if the support, or the developers will be there. This is particularly sensitive to customers that need to get started now and be production by summer.
    If you are in this vacuum here are some key points promoting JSF:
    1. Fundamental unit is the Component
    2. Built in event and state management
    3. Component sets can be provided by any vendor
    4. Closer to ASP.Net or Swing development
    5. Choice of UI technology
    6. Scale up (rich clients)
    7. Scale down (mobile devices)
    8. Built into J2EE containers in J2EE 5.0 (tentative)

  • Difference between JSTL and JSF

    Hi
    I am little bit confuse between JSTL and JSF. can one tell me what is difference between JSTL and JSF ?
    Thanks & regards,
    Ben

    from suns site
    The JavaServer Pages Standard Tag Library (JSTL) encapsulates as simple tags the core functionality common to many Web applications. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags.
    http://java.sun.com/javaee/javaserverfaces/overview.html

  • Whats the difference between *.jsp and *.jspx

    Hi
    When I create a new jsf page the first step prompts me for the "type". I am wondering what is the difference between JSP Page and JSP Document? Which should I be using? Are there any white papers or documents that explain the advantages of each?
    Also, someone suggested that I use Facelets, has anyone else used these from inside jdeveloper? Any thoughts / tips would be appreciated.
    Thanks
    troy

    JSPX uses an XML doument for you page code - it is the way we recommend you build your page. Makes for cleaner code and easier customization.
    JSP uses HTML with embedded JSF tags in it.

  • Difference between JSP and ASP

    Whatz the diff between JSP and ASP

    Hello msdnexpert,
    Active Server Pages (ASP) allows you to build rich, data driven, dynamic complex applications. ASPs are written in Perl, VBScript, C/C++. They run on machines running Microsoft Windows. With ASP, an HTML page on a web server can contain snippets of embedded code. This code is read and executed by the web server before it sends the page to the client (usually a browser such as Netscape Navigator or Microsoft's Internet Explorer.) For more information on ASP see:
    http://www.microsoft.com/workshop/server/default.asp
    or
    http://www.activeserverpages.com
    Java Server Pages (JSP) also allows you to build rich, data driven, dynamic complex applications. JSPs are written in Java. They run on any Java enabled machine, including Solarlis, Windows, Linux, and Mac OS. JSPs also makes available all of Java's industrial strength security for free. JSPs uses a syntax similar to ASP except that the scripting language is Java. Unlike ASP, JSP is an open standard implemented dozen of venders across all platforms. JSPs are closely tied to servlets because a JSP page is transformed into a servlet as part of its execution. For more information on JSP see:
    http://java.sun.com/products/jsp
    A servlet is a generic server extension -- a Java class that can be loaded dynamically to extend the functionality of a server. Servelets are commonly used with web servers, where they can take the place of CGI scripts. A servlet is similar to a proprietary server extension, except that it runs inside a Java Virtual Machine on the server side, so it is safe and portable. Servlets operate solely within the domain of the server: Unlike Applets, they do not require support for Java in the web browser.
    Unlike CGI, which must use multiple process to handle separate programs and/or separate requests, servlets can all be handled by separate threads within the same process or by threads within multiple processes spread across a number of back end servers. This means that servlets are also efficient and scalable. Because servlets run with bi-directional communication to the web server, they can interact very closely with the server to do things that are not possible with CGI. Another advantage of servlets is that they are portable: Both across operating systems and across web servers.
    Resources used in researching this response:
    Java Servlet Programing 2nd Ed by Jason Hunter with William Crawford.
    http://press.oreilly.com/jservlet2.html
    http://oreilly.com/catalog/jservlet2/
    -Merwyn,
    Developer Technical Support,
    http://www.sun.com/developers/support.

  • What's the difference between *.JSP and *.DO?

    Hi. I'm new to JSP programming and noticed that form actions call something like pageName.do -- what's the difference between the .JSP and .DO? When do you call one vs. the other? Thanks.

    A request including the jsp extension usually refers to a single JSP file on disk that will be loaded and rendered directly.
    A request including the do extension usually refers to a call into a special servlet that will redirect the request to another "controller" class which will in turn do some processing, and then load one or more JSP files to render the response.
    The commonest form of the latter is the usage in the Struts framework. The do extension is not mandatory, it just presents a convenient way to distinguish calls that should be handled by Struts from requests for JSPs and other content that are mostly handled by the container (e.g. Tomcat) directly.

  • Difference between jsp and servlets

    Can any body tell me the difference b/w jsp and servlets.
    As i know one difference is to seperate the java code from html. Is there any other difference. please...

    Servlets are a way to run java on a server. They don't necessarily need to be about HTML or even HTTP. You can write servlets that generate images rather than HTML, for example.
    JSP is a way to create servlets that generate HTML. They get translated into servlets (special-purpose servlets). This is sort of glossing over the details -- the power of JSP is that, by being an intersection between HTML and executed Java code, they can provide a way to clearly differentiate between the two.
    That's a way of looking at it anyway.

  • Difference between .jsp and jspf in weblogic

    Hi,
    A small question, what is the difference in behaviour between a jsp and jspf when doing a jsp:include.
    What is the solution when wanting to have a dynamic url to for example an image
    <img src="<%=imagepath%>image.gif">
    this works when the included file is a jsp but not when a jspf then it outputs "<img src="<%=imagepath%>image.gif">"
    Cheers,
    Johan

    >
    I am short describing the problem again,
    IN JSP, MY CODE IS LIKE THIS:
    HttpSession oSession=request.getSession(true);
    oSession.setAttribute("batchHash",reqRows);
    IN SERVLET, MY CODE IS LIKE THIS:
    HttpSession oSession=req.getSession(true);
    tblSession = (Hashtable)
    oSession.getAttribute("batchHash");
    System.out.println("IsNew ="+oSession.isNew());
    System.out.println("Object="+prmSSO);
    If I deploy this in TOMCAT, my output is like this:
    IsNew =false
    Object=Hashtable@982fc1
    If I deploy this in WEBLOGIC 6.1, my output is like
    this:
    IsNew =true
    Object=null
    Why is this?
    Why the "oSession.isNew()" returns "false" in tomcat
    and "true" in weblogic ?
    Please help....Your only problem is using
    HttpSession oSession=req.getSession(true);instead of
    HttpSession oSession=req.getSession(false);in your servlet! getSession(true) - forces to allocate new session,
    so it's absolutely clear why your Hashtable is absent in
    a newly created session!!
    Paul

  • Difference between JSP and tagdependent bodycontent in JSP Custom tags?

    Hello All,
    Can anybody tell me difference between the values of bodycontent attribute we mention in tld file?
    Can you give me some examples that practically show difference ?
    Also i want to know about BodyContent.
    Thanks in advance.

    Hi,
    I am a little confused about your point 2...... Why do you think it is not compatible?
    Well, the thing is: cause JSP is based on HTML it was easier to build nice user interfaces - and AWT always looked a little strange. As well it was easier to adapt JSP to other layout styles to run the same app on Lapotop/PDA. At the end that is pretty much it.
    MI is based on the SyncBO concept - so if you access a SyncBO in JSP or in AWT MI makes no difference and so at the end all that counts is: are you happy with AWT layout or do you need something more native/fancy/..... Well, AWT is limited in some areas - JSP give you much more. That is all limited due to the fact that up to MI7.0 MI runs on Creme with JRE1.1.8 support only.
    But MI7.1 now supports JRE1.4.2 even on PDA - and so we have SWT available - and so in 7.1 the default UI is SWT (very very basically we could say, this is the AWT direction - but really only if we really want to compare 7.0 and 7.1)
    Hopefully you got it.
    Regards,
    Oliver

  • Difference between struts and jsf

    hi
    which one you have to prefer and why?
    Please helpon this
    Thanks,
    Vijay

    Hai Vijay.
    Struts is liek dosa and JSF is liek alooparantha.
    okey?Now I'm not making fun of our brown friends here, but
    can someone recast that explanation, using only items
    that can be purchased at a Kentucky Fried Chicken, so
    that I can understand it better?Brown friends? I prefer to think of myself as "melanin-enhanced" and others as "melanin-challenged." Nonetheless, Struts can be thought of a Kentucky Fried Chicken whereas JSF is one pound of fresh, boneless chicken and a bottle of barbeque sauce.
    How's that? ;-)

  • Difference between JSP and AWT applications in MI

    HI,
    Can anyone plz clarify the difference and specific use of AWT n JSP appl in MI.
    As far as i understand:
    1)JSP works on browser based UI whereas AWT uses native UI.
    2)AWT is faster dan JSP but not compatible with SAP appl.
    3)We use AWT in appl like DSD n JSP in MAM,MSR etc.
    Plz explain in detail wat r the scenarios in which AWT can be used??
    Regards
    Priyanka

    Hi,
    I am a little confused about your point 2...... Why do you think it is not compatible?
    Well, the thing is: cause JSP is based on HTML it was easier to build nice user interfaces - and AWT always looked a little strange. As well it was easier to adapt JSP to other layout styles to run the same app on Lapotop/PDA. At the end that is pretty much it.
    MI is based on the SyncBO concept - so if you access a SyncBO in JSP or in AWT MI makes no difference and so at the end all that counts is: are you happy with AWT layout or do you need something more native/fancy/..... Well, AWT is limited in some areas - JSP give you much more. That is all limited due to the fact that up to MI7.0 MI runs on Creme with JRE1.1.8 support only.
    But MI7.1 now supports JRE1.4.2 even on PDA - and so we have SWT available - and so in 7.1 the default UI is SWT (very very basically we could say, this is the AWT direction - but really only if we really want to compare 7.0 and 7.1)
    Hopefully you got it.
    Regards,
    Oliver

  • How to share variable between jsp and JSF?

    hi:
    I have code :
    <h:dataTable binding="#{Tables.dataTable}" value="#{Tables.query}" var="currentRow">
    <h:column>
    <h:outputText value="#{currentRow['factorycode']}"/>
    </h:column>
    <%
    //here I want get upon variable currentRow and process some field.
    // but how java code I can get the currentRow,
    //currentRow is a ResultSet object
    %>
    </h:dataTable>
    thanks

    EL cannot pick up scripting variables. It picks up attributes from scope only.
    Similarly it doesnt set any scripting variables too.
    <%
                  int g_nAge=12;
                  pageContext.setAttribute ("g_nAge", new Integer(g_nAge));
    %>
    ${g_nAge}cheers,
    ram.

  • Difference between facelets and jsp xml in Document Type

    I want difference between facelets and jsp in Document Type in JDeveloper 11gR2 (11.1.2)
    Thanks
    Edited by: Amr Ahmed on Jun 8, 2011 7:46 AM

    Let's see.
    Facelets creates a facelets page
    JSP creates a JSP page
    {noformat}:){noformat}
    Facelets is the "official" view language for JSF 2.0
    http://www.realdevelopers.com/blog/development/facelets-vs-jsp should give you some more insight as well.
    John

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

  • Is there any difference between "jsp:useBean" and "scriptlet" ?

    A few days ago, I asked similar question. But I didn't get the answer I wanted.
    I want to know the differnce between <jsp:useBean../> and <% .. %>(scriptlet).
    I tested in three environments(Oracle Jserv, OC4J, and Apache Tomcat).
    In Oracle Jserv and OC4J, a problem occured. But, Apache Tomcat does not occur a problem.
    For example,
    1) TestClass.java (Bean)
    public class TestClass {
    private String txt;
    public class TestClass {
    txt = "Test"; ----- (g
    public String getTxt() {
    return txt;
    2) test.jsp
    <html><body>
    <% TestClass test = new TestClass(); %> ---(h
    <%= test.getTxt() %>
    </body></html>
    Assume that I visit "http://localhost:8888/test.jsp".
    In Tomcat, if I change "Test"(number(g) to "Test1" and compile the browser shows the change.
    But Oracle Jserv and OC4J does not do that. They also show the old String.
    So, I changed <% TestClass test = new TestClass(); %>(number(h) to <jsp:useBean id="test" class="TestClass" />. That is, I changed "Scriptlet" to "JSP useBean Tag".
    Then, Oracle Jserv and OC4J also show the changes.
    To conclude, is there any difference between "JSP useBean Tag" and "Scriptlet"?
    Can't I use a scriptlet (to make a class) in Oracle Servlet Engine?
    Thanks.

    It could be as simple as the JSP not recompiling between java recompiles - ie, it compiles in the link to the old class.
    Try changing the JSP file (add and delete a space) after you change the java code, and then see what happens.
    Jonny
    null

Maybe you are looking for

  • Not able to save purchase order

    hi i am a super user i have related the PO with the SO when i am saving the purchase order i am getting the error message " you cannot open rows in document [purchase order-rows-row status][line:0][message 131-194] Regards Manish

  • How do you use two ipods in the same itunes???

    My brother recently bought an ipod (15GB) i have been fine using my one (20GB) with my itunes on my computer. When i plug my brothers ipod in to my computer and open itunes i expect the music only about (5GB) to transfer to his ipod instead it just s

  • How to set up ApEx as a SSO partner app?

    I seem to be stuck in something of an endless loop here. I'm trying to set up the authentication for an ApEx app to use my Oracle AS SSO. When I start the wizard to create a new authentication scheme I choose "Based on a pre-configured scheme from th

  • Support for windows 2k12 R2 and Exchange 2k13 in Oracle VM 3.3.1

    We are planning to deploy Windows 2k12 R2 and exchange 2k13 in Oracle VM 3.3.1 which is based on Xen 4.3 hypervisor.  Kindly let me know whether windows 2k12 R2 and exchange 2k13 is supported on ovm 3.3.1 or not. if not then what is the possibility o

  • HR forms character format

    Hi,     How we will make a field Bolder in HR forms. Tcode PE51. Regards, Karthik.k