Servlets + Seesion objects

Hi
How can u retrieve a session object in a servlet. And how can u store an object back on the session in that servlet?
Has anyone got any sample code - that will be much appreciated.
many thanx
<y>

HttpSession session = request.getSession();
String value = session.getAttribute("key");
or
session.setAttribute("key", "value");

Similar Messages

  • Servlet applet object io streams

    hi! i have an applet and servlet which communicate through objectoutputstreams.
    here's part of my applet code found in the init method:
    hostServlet = new URL( "http://localhost:8080/scheduler/servlet/EditSchedule" );
    hostConnection = (HttpURLConnection)hostServlet.openConnection();
    hostConnection.setRequestMethod( "POST" );
    System.out.println( "connected" );
    //set headers
    hostConnection.setDoInput( true );
    hostConnection.setDoOutput( true );
    hostConnection.setUseCaches( false );
    hostConnection.setDefaultUseCaches( false );
    hostConnection.setRequestProperty( "Content-Type", "application/x-java-serialized-object" );
    //stream to servlet just to specify that we're using post not get
    oos = new ObjectOutputStream( hostConnection.getOutputStream() );                                      
    oos.writeObject( "inside" );                                                
    oos.flush();
    oos.writeObject( "inside2" );
    oos.flush();
    //get objects being passed by servlet
    ooi = new ObjectInputStream( hostConnection.getInputStream() );
    here's part of my servlet code in the doPost() method:
    ObjectOutputStream oos = new ObjectOutputStream( response.getOutputStream() );
    ObjectInputStream ois = new ObjectInputStream( request.getInputStream() );
    response.setContentType( "application/x-java-serialized-object" );
    oos.writeObject( object );               
    oos.flush(); 
    oos.close();     
    //read objects
    FileOutputStream fw = new FileOutputStream( "c:\\objectsRead.txt" );
    ObjectOutputStream objectFw = new ObjectOutputStream( fw );
    objectFw.writeObject( "from servlet" );
    objectFw.flush();                                 
    String inside = (String)ois.readObject();
    objectFw.writeObject( inside );
    objectFw.flush();
    String outside = (String) ois.readObject();
    objectFw.writeObject( outside );
    objectFw.flush();
    objectFw.close();both the inside and inside2 objects get written to my textfile. Although, in my applet, if i outputted inside2 after creating the objectinputstream, only inside1 gets written. This is my problem. I have to write back to the servlet way passed the ooi instantiation of the applet. Specifically, in an event handler outside the init method.
    any help would be greatly appreciated! =)

    another weird thing that i found out.
    when i use the syntax:
    oos.writeObject( "something" );
    -->it gets passed to the servlet while
    String str = "something";
    oos.writeObject( str );
    -->doesn't get passed.
    hmm....
    i tried setting the content type to application/octet-stream but still nothing.

  • Servlet Applet object communication problem???!!!

    Hy folks,
    I need to validate the ability of complex Servlet Applet communication an run into my first pb right at the beginning of my tests. I need to have around 200 Applet clients connect to my servlet and communicate by ObjectInput and ObjectOutput streams. So I wrote a simple Servlet accepting HTTP POST connections that return a Java object. When the java Applet get instantiated, the Object Stream communication workes fine. But when the Applet tries to communicate with the servlet after that, I can not create another communication session with that Servlet, instead I get a 405 Method not allowed exception.
    Summarized:
    - Applet init() instantiate URLConnection with Servlet and request Java object (opening ObjectInput and Output Stream, after receaving object, cloasing streams).
    - When I press a "get More" button on my Applet, I am not able to instantiate a new URLConnection with my servler because of that 405 exception, WHY???
    Here my Servlet code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
             ObjectInputStream inputFromApplet = null;
             ArrayList transmitContent = null;       
             PrintWriter out = null;
             BufferedReader inTest = null;
             try{               
                   inputFromApplet = new ObjectInputStream(request.getInputStream());           
                     transmitContent = (ArrayList) inputFromApplet.readObject();       
                     inputFromApplet.close();
                     ArrayList toReturn = new ArrayList();                 
                     toReturn.add("One");
                     toReturn.add("Two");
                     toReturn.add("Three");
                     sendAnsweredList(response, toReturn);                 
             catch(Exception e){}        
         public void sendAnsweredList(HttpServletResponse response, ArrayList returnObject){
             ObjectOutputStream outputToApplet;    
              try{
                  outputToApplet = new ObjectOutputStream(response.getOutputStream());          
                  outputToApplet.writeObject(returnObject);
                  outputToApplet.flush();           
                  outputToApplet.close();              
              catch (IOException e){
                     e.printStackTrace();
    }Here my Applet code:
    public void init() {         
             moreStuff.addActionListener(new ActionListener(){
                  public void actionPerformed(ActionEvent e){
                       requestMore();
             try{
                  studentDBservlet = new URL("http://localhost/DBHandlerServlet");              
                  servletConnection = studentDBservlet.openConnection();      
                   servletConnection.setUseCaches (false);
                   servletConnection.setDefaultUseCaches(false);
                   servletConnection.setDoOutput(true);
                   servletConnection.setDoInput(true);
                   ObjectOutputStream outputToApplet;
                 outputToApplet = new ObjectOutputStream(servletConnection.getOutputStream());          
                 outputToApplet.writeObject(new ArrayList());
                 outputToApplet.flush();           
                 outputToApplet.close(); 
                   ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                   ArrayList studentVector = (ArrayList) inputFromServlet.readObject();
                   area.setText("Success!\n");
                   for (int i = 0; i<studentVector.size(); i++) {
                        area.append(studentVector.get(i).toString()+"\n");
                  inputFromServlet.close();
                  outputToApplet.close();             
              catch(Exception e){
                   area = new JTextArea();
                   area.setText("An error occured!!!\n");
                   area.append(e.getMessage());
            getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
            getContentPane().add(moreStuff, BorderLayout.SOUTH);
        private void requestMore(){
             try{              
                  studentDBservlet = new URL("http://localhost/DBHandlerServlet");                             
                  servletConnection = studentDBservlet.openConnection(); 
                   ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                   ArrayList studentVector = (ArrayList) inputFromServlet.readObject();
                   area.setText("Success2!\n");
                   for (int i = 0; i<studentVector.size(); i++) {
                        area.append(studentVector.get(i).toString()+"\n");
              catch(Exception e){               
                   area.setText("An error occured2!!!\n");
                   area.append(e.getMessage());
        }Can someone help me solv this issue please, this is my first Applet Servlet work so far so I have no idea on how to solve this issue.

    Sorry folks, just found my error. Forgot about the ObjectInputStream waiting on the Servlet side, so of course had a dead look...
    Sorry!

  • Applet-servlet communication, object serialization, problem

    hi,
    I encountered a problem with tomcat 5.5. Grazing the whole web i didn't find any solution (some guys are having the same problem but they also got no useful hint up to now). The problem is as follows:
    I try to build an applet-servlet communication using serialized objects. In my test scenario i write a serialized standard java object (e.g. a String object) onto the ObjectOutputStream of the applet/test-application (it doesn't matters wheter to use the first or the latter one for test cases) and the doPost method of the servlet reads the object from the ObjectInputStream. That works fine. But if i use customized objects (which should also work fine) the same code produces an classnotfound exception. When i try to read and cast the object:
    TestMessage e = (TestMessage)objin.readObject();
    java.lang.ClassNotFoundException: TestMessage
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ...That seems strange to me, because if i instantiate an object of the same customized class (TestMessage) in the servlet code, the webappclassloader doesn't have any problems loading and handling the class and the code works fine!
    The class is located in the web-inf/classes directory of the application. I've already tried to put the class (with and without the package structure) into the common/classes and server/classes directory, but the exception stays the same (I've also tried to build a jar and put it in the appropriate lib directories).
    I've also tried to catch a Throwable object in order to get information on the cause. But i get a "null" value (the docu says, that this will may be caused by an unknown error).
    I've also inspected the log files intensively. But they gave me no hint. Until now I've spend a lot of time on searching and messing around but i always get this classnotfound exception.
    I hope this is the right place to post this problem and i hope that there is anyone out there who can give me some hint on solving this problem.
    Kindly regards,
    Daniel

    hi, thanks for the reply,
    all my classes are in the web-inf/classes of the web-app and have an appropriate package structure. thus the TestMessage class is inside a package.
    i tried some names for the testclass but it didn't matter. the exception stays the same. I also tried to put the jar in the common/lib but the problem stays.
    Well the problem with loaded classes: As i mentioned in the post above i can instantiate an object of TestMessage in the code without any problems (so the classloader of my webapp should know the class!!)
    only when reading from the objectinputstream the classloader doesn't seem to know the class?? maybe theres a parent classloader resposible for that and doesn't know the class?
    strange behaviour...
    p.s. sending the same object from the servlet to the client works well
    regards
    daniel
    Message was edited by:
    theazazel

  • Servlet write object error!

    "I have a applet communicate with servlet case and sending objects back and forth. when running at appletviewer everything looks fine, however, if i run through browser the servlet will generate this kind of error:
              <Jul 10, 2002 5:25:54 PM CDT> <Error> <HTTP> <Servlet execution in servlet context "WebAppServletContext(3585651,spcweb,/spcweb)" failed, java.net.SocketException: Software caused connection abort: socket write error
              java.net.SocketException: Software caused connection abort: socket write error
                   at java.net.SocketOutputStream.socketWrite0(Native Method)
                   at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
                   at java.net.SocketOutputStream.write(SocketOutputStream.java:126)
                   at weblogic.servlet.internal.ChunkUtils.writeChunkTransfer(ChunkUtils.java:189)
                   at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:165)
                   at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:248)
                   at weblogic.servlet.internal.ChunkOutputWrapper.flush(ChunkOutputWrapper.java:152)
                   at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:119)
                   at weblogic.servlet.internal.ServletOutputStreamImpl.commit(ServletOutputStreamImpl.java:446)
                   at weblogic.servlet.internal.ServletOutputStreamImpl.finish(ServletOutputStreamImpl.java:491)
                   at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:989)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2209)
                   at weblogic.kernel.ExecuteThread.e
              

    Hi,
    You could convert int to Interger Object using,
    Interger in = new Interger(i);
    where i is of type int.
    Refer to http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Integer.html
    Raja

  • Applet/Servlet/serialized objects/HTTPS/Intranet problem

    We've got a Webapplication with[b] applets on the client and servlets on the server side.The Applet send serialized Objects over HTTPS (SSL) to the servlet. The servlet does some business logic and send the answer the same way back.
    In all our tests and in the most cases the application works without any problems.
    But in some Intranet environments we get occasionally (not definitely reproducable) the following error:
    <Oct 1, 2004 8:26:00 AM>  [AnmeldenService] {Service-readThreadAks-AnmeldenServiceThread}
    java.io.EOFException: Expecting code
    at java.io.ObjectInputStream.peekCode(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at com.dsh.egb.aks.betrieb.rclt.service.ServiceThread$2.run(ServiceThread.java:222)
    at java.lang.Thread.run(Unknown Source)Has anybody an idea how to further analyse this problem?
    Thanks,
    Mark
    We use JRE/JDK 1.3.1_10.

    Here some more Information about our environment:
    Server: Apache 1.3.26 / Openssl 0.9.6d /WinNT 4.0 /HTTP Redirect to Tomcat 4.0.1/ JDK1.3.1_10/ WinNT 4.0
    Client: Plugin 1.3.1_10/Internet Explorer 6.0 (SSL)/Win NT 4.0

  • Servlets and Object Serialization

    Say, you have a Servlet which sends Objects across an ObjectOutputStream which is obtained from its corresponding HttpServletResponse.
    res.getOutputStream().writeObject(myObject);
    From what I observe it is impossible to obtain an ObjectInputStream from the URLConnection of the calling servlet until it is finished processing.
    Does anyone know if there is a way to do this?
    URLConnection conn = _myUrl.openConnection();
    conn.setDoOutput(false);
    conn.setUseCaches(false);
    conn.setRequestProperty("Content-Type", "application/octet-stream");
    ObjectInputStream in = new ObjectInputStream(conn.getInputStream());
    System.out.println("This won't get called until the calling Servlet has finished processing, is it possible to retrieve before???");
    String s = in.readObject().toString();

    hi , I made a similar query some time ago and came up with the following solution.
    serverUrl_ = new URL(url_);
                   HttpURLConnection con_ = (HttpURLConnection)serverUrl_.openConnection();
                   con_.setRequestMethod("POST");
                   con_.setDoOutput(true);
                   con_.setDoInput(true);
                   con_.setUseCaches(false);
                   ObjectOutputStream out_ = new ObjectOutputStream(con_.getOutputStream());
                        out_.writeObject(new String("a test example to string"));
    The servlet would read this in as follows:
         protected void doPost(HttpServletRequest request_, HttpServletResponse response_){
              try{
                   //get required io streams
                   ObjectInputStream ois_ = new ObjectInputStream(request_.getInputStream());
                   ObjectOutputStream object_ = new ObjectOutputStream(response_.getOutputStream());
                   String test_ = (String)ois_.readObject();
                   if(test_ instanceof String){
                        System.out.println("String value is: "+test_);
                   } else {
                             System.out.println("error reading string")
              } catch(Exception ioe){
                   ioe.printStackTrace();
    this should give you the basic idea how to pass objects through http.
    Hope it helps
    rob

  • Servlet and Object Serialization

    Hi,
    I am developing a routing server in Java
    2 Instances of the same server will be running in 2 different data centers.
    The servers have a Jetty server embedded with a Servlet inside.
    Server 1 will use a GET method to talk to the Server 2 -> Servlet which will write the state of an object back which will read by Server 1 and reconstruct the object back.
    Do you find any issues in Object Serialization/DeSerialization in the Servlet.
    What are the factors that I need to consider in this case?
    Regards,
    Jana

    Make sure that your servlet handles the transaction in the same thread that doPost() or doGet() is called in.
    I ended up porting some old ServerSocket based code to a servlet, and was handing off the request and response objects to a handler thread on the server side. I ended up with a ton of intermittent errors like this.
    Once I started handling the transactions in the same thread things worked heartbreakingly well.

  • Servlet Session Object

              I need to get the lastAccessTime of the servlet which I have deployed on Weblogic
              7.0.
              I have found that by using ServletSessionRuntimeMBean interface which has a method
              called getTimeLastAccessed, I can get the same.
              I am not able to get the same. Can any one sujject the way I have to go for this.
              

    Hello Linus,
    Actually, you would want to retrieve the necessary objects from your servlet context
    and then pass them along to your session EJBs. It's not necessary to pass the
    entire ServletContext object to your session bean. You should wrap the values
    in DTOs (Data Transfer Objects / Value Objects) and pass them along to your session
    beans. Also, it's not good to couple your EJBs with Servlets, as they may be eventually
    accessed from standalone clients in the future. For more information on this design
    pattern, please see the following link:
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Linus Nikander" <[email protected]> wrote:
    Is it possible to accesss objects stored in a Servlet session context
    from
    an EJB ? If so, how ?
    //Linus Nikander - [email protected]

  • Servlet cluster, Object cluster & Firewall

              Hi,
              WLS 5.1 have a firewall restriction : no firewall between the servlet cluster and the object cluster. Is this restristion stay in WLS 6.0 ?
              Thanks.
              Ernest Remanjon
              Related documentation: Using Weblogic server clusters, version 1.1, October 2000, pg 3-19.
              

    Hi,
              This issue has come up several times -- hopefully, we will update our documentation to clarify the issues.
              The answer is that WLS (i.e., any version) does not care about firewalls in general, what it cares about are any load-balancing and/or network
              address translation features of the firewalls. Let's take the easy one first.
              Network-address translation issues
              =========================
              WebLogic uses the IP address of the machine where the server is running to pass information back to the caller (e.g., the RMI stub has
              information about the location of the object, the Session ID has information encoded in it about the location of the HttpSession object).
              Therefore, if the caller uses a different IP address (the one that maps to the firewall) than the physical IP address of the machine where the
              server is running, you need to tell WebLogic what the "external" IP address is so that it will use this when encoding location information. I
              don't remember exactly when this capability was added but you control it via the weblogic.system.DNSName property in later versions of the
              product.
              Load-balancing issues
              ================
              WebLogic offers the capability of using stateful objects -- objects that reside on a particular server in the cluster. The information about
              the location of these stateful objects is passed back to the caller so that the callers next request can be routed back to the correct
              location. If, there is some network device between the caller and the server that causes the request to be routed to a server other than the
              one containing the object, this will cause the application not to work.
              For example, I have a stateful session bean instance residing in Server A in my cluster for a particular caller. However, I have set my
              weblogic.system.DNSName property in my server to map to the IP address of my load-balancing hardware device so that the stub sends the caller's
              request to the load-balancer instead of Server A. Now, if the load-balancer (for whatever reason) decides to route the request to some other
              server in my cluster (i.e., not Server A), the call is going to fail because the server receiving the call has no knowledge of the stateful
              session bean instance.
              Therefore, in whatever architecture you choose, you need to make sure that you do not use a hardware load-balancer (or even DNS round-robining)
              at the point where calls must be routed to a particular server. There are a couple of popular configurations, I will start with the one I
              always recommend to my customers first.
              Internet ---> firewall and/or hardware load-balancer ---> Web (Proxy) Servers ---> firewall ----> WLS Cluster (Servlets/JSPs and EJBs)
              The one you are describing can be done multiple ways, none of which I recommend unless you have some outstanding reason for needing this
              architecture.
              Internet ---> firewall and/or hardware load-balancer ---> Web (Proxy) Servers ---> WLS Cluster (Servlets/JSPs) ---> firewall ---> WebLogic
              Cluster (EJBs)
              Internet ---> firewall and/or hardware load-balancer ---> Web (Proxy) Servers ---> firewall ----> WLS Cluster (Servlets/JSPs) ---> firewall (or
              not) ---> WebLogic Cluster (EJBs)
              Hope this clarifies the issues,
              Robert
              Ernest Remanjon wrote:
              > Hi,
              >
              > WLS 5.1 have a firewall restriction : no firewall between the servlet cluster and the object cluster. Is this restristion stay in WLS 6.0 ?
              >
              > Thanks.
              >
              > Ernest Remanjon
              >
              > Related documentation: Using Weblogic server clusters, version 1.1, October 2000, pg 3-19.
              

  • Servlet session objects shariing same session objects? Help!

    Hi all,
              Is it possible for two different HttpSessions to share the same session objects.
              We have a java class that we store in the session. This class calls a stateless Session EJB to do quoting for an insurance policy. It seems that two different clients are sharing the same instance of the EJB because they are each modifying the other's quotes.
              I have checked the session id for each client and have found that they are different. I then changed the EJB to be stateful but I received the same results.
              I'm not sure where to go from here.
              Any help would be greatly appreciated.
              Thanks in advance.
              Greg

    The session object is declared through a useBean-directive and has session-scope. We are using WLS sp 4

  • How is object handled with servlets?

    Hi!
    This is probably a very basic question, but I need to know. Does a servlet treat objects differently from any other Java class?
    Consider you have the following class:
    public class ClassC {
         private String strName = "John";
         public String getName() {
              return strName;
         public void setName(String name) {
              strName = name;
    }Then we use a servlet to create a object of class ClassC:
         public void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              String strFirstName= "Steve";
              ClassC c = new ClassC();
              c.setName("Lance");
              strFirstName = c.getName();
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
              out.println("<HTML>");
              out.println("  <HEAD><TITLE>A Servlet</TITLE></HEAD>");
              out.println("  <BODY>");
              out.println("strFirstName = " + strFirstName);
              out.println("  </BODY>");
              out.println("</HTML>");
              out.flush();
              out.close();
         } My question is what �out.println("strFirstName = " + strFirstName);� will print in a server on the webb?
    Suppose you have a produced a ResultSet and you put that as a private variable in a class as in ClassC above. Suppose I use the same technique as in the doGet-method, and have methods that extract data from the ResultSet. Will each use user of the servlet get unique information or will every user get the same information?
    I think (and hope) that each user will get unique information. Is this correct?
    Regards
    Jonas

    As written... the object Class is local to to the doGet method. This means that each run of the doGet method gets its own instance of the object, and each user will get their own data.
    If strFirstName or c was declared as a class member, then all users would get the same data (potentially):
    //bad servlet:
      String strFirstName = "Steve";
      ClassC c;
      public void doGet(...) ... {
        c = new ClassC();
      }

  • Accessing a servlet from another class

    Not to confuse anyone too much, but here's the scenario.
    I have a servlet that calles other Java classes which perform various functions. Now can I have one of these classes access the servlet directly, without setting up a socket based connection. What I mean is can I just simply call its methods and have access to the HttpServletResponse/HttpServletRequest objects?
    Usually the servlet gets accessed via an HTTP client where then servlet will call classes it needs to access, where here I have a class accessing the servlet directly.
    I do not have the capability of running servlets at the moment so I cannot just do a quick and dirty test to see how it would be done.
    Any input would be appreciated.

    If you have a servlet that contains methods that
    aren't related to the processing of a request (except
    for initialization) then those methods are in the
    wrong place. I don't know where they should be
    instead, that depends on your design. Perhaps you
    should post some details about what you are trying to
    do here.Currently I have not written code for what I am attempting.
    What I am attempting is quite an unorthodox approach of getting server information via a servlet. However unlike your standard servlet the servlet will be accessed via a java class, rather than being invoked from a URL.
    If I had to use psuedo-code I would put it like this:
    class A{
    public void accessHeaders(){
    // access servlet HttpRequest object.
    // use the object.
    // display header info...etc.
    // main prog.
    class Test {
    public static void main(String[] a){
    A a = new A();
    a.accessHeaders();
    The servlet will be a generic servlet which overrides a doGet().
    That's right an app accessing a servlet. I have done this but using the java.net package but I don't want to use that in this case. Can I implicitely call the servlet?
    Now the more I think about doing something like this the more I feel that it cannot be done this way.
    I am new to servlets so I don't know all the ways they can be used.

  • How can i send xml file with a http servlet request

    Hi
    Please tell me how can I send a xml file into http servlet request.
    I have a servlet(action) java file.From this servlet I have generate a xml file. Now I need to send that xml file to another servlet with http servlet request object.
    Dave.

    When you say you have generated an XML file what do you mean?
    Is it a file stored on disk? Then pass the file path as a string to the servlet.
    Is it stored in memory as an object? The pass a reference to the object to the servlet.
    Or are you asking how to communicate between servlets?
    Look in the JavaDocs for the RequestDispatcher class. You can use this class to forward the request to another servlet. Data can be passes using the RequestDispatcher by storing it as attributes using the request getAttribute and setAttribute methods. Also described in the JavaDOcs.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html

  • When should a servlet be called?

    Hi all,
    i have three JSP pages.when should a Servlet be called.what is the interaction between jsp,servlet and data base.please help me with the process flow.its urgent.help me out.thanks in advance.

    JSP's should represent the presentation. It should not contain Java code nor scriptlets.
    Beans should contain the actual data which is to be transferred between JSP and servlets (business objects / value objects).
    Servlets should contain the business logic (the actual Java code) to check/verify values of business objects and call DAO's. Generally here the BO's will also be mapped to DTO's (data transfer objects). Some solutions uses DTO's as BO's, or at least extends them.
    DAO's should contain the logic to create/read/update/delete DTO's into/from database.

Maybe you are looking for

  • My ipad3 asks to be activated even though I've had it for months

    I've had my ipad3 for months now. I activated it when I first got it. Last night I've left it to charge and this morning it keeps asking me for activation. I'm an apple iOS developer and I've had iOS 6 Beta on it for a while. I believe I did update i

  • What is a .abbu file?  And what do I do with it?

    There is a file that has appeared on my desktop with the following name: "Address Book - 2010-02-22.abbu". If I double click the file, I get a dialog box that says "Are you sure you want to replace all of the contacts in your address book with the co

  • Error in configuring soap adapter

    Hai! Iam working with rfc to webservice scenario. In that while configuring the soap adapter, the following errors have occured. SOAP: failed to sign the message due to java.security.PrivilegedActionException: com.sap.aii.af.security.impl.exception.M

  • How do i clear the reading list in Safari?

    How do i clear the reading list on Safari for Iphone 4

  • How can I see WHY a message was encrypted?

    On our Postx box, I used to be able to see specifically what caused a message to become encrypted (for example a social security number). It would report what keyword(s) triggered the encryption. We just replaced the Postx with an IronPort C150 (love