Differences between Java Servlet and Portlets

Hello,
May anyone let me know the differences between Java Servlet, JavaBeans and Portlets? It seems quite similar to each other... By the way, what are differences between a servlet container and portlet container? Thank you.
Charoite

JavaBeans are totally different from servlets or portlets. JavaBeans can be used in just about any environment. A JavaBean is basically a java class with a no-arg constructor which follows certain naming conventions for its get and set methods.
Servlets can only function in an "web containers" which are provided by application servers which support servlets. The main function of servlets is to process requests (usually http requests) and generate output (usually web pages). They usually perform validation and other processing and then delegate the web page generation to a jsp.
Portlets are similar to servlets but rather than generating an entire web page, their output is relegated to a portion of a page. A single web page may contain the output of several portlets. These portlets can communicate with each other. The portlet container provides the functionality to merge the output of the various portlets and the infastructure required to support the portlets.

Similar Messages

  • Whats is difference between Java JRE  and  Java SDK

    Hi,
    what is the difference between Java JRE and Java SDK...
    i think both of them have the same set of files to be installed...
    I am not able to understand where they differ

    The JRE (Java runtime Environment) contains just the stuff necessary to run Java and the SDK (System Development Kit) contains the extra stuff necessary (and also helpful) to develop in Java.

  • What's the difference between Java SDK and the Enterprise Edition?

    What's the difference between Java SDK and the Enterprise Edition? Are they both free?

    both r free but they are used in diffrent applications. sdk are used for simple apps that run on your computer while j2e (enterprise edition) are ment for large distributed computer systems that include servers and such. if you don't know the diffrence you probably wont need the the j2e, only the sdk.

  • Difference between Java applet and JavaFX

    Hello, all!
    I am studying javaFX in general. As far as I understand there is no main difference between java applet and javafx, except javafx has different syntax and library simple to use. Is it right?

    Basically, yes. But as you point out, it is supposed to be faster to develop in JavaFX...
    For example, Processing allows to export to applet, and is strong on doing graphics, but to see if user has clicked on a circle, you have to check the mouse coordinates against the circle coordinates, or create your own Circle class: it is at a much lower level.
    Likewise, you can use gaming frameworks like Slick2D or PulpCore, but they might be lacking on GUI (but perhaps faster). Or use Apache's Pivot, strong on GUI, but perhaps lacking a bit on graphics and animation.
    It depends on your needs, if you prefer to stick to Java, etc.

  • Difference between Java class and JavaBean?

    What is the difference between a Java class and a JavaBean?
    A class has variables which hold state.
    A class has methods which can do things (like change state).
    And if I understand a JavaBean it is rather like a BIG class...
    i.e.
    A JavaBean has variables which hold state.
    A JavaBean has methods which can do things (like change state).
    So, what's the difference between the two?
    And in case it helps...What is the crossover point between the two? Is there a minimalist type JavaBean which is the same as a class? What is the difference between Java beans and Enterprise Java Beans?
    Thanks.

    Introspection, as I understand it is a bunch of
    methods which allows me to ask what a class can do
    etc. right? So, if I implement a bunch of
    introspection methods for my class then my class
    becomes a JavaBean?Introspection allows a builder tool to discover a Bean's properties, methods, and events, either by:
    Following design patterns when naming Bean features which the Introspector class examines for these design patterns to discover Bean features.
    By explicitly providing the information with a related Bean Information class (which implements the BeanInfo interface).
    I understand now they are completely different.
    Thanks. Very clear.
    I do not understand how they are completely different.
    In fact I don't have a clue what the differences are
    other than to quote what you have written. In your
    own words, what is the difference? This is the "New
    to Java Technology" forum ;-) and I'm new to these
    things.In that case ejbs are way too advanced for you, so don't worry about it.

  • [svn] 4112: Further work for FXG to SWF transcoding - checking in some work resulting from collaborating with Kaushal to correct FXG transforms and gradient transforms as well as cater for differences between Java AffineTransform and the SWF Matrix type .

    Revision: 4112
    Author: [email protected]
    Date: 2008-11-14 10:05:42 -0800 (Fri, 14 Nov 2008)
    Log Message:
    Further work for FXG to SWF transcoding - checking in some work resulting from collaborating with Kaushal to correct FXG transforms and gradient transforms as well as cater for differences between Java AffineTransform and the SWF Matrix type.
    QE: Not yet.
    Doc: No
    Checkintests: Pass
    Reviewer: Kaushal
    Modified Paths:
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/GraphicContentNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/fills/LinearGradientFillNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/fills/RadialGradientFillNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/strokes/LinearGradientStrokeNode.j ava
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/strokes/RadialGradientStrokeNode.j ava
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/swf/AbstractFXGGraphics.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/swf/TypeHelper.java
    Added Paths:
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/ScalableGradientNode.java

  • 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

  • Difference between java.exe and java.dll

    can some one tell me the difference between java.exe under bin directory of jdk and java.dll under bin directory of jre under jdk. and how to determine jre the application is using.How to locate istalled jres in windows registry

    can some one tell me the difference between
    java.exe under bin directory of jdk and
    java.dll under bin directory of jre under jdk.java.dll is the library containing the Java Virtual Machine. java.exe is the
    program you execute to run Java. It uses java.dll. The java.dll can also be used
    to invoke Java classes from other languages using the Java Native Interface (JNI), see
    http://java.sun.com/j2se/1.4.2/docs/guide/jni/index.html for more information.
    Steve Dever

  • Difference between Java Method and a java function

    what is the difference between a method in java and a function
    in java ?
    ( i have seen that main() is called a function but the others
    are method )
    is it for main can only be called by JVM ?
    please help if u can...
    suman
    ( [email protected] )

    Though Ceci isn't a programmer, his answer is closer: strictly speaking, Java has no functions.
    The Java Language Specification, 2nd Ed, mentions the word "function" thrice: in the sense "to function as something", when talking about a C function, and in the index as "mathematical function". (Get the spec under "documentation" on the left hand side of your screen.)
    So, officially, no functions.
    Informally, many people use "function" and "method" as synonyms. You may even find some that calls a void-returning method "procedure" and value methods "function" (perhaps Pascal background?). And a Lisp programmer might call Runnable.run() a "thunk", but he'd just be pulling your leg.

  • Difference between java -jar and click ?

    Hi everyone,
    What is the difference between :
    - doing : java -jar myAp.jar
    and
    - doing double click on on the file "myAp.jar"
    I thought I was the same thing, but it seems that it's not ...
    Thanks for your help

    Thanks a lot for this information ... but it makes me much more confused ;-) !
    myAp.jar is a graphical application. When I run it with doing "java -jar myAp.jar" or "javaw -jar myAp.jar" everything works fine.
    But I double-click on the file, the application stops everytime it there is a line of code specific to the Jre 1.4.
    For example, it stops at :
    JWindow window = new JWindow();
    window.setLocationRelativeTo(window.getParent());
    If I put these lines into coments... the application goes well and then stops at the line :
    String name = getJarName();
    name = name.replaceAll(".jar", "");
    which is specific to version 1.4 as well.
    What is confusing is that I have Jre 1.4.2_05 installed on the computer.
    C:\>java -version
    java version "1.4.2_05"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
    Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
    I asked the question in the forum "Java Archive (JAR) Files", I did not get answer and anyway I am not quite sure it's a jar issue ....
    Has anybody an idea about that ?
    thanks in advance

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

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

  • The differents between Java Beans and Enterprise Java Beans

    Please help me!
    What is the differents between JavaBeans and Enterprise Java Beans (EJB) ?
    Thank's for your answer

    Enterprise Java Beans are special type of java beans.
    EJBs invented to be used via remote VMs or remote computer
    systems.They must be deployed on server to become accesible for remote
    clients.

  • Difference between Java IDL and RMI-IIOP

    Hi,
    I am new to CORBA / RMI and I am trying to clear my concepts a little bit. Suppose, we want to create a remote object that should be accesible from CORBA clients. Does anyone know what the difference is between creating this object as an RMI object (with RMI-IIOP) and using the java IDL?
    In other words, if I am not wrong, it is possible to write the object in java (pretty much like writting an RMI remore object), generate the IDL with rmic and then any CORBA client can access it provided it has the IDL.
    Are there any advantages in doing it the other way (explicitely instantiating an ORB in the code, etc) ?
    By the way, if we use the first choice (RMI-IIOP), when is the ORB getting called? Is it called by the Tie class, which is generated by rmic -iiop?
    Thanks!

    Visit this link
    http://java.sun.com/j2se/1.3/docs/guide/idl/jidlFAQ.html#java%20idl%20vs%20rmi-iiop

  • What is the difference between Java Beans and EJBs ?

    Hi,
    Can someone tell me that ? Kind of confused... Thanks !
    Philip

    Hmm, I'm gonna have a go at this - hopefully someone will build on it with more differences or requirements:
    A Java Bean is merely a Java class written to conform to some simply rules for construction and method naming eg:
    public class MyBean
      private String myField;
      public MyBean()
      public void setMyField(String myField)
        this.myField = myField;
      public String getMyField()
        return myField;
    }Applications can use Java Beans without having to know about the class in advance - a typical situation might be their use in visual GUI editors where the properties of the bean can be exposed and manipulated by the editor through examination of the method names or an accompanying descriptor.
    An Enterprise Java Bean doesn't have all that much in common with a Java Bean. An EJB is a small set of classes meeting a single (usually) business requirement written to conform to the EJB specification. This enables them to be used by J2EE Application servers to perform enterprise business functions (data storage, manipulation, business logic etc.). The whole idea is that by writing to the specification the server can automatically provide support for transaction management, concurrent access, scaleability, etc that a mission-critical system might require without the programmer having to understand the workings of the application server.
    Essentially an EJB can either
    1) maintain the permanent state of a business object (eg, hold the data for a single product in a catalogue)
    2) perform a small set of business operations (eg, place an order for a customer)
    3) act in response to messages passed around the system (eg, send a mail to the user when the items have been shipped)
    I would have a look at the following two pages to get a better overview:
    http://java.sun.com/products/javabeans/
    http://java.sun.com/products/ejb/
    Hope this helps.

