How internally session works in servlet

hi 2 all,
My college project is simulate a Httpserver which handles request and response similar to that of Apache Tomcat.
i want to know how session internally works. work in the sense, wt have they(Apache Tomcat) did in their HttpSession class. how and in what way the session must be maintained if i code that class of my own.
Thaks in advance ..

Apache Tomcat is open source so you can dowload the source and look at any classes you want. If you go to the following link:
http://tomcat.apache.org/download-55.cgi
and scroll down the page, you'll see links for the source code in either a tar or zip format.
By the way, Apache Tomcat is an application server not an HttpServer. Apache also has an HttpServer. Application servers support servlets whereas HttpServers do not (they can server static content natively and dynamic content via CGI programs). HttpServers process requests and server up responses but they have no notion of a session (the http protocol is stateless). The reason I am mentioning all this is to warn you that your professor might not be thinking of the Apache Tomcat model. He might be thinking of the Apache HttpServer model. Make sure you're going down the right path before wasting any effort.

Similar Messages

  • How do Sessions work in Weblogic?

    Hi,
    For some reason, weblogic keeps forgetting and creating a new session everytime I send a http request. I basically login, and then make a request and it says that I can;t get it because I've logged out. Oddly enough, it doesn't have any problems when I use an IP address. It screws up when I use the computer name, which I thought was exacly the same as using an ip address.
    I'm really new to Java programming, but have done a lot of c++.
    I'm now adding the the SID (sessionID) to my calls to Weblogic server. eg &SID=blahblahblahasdfsda but it still makes new sessions for me at every request.
    Any ideas would be great! Or let me know if you need more info. Can anyone point me to a help section on sessions and weblogic (servlet coding)?

    April Ralph wrote:
    How or what software do I need to work in my excel files brought over from my PC to my Mac Book Pro?
    How the answer to your question is obvious to you, I have no idea, but to work in Excel files, you would need....Excel.

  • How to pass data from one internal session to another

    Hi SAP Experts,
    How to pass data from one internal session to another and from One external session to another external session. I used import and export parmeter and SPA/GPA parameters. What is the other way to pass data?
    Please tel me urgently
    Thank you
    Basu

    Memory Structures of an ABAP Program
    In the Overview of the R/3 Basis System you have seen that each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.
    The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session.
    Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.
    The memory area of each session contains an area called ABAP memory. ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access it. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    All ABAP programs can also access the SAP memory. This is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters are often used to preassign values to input fields. You can set them individually for users, or globally according to the flow of an application program. SAP memory is the only connection between the different sessions within a SAPgui.
    The following diagram shows how an application program accesses the different areas within shared memory:
    In the diagram, an ABAP program is active in the second internal session of the first main session. It can access the memory of its own internal session, ABAP memory and SAP memory. The program in the first internal session has called the program which is currently active, and its own data is currently inactive on the stack. If the program currently active calls another program but will itself carry on once that program has finished running, the new program will be activated in a third internal session.
    Data Clusters in ABAP Memory
    You can store data clusters in ABAP memory. ABAP memory is a memory area within the internal session (roll area) of an ABAP program and any other program called from it using CALL TRANSACTION or SUBMIT.
    ABAP memory is independent of the ABAP program or program module from which it was generated. In other words, an object saved in ABAP memory can be read from any other ABAP program in the same call chain. ABAP memory is not the same as the cross-transaction global SAP memory. For further information, refer to Passing Data Between Programs.
    This allows you to pass data from one module to another over several levels of the program hierarchy. For example, you can pass data
    From an executable program (report) to another executable program called using SUBMIT.
    From a transaction to an executable program (report).
    Between dialog modules.
    From a program to a function module.
    and so on.
    The contents of the memory are released when you leave the transaction.
    To save data objects in ABAP memory, use the statement EXPORT TO MEMORY.
    Saving Data Objects in Memory
    To read data objects from memory, use the statement IMPORT FROM MEMORY.
    Reading Data Objects from Memory
    To delete data clusters from memory, use the statement FREE MEMORY.
    Deleting Data Clusters from Memory
    please read this which provide more idea about memory
    Message was edited by:
            sunil kumar

  • Can you tell me How to loading sessions.xml in servlet

    Can you tell me How to loading sessions.xml in servlet

    Getting a session in a servlet is no different than in any other environment except that you need to be careful which classloader you pass to the SessionManager and correctly configure what to do if your application is reloaded. If you use the oracle.toplink.util.SessionFactory introduced in 10.1.3.1 you don't have to worry about these details--it uses the correct settings. The SessionFactory greatly simplifies the code required to get a session or unit of work. It's well documented in the SessionFactory javadoc.
    If you do use SessionFactory beware there is a bug when running in a JTA environment and there's no transaction started. Doug posted a work around in his blog[1].
    --Shaun
    [1] http://www.jroller.com/page/djclarke/20060412

  • Error at weblogic.servlet.internal.session.SessionData. init

              I am using weblogic server 6.1sp2 , weblogic can start sucessful , and can work for
              a moment , but after some minutes , error occured:
              java.lang.NullPointerException
              at weblogic.servlet.internal.session.SessionData.<init>
              at weblogic.servlet.internal.session.MemorySessionData.<init>
              I have been distressed about this for serval days , need your help much.
              thanks.
              

    Since the line numbers are not there in your stack trace and there is very
              little info
              I am not 100% sure what the problem is. But my guess is that this is the
              same
              problem as reported in a bug#CR064294. Please ask support for a one off
              patch
              for this with this CR# as reference. If that doesn't solve the problem let
              us know.
              The fix for CR064294 will be available with 610 SP3.
              Thanks,
              --Vinod.
              "chun_lin" <[email protected]> wrote in message
              news:3cce1b2f$[email protected]..
              >
              > I am using weblogic server 6.1sp2 , weblogic can start sucessful , and can
              work for
              > a moment , but after some minutes , error occured:
              > java.lang.NullPointerException
              > at weblogic.servlet.internal.session.SessionData.<init>
              > at weblogic.servlet.internal.session.MemorySessionData.<init>
              >
              >
              > I have been distressed about this for serval days , need your help much.
              > thanks.
              >
              

  • Classnotfoundexception weblogic.servlet.internal.session.WebLogicSPIFactory

    hi all, it seems that there is not any error in classpath but while deploying the application it says:classnot found exception:weblogic.servlet.internal.session.WebLogicSPIFactory. i have a shared library for this WebLogicSPIFactory class.moreover i added the jar that contains this class into the classpath but it still says "class not found exception"
    please help.

    Hiya,
    Did you manage to fix this problem. I read somwhere is actually a bug in weblogic 610sp2 but 610sp3 has a fix for it. Please confirm.

  • How to pass data from one internal session to another internal session

    hi all sap experts ,
    How to pass data from one internal session to another internal session and from oneExternal session to another external session.
    Except : Import and Export parameters and SPA/GPA parameters.
    Tell me the otherWay to pass data ..
    Plz
    Thanks in advance

    hi,
      abap memory management u will understand about this concept.
    the import /export parameter will help u that passing data between two internal sessions by using abap memory.
      for syntax
    Passing Data Between Programs
    There are two ways of passing data to a called program:
    Passing Data Using Internal Memory Areas
    There are two cross-program memory areas to which ABAP programs have access (refer to the diagram in Memory Structures of an ABAP Program) that you can use to pass data between programs.
    SAP Memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).
    ABAP Memory
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse. For further information, refer to Data Clusters in ABAP Memory.
    Filling Input Fields on an Initial Screen
    Most programs that you call from other programs have their own initial screen that the user must fill with values. For an executable program, this is normally the selection screen. The SUBMIT statement has a series of additions that you can use to fill the input fields of the called program:
    Filling the Selection Screen of a Called Program
    You cannot fill the input fields of a screen using additions in the calling statement. Instead, you can use SPA/GPA parameters. For further information, refer to Filling an Initial Screen Using SPA/GPA Parameters.
    Message was edited by:
            sunil kumar
    Message was edited by:
            sunil kumar

  • How complete refresh works internally?

    How complete refresh works internally?
    We have 2 databases A and B. A is the master database and B is replica of A. Basically we want to implement complete refresh mechanism for our database A and B at some time mid night.
    I need to know, How complete refresh works internally?
    Actually we need our replica database up and running 7X24 for users and definitely we cannot effort any down time for that database.
    Now I would like to know:
    1.How complete refresh works internally? Whether complete refresh truncate all the tables first from Replica database and then insert or any other mechanism is there.
    2.If complete refresh truncate all tables from replica database, how can we make sure about the complete availability (7X24) of our replica database.
    Any input is going to help a lot.
    Regards,
    Sanjeev

    The Member Feedback forum is for suggestions and feedback for OTN Developer Services. This forum is not monitored by Oracle support or product teams and so Oracle product and technology related questions will not be answered. We recommend that you post this thread to the Oracle Technology Network (OTN) > Products > Database > Database - General forum.

  • How does set metric-type internal (bgp) work?

    i can't realise how the command "set metric-type internal " to work.
    bgp announce to ebgp use the igp next-hop metric as the med.
    the igp means only isis?
    does ospf use it ?
    will you tell me how to use it ? give me an example . thinks

    Hi,
    This command can be used into two different contexts:
    1- Redistribution into ISIS
    When you are redistributing routes into ISIS, you have the choice to set the metric-type as internal (between 0 and 64) or external (between 65 and 128)
    Internal metric are always prefer over external metric
    2- Set the MED to reflect IGP cost to the NH on eBGP updates
    You are receiving an iBGP update and before sending it to your eBGP peers, you want the MED for that prefix set to your IGP cost to the iBGP peer announcing this prefix.
    In this case the IGP can be anything.
    This command is not necessary if you are redistributing the route into BGP directly instead of receiving them from iBGP. In such case, the MED reflects by default the IGP cost of the redistributed prefix.
    HTH
    Laurent.

  • How file dowloading concept works using servlets.

    How file dowloading concept works using servlets.
    We will get window when downloading something from site
    if we close that window downloading stops.
    how this process works if we use servlets .
    Or what are the general concepts for downloading a file

    How file dowloading concept works using servlets.You send a request and get a reply stream. Where the servlet gets the data from is totally irrelevant.
    We will get window when downloading something from
    site
    if we close that window downloading stops.
    how this process works if we use servlets .If you close that window, downloading stops.
    Or what are the general concepts for downloading a fileSend a request, get a reply stream.

  • How many Internal sessions?

    Hi,
    How to find out that a particular program uses how many internal sessions?
    Is there any function module?
    Regards,
    Rahul

    Hi rahul,
    When you call a function module, the ABAP runtime system checks whether you have ... It is only of limited value for passing data between internal sessions.
    http://help.sap.com/saphelp_nw70/helpdata/en/c6/617d0ce68c11d2b2ab080009b43351/content.htm
    thanks
    trinadh

  • How group by works internally

    Hi,
    I would like to know how group by works internally using data and index cache( informatica uses data and index cache... not sure oracle uses the same). Consider the following table T with columns A and B.
    A      B
    A1    1
    A2    2
    A1    3I am selecting SUM(B) GROUP BY A
    My understanding is as follows
    1. Reads row 1 and stores in data cache.
    2. scans entire table to find the A1s. As an when a row is found, cache them to data cache.
    3. Perform SUM for A1 and store result in index cache.
    4. Above steps repeated for A2 also.
    Please let me know if this is true.
    Thanks,
    Saff
    Edited by: saffron on Nov 19, 2009 9:18 AM

    saffron wrote:
    I would like to know how group by works internallyWhy?
    using data and index cache( informatica uses data and index cache... not sure oracle uses the same).It caches data and indexes but it doesn't use those terms
    I am selecting SUM(B) GROUP BY A
    My understanding is as follows
    1. Reads row 1 and stores in data cache.
    2. scans entire table to find the A1s. As an when a row is found, cache them to data cache.
    3. Perform SUM for A1 and store result in index cache.
    4. Above steps repeated for A2 also.
    Please let me know if this is true.
    Very unlikely.
    The grouping algorithms are internal, undocumented and subject to change and of little use to know outside of the Oracle development team.
    If you just want to learn about Oracle you would probably be better off reading about the documented features for your database version.
    http://tahiti.oracle.com/

  • How to pass data between two internal sessions using ABAP memory?

    Hi,
    How to pass data between two internal sessions using ABAP memory?
    It would be fine if you could explain with an example.
    And also let me clear about the data passing between two main sessions and two external sessions with specific examples.
    Thanks.

    Hi ,
      check the example.
    Reading Data Objects from Memory
    To read data objects from ABAP memory into an ABAP program, use the following statement:
    Syntax
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
    In this statement, the system does not check whether the structure of the object in memory is compatible with the structure into which you are reading it. The data is transported bit by bit. If the structures are incompatible, the data in the target field may be incorrect.
    PROGRAM SAPMZTS1.
    DATA TEXT1(10) VALUE 'Exporting'.
    DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    DO 5 TIMES.
      ITAB-BOOKID = 100 + SY-INDEX.
      APPEND ITAB.
    ENDDO.
    EXPORT TEXT1
           TEXT2 FROM 'Literal'
      TO MEMORY ID 'text'.
    EXPORT ITAB
      TO MEMORY ID 'table'.
    SUBMIT SAPMZTS2 AND RETURN.
    SUBMIT SAPMZTS3.
    The first part of this program is the same as the example in the section Saving Data Objects in Memory. In the example, the programs SAPMZTS1 and SAPMZTS2 are called using SUBMIT. You can create and maintain the programs called using the SUBMIT statement by double-clicking their names in the statement. For further information about the SUBMIT statement, refer to Calling Executable Programs (Reports)
    Example for SAPMZTS2:
    PROGRAM SAPMZTS2.
    DATA: TEXT1(10),
          TEXT3 LIKE TEXT1 VALUE 'Initial'.
    IMPORT TEXT3 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT3.
    IMPORT TEXT2 TO TEXT1 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT1.
    Example for SAPMZTS3:
    PROGRAM SAPMZTS3.
    DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.
    LOOP AT JTAB.
      WRITE / JTAB-BOOKID.
    ENDLOOP.
    The output is displayed on two successive screens. It looks like this:
    and
    The program SAPMZTS2 attempts to read a data object TEXT3 from the data cluster "text", which does not exist. TEXT3 therefore remains unchanged. The existing data object TEXT2 is placed in TEXT1. In both cases, SY-SUBRC is 0, since the cluster "text" contains data.
    The program SAPMZTS3 reads the internal table ITAB from the cluster "table" into the internal table JTAB. Both tables have the same structure, namely that of the ABAP Dictionary table SBOOK.
    Pls. reward if useful.....

  • Session Rules from Servlet to JSP

    I'm getting a null pointer exception from the else statement in the JSP below when I check to see if a user has been authenticated by a servlet.
    Are there any problems with the else statement to cause an exception?
    <% /**Verify Authenticationt*/
    HttpSession mysession = request.getSession();
    String loginUrl = "/hr/servlet/SessionLoginServlet";
    if (mysession==null)
    response.sendRedirect(loginUrl);
    else {  //below code causing null pointer exception
    String loggedIn = (String) mysession.getAttribute("loggedIn");
    if (!loggedIn.equals("true"))
    response.sendRedirect(loginUrl);
    %>
    The Servlet's doPost:
    public void doPost(HttpServletRequest request, HttpServletResponse
    response)throws ServletException, IOException {
    String userName = request.getParameter("userName");
    String password = request.getParameter("password");
    if (login(userName, password, response)) {
    //send cookie to the browser
    HttpSession session = request.getSession(true);
    session.setAttribute("loggedIn", new String("true"));
    response.sendRedirect("/hr/jsp/PAStart.jsp");
    else {
    sendLoginForm(response, true);
    }

    Unfortunately, no. You'll need to say:
    if (loggedIn != null || !loggedIn.equals("true"))
    It's how the equals() works for String objects. You need two objects to check equality.

  • How webservice is working in BI

    Hi,
    How the web service is working in BI.
    As i know that we are using web service for legacy systems.
    But how does it work in internally?

    Hi Krish,
    Please check this document
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/bw-and-portals-05/utilizing%20web%20services%20to%20move%20data%20in%20and%20out%20of%20sap%20bw%203.5%20more%20smoothly.pdf
    Regards,
    Praveen

Maybe you are looking for

  • Ossoreg Error

    I hope somebody can help me with this threat, i'm trying to configure my SSO Plugin with a IIS listener, following instructions as described in Appendix B (Using Oracle Application Server SSO Plug In), i built the command: java -jar e:\oracleas\sso\l

  • Problem in accessing the database through VPN

    I am having problem connecting to the database through VPN but it is working perfectly fine if i connect to the network directly. It would be really great if you could help me to resolve this issue. Thanks

  • Best way to design methods in a class.  Pass parameters or use members?

    Say I have a class. public final class AvgOuncesChart extends Base {     private TimeSeriesCollection ouncesCollection = new TimeSeriesCollection();     private TimeSeries ouncesSeries = new TimeSeries("Oz. Film/Pallet");     private NumberAxis ounce

  • Process to activate BI Content

    Hi All I'm having issues while activating BI Content InfoObjects. Kindly endorse if the following steps are correct? 1. We have activated DataSources (RSA5) in Source System 2. We then transferred Application Hierarchy (RSA9) in Source System 3. In B

  • Regarding Compounded Infoobject

    hai i knew about compounded Infoobject Theoritically . I want to know 'how to map the compounded infoobject' and 'how to map the source system to source system-id' like that real time stuff ... Still now i didnt use this Compounded Infoobject . So pl