Comparing JSP and JSF, which 1 better?

Currently i need to run a new project. Now i need to choosing 1 of the language to coding my project. Which 1 is better to use?
In this project i have to include the web page that using JSP scriptlet to code because this project is create a dynamic menu to link up all web application. Is the JSF can link to JSP and JSP can link back to JSF?

Welcome to SCN.
Please read forum rules (you'll see that you must search the forum first (your question is already answered))

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

  • SQLJ JSP and SERVLETS which Environment?

    Hello,
    I am attempting to run the samples on Chapter 5 of the
    following documents with partial success.
    http://technet.oracle.com/docs/products/oracle8i/doc_library/817_
    doc/java.817/a83726/oraext2.htm
    http://download-west.oracle.com/otndoc/oracle9i/901_doc/java.901/
    a90208/oraext.htm#1015820
    1. Do I need the Apache+Jserv environment to run SQLJ and JSP?
    2. What do I need to do run SQLJ on oc4j if possible?
    3. I dont know how to load(?) and/or run this .sqljsp file.
    <%@ page language="sqlj"
    import="sqlj.runtime.ref.DefaultContext,oracle.sqlj.runtime.Oracl
    e" %>
    <HTML>
    <HEAD> <TITLE> The SQLJQuery JSP </TITLE> </HEAD>
    <BODY BGCOLOR="white">
    <% String empno = request.getParameter("empno");
    if (empno != null) { %>
    <H3> Employee # <%=empno %> Details: </H3>
    <%= runQuery(empno) %>
    <HR><BR>
    <% } %>
    <B>Enter an employee number:</B>
    <FORM METHOD="get">
    <INPUT TYPE="text" NAME="empno" SIZE=10>
    <INPUT TYPE="submit" VALUE="Ask Oracle");
    </FORM>
    </BODY>
    </HTML>
    <%!
    private String runQuery(String empno) throws
    java.sql.SQLException {
    DefaultContext dctx = null;
    String ename = null; double sal = 0.0; String hireDate = null;
    StringBuffer sb = new StringBuffer();
    try {
    dctx = Oracle.getConnection("jdbc:oracle:oci8:@", "scott",
    "tiger");
    #sql [dctx] {
    select ename, sal, TO_CHAR(hiredate,'DD-MON-YYYY')
    INTO :ename, :sal, :hireDate
    FROM scott.emp WHERE UPPER(empno) = UPPER(:empno)
    sb.append("<BLOCKQUOTE><BIG><B><PRE>\n");
    sb.append("Name : " + ename + "\n");
    sb.append("Salary : " + sal + "\n");
    sb.append("Date hired : " + hireDate);
    sb.append("</PRE></B></BIG></BLOCKQUOTE>");
    } catch (java.sql.SQLException e) {
    sb.append("<P> SQL error: <PRE> " + e + " </PRE> </P>\n");
    } finally {
    if (dctx!= null) dctx.close();
    return sb.toString();
    %>
    I named above file as test2.sqljsp then I tried these procedures:
    a) $ ojspc test2.sqljsp --these created all the files
    b) $ loadjava -u -v scott/tiger _test2.class -resolve
    this generated:
    initialization complete
    loading : _test2
    creating : _test2
    resolver :
    resolving: _test2
    errors : _test2
    ORA-29521: referenced name test2$_jsp_StaticText could not
    be found
    ORA-29521: referenced name test2SJProfileKeys could not be
    found loadjava: 2 errors
    c) listed the directory and both these files are there but it
    cannot resolve or find it?
    d) I recall reading something about publishjsp command but I have
    to establish a session shell with OSE? this part is very
    confusing and am not sure what to do here.
    e) not sure if i need to publish the loaded class (create a
    procedure? so it can be known to the rest of plsql?)
    A step by step procedure is very much appreciated. fyi.. I
    have Oracle 8.1.7, + oc4j, I can run sqlj from command line
    and class files generated I can run. I can also run JSP and
    servlets on the oc4j accessing the database. It is this SQLJ
    that throws me off balance. If you include Jdeveloper steps
    ro run SQLJ thats also welcome.
    Thanks in advance for kind responses posted.

    In many Model-View-Controller web applications implemented using J2EE, servlets are as controllers to direct the flow between the model and view. While servlets can output HTML code directly, it is much better to use JSPs for the most part. JSPs contain HTML and possibly Java scriptlets. The J2EE container will typically compile JSPs into servlets. While you could use a JSP as a controller, there are drawbacks to that approach. To minimize the amount of Java code in your JSPs, you can either use the tags provided by the JSP spec or use tag libraries written by someone else or yourself. See the JSTL for one such example.
    Also see:
    http://wiki.java.net/bin/preview/Javapedia/MVC
    http://wiki.java.net/bin/view/Javapedia/JavaServerPages

  • When comparing scripts and smartforms which is better

    hi can you please help out the advantages and disadvantages of scripts and smartforms

    Welcome to SCN.
    Please read forum rules (you'll see that you must search the forum first (your question is already answered))

  • Can a Servlet be used for Storing Objects with both JSP and JSF used on it?

    Hi,
    Pages I have:
    SearchEmployee.jsp
    This page has a search engine that search out the Employee. This Employee Object will be stored inside a Servlet(controller) for future references by other pages. I used JSP, html tags for forms, and request.getParameter() to built this search engine.
    Problem:
    I have a JSF Form that wants to DISPLAY the employee which I have found in my Search Engine. How can I get the JSF's value="#{Controller.employeeObj.name}" to get the value from the object?
    This seems logical as my JSF form is just retrieving the stored object in the Controller. I currently cant seem to output it

    The servlet shouldn't be used to store ANY data, let alone data to be accessed by other sevlets. Put the object into the Session object.

  • Problem with index.jsp and JSF

    hi all
    I have an index page "index.jsp" in the root directory of deployed project and in that page there is just a <jsp:forward> tag:
    <jsp:forward page="pages/mainPage.jsf" />I am using facelets and I have a template.xhtml
    when I run the browser nothing will be desplayed. by looking at Tomcat console, it seems that it renders the template.xml. if I place the path of the page directly in the address bar of browser, everything is OK
    http://localhost:8080/myproject/pages/mainPage.jsf
    but if I put following, it doesnt work.
    http://localhost:8080/myproject/
    I set the welcome-page to index.jsp in web.xml, and my pages are located in a directory namely "pages"
    any help will be appreciated.
    regards
    Mohammad

    I'm not sure what the problem is exactly. This topic might help though:
    http://forum.java.sun.com/thread.jspa?threadID=696586
    Be sure to read right to the bottom. You may be able to try a couple other things.
    Hope this helps,
    CowKing

  • Masters Project:  Comparing Struts and JSF

    I'm doing a research paper for my MSCS degree at Rensselaer at Hartford, comparing the efficiency/effectiveness of using Struts alone, vs. adding JSF. I'm learning both as I go, but with a decent base in J2EE web apps.
    Would you consider sharing your experience and opinions, in a response to my questionnaire? It's in development, and I expect it will ask 5 questions on your background, and 10 -15 question on your experiences with the Struts/JSF comparison.
    The questionnaire should be available later today. Results need to be compiled in 7-10 days.
    Can you help? If so, I'll send you the questionnaire, either as a forum reply or direct email - your choice.

    Thank you, Sergei -- that is a helpful reference.
    In addition, though, I am obliged to analyze questionnaire responses as part of my research paper. Would you like to participate?

  • Mixing HTML and JSF or better pure JSF Tags?

    I'm relatively new to JSF, but i can say, i work with all the Web Standards in HTML and CSS.
    So the HTML Render Results of JSF may not fit into a Web Developers Dreams of perfect HTML/CSS.
    An Option i see is to use HTML and put only the dynamic parts in there as JSF Components.
    What are the Pro's and Con's using HTML?
    some stuff i can image:
    Using pure JSF:
    - May many components have impact to the performance?
    - Mixed with HTML: What if the application should be rendered to another client pc (e.g. Mobile)?
    What are your experiences?

    The one downfall of mixing html with jsf, unless you use the f:verbatim tag, that the page is not properly represented in the component tree. Also depending on certain technologies you use (when I used ajax4jsf it worked this way) that the jsf component tree was rendered and then all the html was rendered at the end. This caused html tags and text that I had inside a jsf tag to be improperly displayed.
    This though was the case when I was originally using jsf 1.1, so it may have been improved in later editions, but since I have become accustomed to writing the entire page in jsf tags I have not really tested that limit in the current version.

  • Image size is dismatch in jsp and jpg which java made

    this is my java code to create image:
    image = new BufferedImage(500, 300, 1);
    then generate jpg file
    my jsp content:
    <img border=0 height=300 src="../../images/W30_2_0010.jpg" width=500>
    but the image show on browser is smaller than the size I set in jsp
    Why?

    Sorry...I made a mistake
    It is no problem between them.

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

  • Comparing JSP ,PHP AND ASP

    Hello
    Can you send me few reasons why is JSP better then ASP nad PHP.
    Thanks Jelena

    I don't know much of PHP but I can defintely compare it to ASP. ASP is a Windows proprietary technology that runs primarily on Windows machines. It uses either JavaScript or VBScript as the underlying language and has some limitations. For one there is the lack of multithreading which makes tasks that require asyncronous processing rather difficult. VBScript is a subset of Visual Basic which means there are a lot of things (objects and such) left out. You can create objects encompassing anymissing functionality out of COM using a CreateObject statement but if the objects were created using Visual Basic then there are threading issues that severly limit the amount of concurrent access. There is no direct support for polymorphism and inhereitance in VB which means Visual Basic is not a true object oriented language.
    JSP overcomes all of these limitations by using Java as the underlying programming language. Java has language level support for threading that eases the burden of concurrent access and makes asynchronous tasks a snap. It is based on the J2EE standard rather than a proprietary technology. There are various implementations of this standard that allow you to plug JSP apps into virtually any webserver running on almost any hardware. Java includes direct support for polymorphism and inheritance making it a true object oriented language.
    ASP.Net/VB.Net overcomes all of the mistakes made with ASP/VB by mimicking the Java/JSP platform. This shows that the ideas implemented in Java are rather strong ideas and have longevity. If you are writing your 1st web app and have limited knowledge of how the net works then maybe VB/ASP is a better starting point for it's simplicity and integrated environment. However, when you are ready to build scalable enterprise level web apps then JSP is definitely the better choice. Take it from someone experieinced in both.
    Cliff

  • Integration of JSP and xhtml in jsf project

    Can we use both jsp and xhtml in single jsf project. Actually I encountered a problem while configuring jsp and xhtml in web.xml of jsf project. The web.xml configuration file allows to use only one view handler (jsp or xhtml).By default it use jsp view handler. For xhtml view handler, we need to define following context param -:
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    Please let me know any possibility to configure both jsp and xhtml in jsf project(web.xml).
    My actual requirement is that I need to forward to new page(xhtml) from an xhtml page without using faces-config. I am not able to find any facelets tags which let me forward to new xhtml page. So I am thinking to use jsp to exploit the jsp tag called forward. But the constraint is that we can use only one view handler with jsf project.

    Can we use both jsp and xhtml in single jsf project. Actually I encountered a problem while configuring jsp and xhtml in web.xml of jsf project. The web.xml configuration file allows to use only one view handler (jsp or xhtml).By default it use jsp view handler. For xhtml view handler, we need to define following context param -:
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    Please let me know any possibility to configure both jsp and xhtml in jsf project(web.xml).
    My actual requirement is that I need to forward to new page(xhtml) from an xhtml page without using faces-config. I am not able to find any facelets tags which let me forward to new xhtml page. So I am thinking to use jsp to exploit the jsp tag called forward. But the constraint is that we can use only one view handler with jsf project.

  • JSF vs. JSP and IDE Question

    I'd like to get an opinion from the forum, I'm looking to build a web application that provides a front-end to a back-end, batch Java app. The back-end app has pre-existing common classes and methods with all of the essential business logic.
    My first question is, what platform should I be looking at, Javaserver Faces or JSP? JSF is so new and all of the bugs surely haven't been worked out, but it is the heir apparent new direction of J2EE. JSP is a little more proven, but a little more difficult to work in. This "more difficult" might not be so bad for us, because we've developed most of our back-end app without an IDE or drag-and-drop tools.
    My second question regards IDE's. I'm relatively new to OO programming, and I've never used an IDE. So, of the many free IDE's out there (Eclipse, Netbeans, etc.), are there any that you would recommend for your answer to the first question? How large of a process improvement would you judge from a move to an IDE with drag-and-drog functionality?
    So, in short, I would appreciate any of your opinions on moving to a new JSF standard as well as your thoughts on IDE's.
    Thanks.

    If you don't want to sepnd much time and want to do something in the middle between JSF and JSP, you can use JSTL. Lots of cool JSTL components are available for free. Using struts (which is timetested) is also a good idea.
    If you have never used any Java IDE, I would suggest you to use netbeans ide. Netbeans is really cool ide and has some good features like refactoring, jsp debugging etc. You will have to use Tomact as your server if you want to use JSP debugging effectively.
    Eclipse with right plugin (My Eclipse) would be the best choice but you will have to understand some eclipse concepts before jumping on eclipse. It took me little time to figure out view, perpectives, plugins jargon.
    Also My Eclipse is not free but it's very inexpensive - $30 per year.
    All these are my experiances. I hope it helps you.
    Vaibhav Puranik

  • Which better between Hibernate and EJB

    Hello i am a new begginer in J2EE, i have some question
    Which better between Hibernate and EJB ?
    i still confuse when must using Hibernate or EJB, because as i know in EJB it can use datasource which can i map to Entity bean.
    this function is same as Hibernate as i know.
    if my concept is wrong please correct my concept
    thx in advanced

    fbrayuki.darmanto wrote:
    Hello i am a new begginer in J2EE, i have some question
    Which better between Hibernate and EJB ?Just to clarify, you mean EJB3.x, not the earlier versions.
    Define "better".
    They're actually pretty similar.
    If you use Hibernate instead of EJB3 you don't need a full-blown Java EE app server. You can deploy apps on a servlet/JSP engine or on the desktop.
    i still confuse when must using Hibernate or EJB, because as i know in EJB it can use datasource which can i map to Entity bean.
    this function is same as Hibernate as i know.
    if my concept is wrong please correct my concept
    thx in advanced%

Maybe you are looking for