Is there any difference between java Beans and general class library?

Hello,
I know a Java Bean is just a java object. But also a general class instance is also a java object. So can you tell me difference between a java bean and a general class instance? Or are the two just the same?
I assume a certain class is ("abc.class")
Second question is is it correct that we must only use the tag <jsp:useBean id="obj" class="abc.class" scope="page" /> when we are writng jsp program which engage in using a class?Any other way to use a class( create object)? such as use the java keyword "new" inside jsp program?
JohnWen604
19-July-2005

a bean is a Java class, but a Java class does not have to be a bean. In other words a bean in a specific Java class and has rules that have to be followed before you have a bean--like a no argument constructor. There are many other features of beans that you may implement if you so choose, but read over the bean tutorial and you'll see, there is a lot to a bean that is just not there for many of the Java classes.
Second question: I'll defer to someone else, I do way to little JSP's to be able to say "must only[\b]".

Similar Messages

  • Is there any difference between DDR3 memory and LPDDR3 memory? As i brought my macbook air 2013 recently and i saw the specifications it is indicating DDR3, buy apple website stated LPDDR3. Anyone can advise on this?

    Hi
    Is there any difference between DDR3 memory and LPDDR3 memory? As i brought my macbook air 2013 recently and i saw the specifications in the system info that is indicating DDR3, but apple website stated LPDDR3. Anyone can advise on this?

    Welcome to Apple Support Communities
    Read > http://en.wikipedia.org/wiki/Mobile_DDR DDR is the RAM used in computers, and LPDDR is common in mobile computers

  • Is there any difference between the iPod and the iPod hp?

    I'm new to iPods so forgive me if this is a foolish question but I've been thinking for a few weeks now about getting my daughter the shuffle. I bought the 1gb iPod shuffle hp today in Staples because they had it on sale but I'm wondering if there's any drawbacks to buying this one compared to buying it directly from Apple? As far as the electronics, is there any difference between the iPod and the hp iPod?

    Welcome to Apple Discussions!
    Electronically, there is no difference. The only difference comes in support. Apple allows you to call them for 90 days and one issue after you buy them, supporting windows and macs. HP will only help you if you are using a windows, however that support lasts one year. Keep in mind that if you need support, you'll have to go to an HP authorized repair center or another one of HP's options as the apple repair site and apple stores can't help in that regard.
    btabz

  • Is there any difference between an unlocked and sim free iPhone?

    Is there any difference between an unlocked and sim free iPhone?

    I think in the context you're using, they are pretty much the same thing. The only carrier on the planet as of this writing with the CDMA iPhone, which does not use SIM cards AT ALL, is Verizon in the U.S.
    There is a difference between an unlocked iPhone and an iPhone sold without a contract, but still locked to a carrier.
    This list details all of the currently supported iPhone carriers. http://support.apple.com/kb/ht1937
    Some carriers sell phones that are NOT carrier locked (i.e. SIM FREE). Some sell locked phones, but offer unlocking services for their subscribers. In SOME countries, unlocked phones can be purchased directly from Apple. Apple also sells locked phones, that do not require a term commitment with the carrier at what is usually the same price as an unlocked phone.

  • Question about main difference between Java bean and Java class in JSP

    Hi All,
    I am new to Java Bean and wonder what is the main difference to use a Bean or an Object in the jsp. I have search on the forum and find some post also asking the question but still answer my doubt. Indeed, what is the real advantage of using bean in jsp.
    Let me give an example to illustrate my question:
    <code>
    <%@ page errorPage="errorpage.jsp" %>
    <%@ page import="ShoppingCart" %>
    <!-- Instantiate the Counter bean with an id of "counter" -->
    <jsp:useBean id="cart" scope="session" class="ShoppingCart" />
    <html>
    <head><title>Shopping Cart</title></head>
    <body bgcolor="#FFFFFF">
    Your cart's ID is: <%=cart.getId()%>.
    </body>
    <html>
    </code>
    In the above code, I can also create a object of ShoppingCart by new operator then get the id at the following way.
    <code>
    <%
    ShoppingCart cart = new ShoppingCart();
    out.println(cart.getId());
    %>
    </code>
    Now my question is what is the difference between the two method? As in my mind, a normal class can also have it setter and getter methods for its properties. But someone may say that, there is a scope="session", which can be declared in an normal object. It may be a point but it can be easily solved but putting the object in session by "session.setAttribute("cart", cart)".
    I have been searching on this issue on the internet for a long time and most of them just say someting like "persistance of state", "bean follow some conventions of naming", "bean must implement ser" and so on. All of above can be solved by other means, for example, a normal class can also follow the convention. I am really get confused with it, and really want to know what is the main point(s) of using the java bean.
    Any help will be highly apprecaited. Thanks!!!
    Best Regards,
    Alex

    Hi All,
    I am new to Java Bean and wonder what is the main
    difference to use a Bean or an Object in the jsp. The first thing to realize is that JavaBeans are just Plain Old Java Objects (POJOs) that follow a specific set of semantics (get/set methods, etc...). So what is the difference between a Bean and an Object? Nothing.
    <jsp:useBean id="cart" scope="session" class="ShoppingCart" />
    In the above code, I can also create a object of
    ShoppingCart by new operator then get the id at the
    following way.
    ShoppingCart cart = new ShoppingCart();
    out.println(cart.getId());
    ...Sure you could. And if the Cart was in a package (it has to be) you also need to put an import statement in. Oh, and to make sure the object is accessable in the same scope, you have to put it into the PageContext scope. And to totally equal, you first check to see if that object already exists in scope. So to get the equivalant of this:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart"/>Then your scriptlet looks like this:
    <%@ page import="my.pack.ShoppingCart %>
    <%
      ShoppingCart cart = pageContext.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        pageContext.setAttribute("cart", cart);
    %>So it is a lot more work.
    As in my mind, a normal class can also
    have it setter and getter methods for its properties.True ... See below.
    But someone may say that, there is a scope="session",
    which can be declared in an normal object.As long as the object is serializeable, yes.
    It may be
    a point but it can be easily solved but putting the
    object in session by "session.setAttribute("cart",
    cart)".Possible, but if the object isn't serializable it can be unsafe. As the point I mentioned above, the useBean tag allows you to check if the bean exists already, and use that, or make a new one if it does not yet exist in one line. A lot easier than the code you need to use otherwise.
    I have been searching on this issue on the internet
    for a long time and most of them just say someting
    like "persistance of state", "bean follow some
    conventions of naming", "bean must implement ser" and
    so on. Right, that would go along the lines of the definition of what a JavaBean is.
    All of above can be solved by other means, for
    example, a normal class can also follow the
    convention. And if it does - then it is a JavaBean! A JavaBean is any Object whose class definition would include all of the following:
    1) A public, no-argument constructor
    2) Implements Serializeable
    3) Properties are revealed through public mutator methods (void return type, start with 'set' have a single Object parameter list) and public accessor methods (Object return type, void parameter list, begin with 'get').
    4) Contain any necessary event handling methods. Depending on the purpose of the bean, you may include event handlers for when the properties change.
    I am really get confused with it, and
    really want to know what is the main point(s) of
    using the java bean.JavaBeans are normal objects that follow these conventions. Because they do, then you can access them through simplified means. For example, One way of having an object in session that contains data I want to print our might be:
    <%@ page import="my.pack.ShoppingCart %>
    <%
      ShoppingCart cart = session.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        session.setAttribute("cart", cart);
    %>Then later where I want to print a total:
    <% out.print(cart.getTotal() %>Or, if the cart is a JavaBean I could do this:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session"/>
    Then later on:
    <jsp:getProperty name="cart" property="total"/>
    Or perhaps I want to set some properties on the object that I get off of the URL's parameter group. I could do this:
    <%
      ShoppingCart cart = session.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        cart.setCreditCard(request.getParameter("creditCard"));
        cart.setFirstName(request.getParameter("firstName"));
        cart.setLastName(request.getParameter("lastName"));
        cart.setBillingAddress1(request.getParameter("billingAddress1"));
        cart.setBillingAddress2(request.getParameter("billingAddress2"));
        cart.setZipCode(request.getParameter("zipCode"));
        cart.setRegion(request.getParameter("region"));
        cart.setCountry(request.getParameter("country"));
        pageContext.setAttribute("cart", cart);
        session.setAttribute("cart", cart);
      }Or you could use:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session">
      <jsp:setProperty name="cart" property="*"/>
    </jsp:useBean>The second seems easier to me.
    It also allows you to use your objects in more varied cases - for example, JSTL (the standard tag libraries) and EL (expression language) only work with JavaBeans (objects that follow the JavaBeans conventions) because they expect objects to have the no-arg constuctor, and properties accessed/changed via getXXX and setXXX methods.
    >
    Any help will be highly apprecaited. Thanks!!!
    Best Regards,
    Alex

  • 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

  • Is there Any difference Between OBPM 10g And AlBPM 6.0

    Hello Friends
    I would like know is There any difference between the Oracle BPM 10g and ALBPM 6.0 . ??
    The second one is Difference between AlBPM5.7 and ALBPM 6.0
    Thanks In Advance
    with Regards
    Sandeep
    Edited by: user12036530 on Oct 18, 2009 9:08 PM

    For 10g Differences, check out: http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/upgradeguide/deliverables/upgrade_guide/c_Head_Reference.html
    And other 10g Documentation: http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/index.html Specifically: Upgrade Guide, Process API Differences (if you use PAPI)
    For 6.0 Differences, check out the Documentation: http://download.oracle.com/docs/cd/E13165_01/albsi/docs60/index.html Specifically: ALBPM 6.0 New Features Overview
    Hope this helps,
    -Kevin

  • Is there any difference between the iPad and iPhone cables?

    Alot of people are mentioning that there's difference with the speed while syncronising/backup. I am just wondering is there any difference between the cables? and how can I distinguish it? Coz I have most of the i- products and I have just mixed up all the cables >__< Thank you!

    I can confirm that iPad/iPod cables are identical. Don't know about iPhone. IF there is a difference, you'll know immediately - function or functions won't work.
    There will be NO speed difference. Either the copper is present or it isn't and copper is copper.

  • Are there any difference between iPhone 4S and iPhone 5? What are they?

    What I already know is that iPhone 5 has a larger screen and is slimmer, but are there any difference between the two.  I have iPhone 4S now, should I buy iPhone 5?

    There are a number of major differences between iPhone 4S and iPhone 5, the major one being the processor speed.  iPhone 5 has a much faster processor – two times faster than the processor in iPhone 4S.  This difference is only significant if you use your phone to play high graphics games that require a lot of processing power.  This processing speed also makes the applications load and run faster – iPhone 5 even boots in a shorter time than iPhone 4S.  You can use iPhone 4S comfortably now but when games and graphic apps designed for iPhone 5 are released, you may be forced to upgrade your phone to run the smoothly.

  • HT204370 is there any difference between apple tv  and itunes PURCHASED movies

    is there any difference between apple tv purchase and itunes PURCHASED movies ?

    Welcome to Apple Support Communities
    Read > http://en.wikipedia.org/wiki/Mobile_DDR DDR is the RAM used in computers, and LPDDR is common in mobile computers

  • Is there any difference between a US and a UK iPad Mini?

    I am able to get an iPad Mini with Retina (32GB) from an American Air base in the UK (my fatehr was in the Air Force) and it's slightly cheaper than getting a UK iPad Mini with Retina (32GB). Is there any difference (apart from the charger in the box) between the two?

    BearMan705 wrote:
    the origional iPad so I could just use her charger (not sure if it's compatible)
    The original ipad uses a different connector than those of the 4th generation and later.

  • Is there any difference between Itunes store and apps store.  Confusing I think

    Is there NY DIFFERENCE BETWEEN APPS STORE ANS ITUNE STORE.  i AM A NEW USER AND i FINF=D THIS VERY CONFUSING

    On an iOS device no, iTunes app, App Store app & iBooks app, all are separate apps for what is one app, the iTunes app, on the Mac or PC. They all use the same Apple ID and iTunes account to buy content.

  • Are there any differences between Server 2012 and Server 2012 R2 that might impact TFS or SQL server required for TFS?

    Hi,
    In the interest of just getting started and learning the basics of setting up TFS, I previously setup an IDE using a large workstation running Windows 8.  I set up the required servers for TFS using VM's through Hyper-V.  I am now transferring
    everything to a new and separate physical server.
    My question stems from a problem I had when I originally setup the TFS system the 1st time.  I couldn't get SQL server to work using the Server 2012 R2 download from the subscription center.  When I used Server 2012, it worked, so I proceeded that
    way just to get going.
    So now I'm setting things up anew on a new physical box, I want to ask up front, is there some difference in the R2 version that causes problems with either TFS or SQL server, or was there likely some oversight on my part when I did things the 1st time?
    As an addendum to my question, I always assumed R2 merely means the Server software has progressed to a refined state and is ready for wide distribution and easy setup.  I assumed that there are no differences between the Standard version and the R2
    version.  Is that understanding correct?
    Thanks.

    Hi Daniel,
    Thanks for your response.  That's a great link.  I don't recall seeing a page that is so clear and easy to read back when I was doing this the 1st time, but I probably just missed it.  That helps.
    I am/was using TFS2013 and VS2013.  As I recall, my problem was getting SQL Server to work, but I thought asking this question on this forum was wiser because I figured everyone using TFS would be well familiar with these issues.
    At any rate, it seems as though TFS2013 is fine with Server 2012 standard or R2.
    I was using SQL Server 2012, and it also seems as though it works on R2:
    https://msdn.microsoft.com/en-us/library/ms143506(v=sql.110).aspx
    Anyway, thanks for your support.  I'll be trying this again and we'll see.

  • Other than size is there any difference between iPhone 6 and iPhone 6 Plus?

    I'm thinking about getting a new phone.  Because I usually carry my phone in a pants pocket I'm concerned that the iPhone 6 Plus may be too large to carry comfortably.  That said, overall performance is my main concern and if the two phones are equal in their SmartPhone performance it makes the decision easier.  This would be my first iPhone.  Thank you for any thoughts or comments on this.
    jim

    Jim Anderson3 wrote:
    Thank you for the links.  I had looked for something like that but couldn't find anything as specific as the comparison link you gave me.  As best I can tell the only difference other than they come in large and larger, seems to be battery life related.  That helps somewhat except that is a performance item so I guess I'll just have to see hoe a 6 Plus will fit in the pocket of my jeans.
    Thanks again!
    jim
    Your welcome. There's not a lot of difference between the two. i think the most significant differences other than size is the 6+ can hold a larger battery and has optical image stabilization. I only carry my phones in my shirt or jacket pockets so I opted for the smaller one just because its lighter. My previous phone was the 5S and the 6 is noticeably lighter even though larger. I've had the phone for about a month now and I'm pleased with the battery performance and the way the phone operates. My only complaints about iPhones (my first was the 4) is I find them somewhat slippery to hang onto, but that's only a personal thing. To compensate I bought the Apple leather case for the 5S as it's thin and doesn't add much bulk. I really liked it so I ordered one for the 6 right away. But again, that is just my personal preference.

  • Difference Between java bean   And POJO

    Hi,
    What is the difference between the POJO the plain old javaobject and java bean ,
    in my sense what is the basic difference between POJO and the object of a java bean class
    Thanks
    Arun

    http://en.wikipedia.org/wiki/POJO
    http://java.sun.com/products/javabeans/

Maybe you are looking for

  • Can we intercept page redirection after user's login?

              Hi,           This is problem we are facing and we are not sure whether it's WLS's limitation.           We can't find a way to let weblogic server direct user back to the same login           page after session time out.           For exam

  • Mac book air thunderbolt (mini display to VGA)

    my office projector doesn't support my new mac book thunderbolt output(mini display to VGA) but works well with my old mac book pro (2011)

  • WM Storage Location control problem - no TR created in receiving warehouse

    Hi all, I have configured the system to perform a 311 mvt from sloc 4002 to sloc 0010. Both Slocs have different warehouse numbers assigned. The transfer is working fine, however in the receiving warehouse no TR is being generated even though I am us

  • When I apply a plug in compressor on the final output track I get a click

    1/I am applying a compressor on to a particular point of the track (in the final output track) and naturally all tracks go louder.. however my problem is at that point where the compressor switches on from its previous bypass status, I get a click. t

  • Link real time to filter data

    Application: Dreamweaver CS4 Language: Php, MySql Hello, I need link the current date in realtime for filter records. Now I use the current date in php: <a href="results.php?OldDate=<?php echo date('Y-m-dH:i:s');?>&Search=Submit">Old</a> Now I need t