Maybe you are looking for

  • Installing Tiger with external DVD drive, why won't it work??

    I have been trying to install OS X 10.4.3 from the DVD disk, last time I upgrade the OS I had to go out and buy an external DVD drive because I only have a cd drive in my mac. This worked fine last time but now I'm upgrading again it just won't work.

  • Sensors - Configuring JMS queue properties at runtime through console

    Hi, Kindly guide me with configuring of the JMS queue name at runtime for a JMS sensor configured on an activity in Jdeveloper's BPEL process. I have created a JMS sensor but i want to change the queue name at runtime without rebuilding i.e if possib

  • "An error has occurred loading this content check the source and try again"

    I get this message about every 20 or 30 minutes in front row and have to disconnect all users and have to restart iPhoto 08. Im sharing the same library from the same external GRaid to 5 mac minis and all of them lock up at the same time. Is this an

  • No sound in CS3

    Hello, I'm working on a project with a someone who has Pr Pro CS3.  When she imports footage the audio does not come in.  We know the clips have audio.  When looking at the audio track audio wave, nothing is there, just a flat line.  The footage is f

  • J6840 Cartridge Access Door Won't Close

    I just replaced my ink cartriges.  At the back of the access door are two sets of black protrusions top and bottom. The tabs of one WILL NOT line up with the slots on another.  I can open the ac cess door from the back, limited  by the control ribbon