ServletContext and ServletConfig

Hi Techies,
Suppose in a web server 2 Servlet and two jsp files are running.
My question is how many ServletContext and ServletConfig instance will be created in my server?
Thanks in advance.

Hi Dear
There is only one servletConfig objectper servlet and only one servletContext object per web app.
All d Best

Similar Messages

  • Need information abt ServletContext and ServletConfig

    i want to know the information and difference b/w in ServletContext and ServletConfig pls help me.
    Thanks&Regards
    kishore

    ServletConfig serves a very specific purpose, a means to get configuration parameters from the web.xml INTO you servlet. AFAIK, it doesn't serve much purpose beyond that...
    ServletContext provides the mechanism for a Servlet to communication with the Container. You can get path information, use it to store application wide attributes and parameters, etc.
    The two really have absolutely nothing in common. So to answer your rather vague question:
    "The difference b/w ServletContext and ServletConfig: Everything."
    Do you have a more specific question? Is there a particular thing (like maybe the fact they both have methods named getInitParameter and getInitParmaterNames....) that is confusing you?

  • What is the difference between ServletContext and PageContext?

    What is the difference between ServletContext and PageContext?

    Well, the most glaring difference would be, there is one ServletContext per web application, whereas there is one PageContext per page.
    ServletContext acts as the broadest of scopes, all JSPs, and Servlets in a given web application, called by every client will share the same ServletContext.
    PageContext acts las the smallest scope. Each JSP in a given web application gains its own PageContext, each time the page is called, with different ones for different users, or when the same user calls the same page multiple times.

  • How ServletContext and Session object differ in a Serlet

    Both ServletContext and Session allows storing objects as a name value pair set and they can be accessed across several servlets/JSP's. How do they differ?

    Hi
    The Main difference is their visibility or rather the scope of the varibles differs depending on whether they are stored in the session or the Servlet Context.
    When you say that an Object is stored in the session then it means that the Object is available to the application for duration of the particulars user's session i.e. as long as the user's session is active the Object is available though not for others who will have a different session and so will not be able to access this information.
    Whereas, when you add the Object to Servlet Context you are setting up the object to be visible throughout the application for duration of the application itself and for any component that is art of the application
    So if we have a list of Object storage/sharing mechanisms listed in descending order of object life span/visibility then we have:
    Application - ServletContext
    Session - HttpSession
    Request - ServletRequest
    Page
    Keep me posted on your progress.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems
    http://www.sun.com/developers/support

  • ServletContext and ServletContextAttribute listener query

    I have 2 listener classes : One that implements ServletContextListener and other that implements ServletContextAttributeLIstener.
    I have put println statements in each of the implemented methods of the corresponding listener.
    I am using tomcat as container.
    In my deployment descriptor I have the following entry for context init parameters:
    <context-param>
              <param-name>     context name     </param-name>
              <param-value>     context value     </param-value>
         </context-param>
    When I start tomcat I get the below output in the console.
    Jun 9, 2007 10:48:19 AM org.apache.coyote.http11.Http11BaseProtocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Jun 9, 2007 10:48:19 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 906 ms
    Jun 9, 2007 10:48:19 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Jun 9, 2007 10:48:19 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
    Jun 9, 2007 10:48:19 AM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    context initializes
    attribute added:
    context initializes
    attribute added:
    Jun 9, 2007 10:48:20 AM org.apache.coyote.http11.Http11BaseProtocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Jun 9, 2007 10:48:20 AM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Jun 9, 2007 10:48:20 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/47 config=null
    Jun 9, 2007 10:48:20 AM org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    Jun 9, 2007 10:48:20 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 1108 ms
    As can be seen by the bold lines, the ServletContextEvent and ServletContextAttributeEvent are fired.
    I can understand the initialization part, but what about the attribute one, i havent added any attribute, yet I get the corresponding event is fired.
    Also from the output it seems that the initialization takes place twice.
    I wonder if the container initialized the ServletContext object with some value and also adds some attribute to it. Please let me know if this is the case.
    Also, is there a way by which the attribute that was added to the context object can be obtained in the corresponding listener class. The event.getSource() returns object of ServletContext I guess.
    Regards,
    Joshua

    Check your tnsnames.ora file, it will have an entry like
    listener_facdb =
    (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL=TCP) (HOST= danube103) (PORT=31415))
    )When you create a listener on a non-default port, PMON should be able to register the database service(s) with this listener.
    PMON utilises tnsentry naming method for this. PMON will look in tnsnames.ora file for the value it found in LOCAL_LISTENER.
    If it doesn't find this entry in the tnsnames.ora file, it will throw error.
    Alternatively, you could just use
    alter system set local_listener='(ADDRESS = (PROTOCOL=TCP) (HOST= danube103) (PORT=31415))' scope = both;But this isn't very readable. Is it ?

  • Is WL6's ServletContext and HttpSession implementation Serializable?

    As the subject stated
              Rgds,
              Raymond Mok
              

    No, they are not serializable.
              mark
              Raymond Mok wrote:
              > As the subject stated
              >
              > Rgds,
              > Raymond Mok
              

  • Counting how many active sessions in a webapp

    Hi folks,
    I was wondering if it is possible to count how many active sessions that there currently are in a webapp? I've looked at the ServletContext and ServletConfig classes, but I can't find anything. Any ideas?
    Cheers,
    Raj.

    HttpSessionListener was introduced in servlet spec 2.3 which is supported in Tomcat 4.0 but not 3.3.
    If upgrading to 4.0 is not an option, there is no elegant way to get what you need. There is no API call that returns all the active sessions so you must do it yourself. One way is to create a class that implements HttpSessionBindingListener to track your sessions. Instantiate it on start-up and add its reference as a session attribute when the session is first created. You can then update your custom session info in the valueBound and valueUnbound methods.

  • Unable to find an answer yet

    What's the use of init() method, when we can use a constructor instead?
    How do we create multiple instances of the same servlet class?
    Can someone please explain?
    Ashokditya

    Actually you can put code in a no-argument constructor for your servlet but the constructor is called before the servlet gets a reference to either the ServletContext and ServletConfig and there's not much of any value that you can do without either of those two which is why the init mehod exists.
    You create multiple instances of the same servlet class by using the web.xml:
    <servlet>
    <servlet-name>servlet1</servlet-name>
    <servlet-class>com.play.servlet1</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>servlet1X</servlet-name>
    <servlet-class>com.play.servlet1</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>servlet1</servlet-name>
    <url-pattern>/servlet1</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>servlet1X</servlet-name>
    <url-pattern>/servlet1X</url-pattern>
    </servlet-mapping>
    The servlet engine (at least tomcat 5.0 does) will instanciate two instances of the servlet1 class. You could then use init parameters in the web.xml to configure the two instances differently. Not sure how of how much value this is.

  • How the store and retrieval in ServletContext will happen??

    Hello Sir,
    I am developing a chat application thats in Swing & servlets Now I am able to authenticate user and I am using ArrayList to maintain the names of the user globally my storing it in ServletContext
    How to store and retrieve ArrayList from Servletcontext
    And another thing is that we are having personal chat(1-to-1) also. But how to use the thread model is not known to us as we have not faced such a situation before
    So if you could suggest some example code or snippets ot certain links then it would be of great help to us
    Thanks
    Regards
    Monarch

    Hello
    thanks for your reply. Actually we are doing the same thing that u have mentioned in your reply.
    The thing we are trying to do is that when a user is logged in the particular servlet which is responsible for the authentiacation of the user will authenticate the user an then calls method in the Chatter class which is outside the servlet
    The Chatter class declares two mwthods addChatter() and getChatter()
    I am managing the currently logged users in Arraylist using this two mehtods above
    When the first user logs in his entry gets stored at the first position in the arraylist but when other user logs in then his entry overrites the entry of the first user instead of getting stored in the next position.
    The arraylist gets initialized when second user logs in. to overcome this problem i want to store the arraylist into the ServletContext so it will be unique for the whole application and will not get initialized
    So I want to know the process of storing and retrieving the arraylist fro the context
    Hope ull understand me and reply me
    Thanks
    Regards
    Monarch

  • Passing Objects: ServletContext versus JNDI

    I am currently developing a Web application that uses a variation of the (often recommended) model-view-controller architecture. Specifically, I have a single Front Controller Servlet that identifies what the request is for, and then delegates processing to an appropriate RequestHandler object. As implied by the name, the RequestHandler object has access to the original HttpServletRequest object.
    In its init() method, the Front Controller Servlet prepares a pool of database connections. Each RequestHandler will obtain a connection through a DataSource object (in accordance with "best practices" for using the JDBC 2.0 Optional Extension). Then, the RequestHandler will retrieve data from the database, instantiate a Java Bean, and pass the Bean on to a corresponding JSP page for display.
    Here is my dilemma: what is the best way to make the DataSource available to the RequestHandler objects?
    Most sources suggest registering the DataSource with JNDI, but - as far as I can tell - this seems to require "administrative" access to the Web application server. For example, performing this action with Tomcat 4.0 requires modification of the server.xml file (as described at http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html).
    I would prefer to just stuff the DataSource into the ServletContext so that it is accessible throughout my Web application. (Then my DataSource would not be accessible, via JNDI, to other applications on the same server - such as in a shared hosting environment.) However, the problem is that my helper classes - the RequestHandlers - are not Servlets or JSPs (just regular classes), and therefore do not have access to a ServletConfig and, consequently, cannot access the ServletContext. Of course, I could stuff a reference to the ServletContext in every HttpServletRequest before passing it on to the helpers, but that doesn't seem "clean."
    So, to summarize this lengthy inquiry,
    (1) How can helper classes (i.e., not Servlets) access the Web application context (ServletContext)?
    (2) What are the advantages/disadvantages to using JNDI to expose resources, versus simply storing objects in the ServletContext object, when trying to make resources available throughout a single Web application?
    Thanks!
    - Scott
    [email protected]

    Right you deal two problems:
    1 The passing of servletcontext to helper classes. You can avoid this by creating a web application and storing it in a war file. You place all your servlets/jsp/helper classes in the war file according to a given structure. Each war file has a web.xml file. The web.xml file has all mappings between names in the program and the references to the objects. The web.xml can also have references between jndi names and references using the <env-entry> tag. There is only one servletcontext per web application. You can place all the information that both helper classes and servlets use e.g. jndi references into the web.xml. It is possible for the servletcontext and helper classes to refer to the same web.xml.So you have no need to exchange a servletContext reference around. See information on servletcontext interface:
    http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletContext.html
    Second the question of isolating Datasources between applications. Could you not password protect the datasources so that access is only permissible if you have the correct password? Hence you can control the use of the datasource.
    There are a number of tools to create a war application and to add jndi references to a war file.
    You can use the graphical deployment tool from Sun's J2EE implementation.
    All details for creating a war file are: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WebComponents3.html
    There are facilites to register environment variables like DataSources using the tool - look in the J2EE tutorial under configuring web clients.
    Or you can use the packager tool found in Sun's J2EE application:
    http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Tools7.html
    You can then port these war files onto tomcat to be hosted.
    You will need to download the J2EE implementation.
    For information on how to structure your web application and create a war file see: http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Tools7.html
    All information to create J2EE components:
    http://developer.java.sun.com/developer/onlineTraining/J2EE/Intro/
    Hope this helps.

  • One EAR , three WARS, How many ServletContexts ?

    I have deployed three war files in one ear file.
    How many sevletContext and servletConfig I would have ?

    You'll have 3 ServletContexts and the number of ServletConfigs depends upon the number of servlets you have in your wars...

  • MVC model in Web systems and applications

    MVC model in Web systems and applications
    Object-oriented design model is experience, MVC idea is a user interface for the original. This article discusses how the major application areas in the new Web design patterns and the use of MVC framework. The article first introduced the concept of design patterns and characteristics, and MVC architecture design concepts and analysis of the MVC framework contains several key models. Based on the characteristics of Web applications on how to use patterns and MVC framework made some design ideas.??
    1. Introduction
    1.1 design model
    Object-oriented technology and the emergence of software applications has greatly enhanced the trusted and software quality. Object-oriented programming than previous models to various programming simple and efficient, but the object-oriented design methodology than the previous design methods to complex and much more skill, a good design should be both on the issue of gender, but also to take full account of the problems and needs sufficient interoperability. In the past 10 years, people in the object-oriented technology and the practical application of research to explore certain issues in relation to the creation of a number of good solutions, the so-called object-oriented design patterns. Object-oriented technology is one of the purposes of enhancing the software trusted, and to design model, design programmes in important positions from a deeper sense of meaning and essence embodies trusted. There are many people in the design model definition, which cited Christopher Alexander is the largest design model definition : Each design model is a tripartite rule, which expresses a contextual environment (Context), a problem and a solution. Design models generally following basic elements : model name, the purpose solution effect 1995-1998 code and related design models. There are several classifications design patterns can be divided into a model based on the purpose (Creational), structural type (Structural) and the type of behaviour (Behavioral) three. It is mainly used in the creation of a model-based object model-based structure to deal primarily with the category or combination of objects, used to describe behavior-based model is the main target for the category or how stress and how to allocate responsibilities. Design patterns can be divided into categories based on the scope and target mode model type model dealing with the relationship between the categories and sub-categories, these relations through the establishment of succession in Translation moment to be finalized, are static. Model is targeted at addressing the relationship between the moment of change these relations in the operation, more dynamic. Model features : through the experience acquired in a structured format to write down, avoid encountering the same problems on the first design, exist in different abstract level, in continuous improvement, can be trusted artificial product for the design and best practice in the world to be combined to address larger issues.
    1.2 MVC framework
    MVC was first used in a user interface Smalltalk-80 China. M representative models Model, representatives maps View V, C representatives controller Controller. MVC trusted code with the aim of increasing the rate of data reduction expressed, the data describing the operation and application coupled degrees. Also makes software Keweihuxing, restorative, expansionary, flexibility and packaging of greatly enhanced. Single-user applications are usually incident-driven user interface to the organizational structure. Staff development tool with an interface painting of a user interface interface code based on user input and then prepare to implement the corresponding moves, many interactive development environment encouraged to do so, because it emphasizes first and then a functional interface. Some software design model is the strategy that will be fixed before the code into the regular system of the final. Result is that the procedures and organizations around the user interface elements in the user interface elements of those moves, data storage, applications and functions of the code is used to indicate the way intertwined. In single-user system code structure can be so, because the system will not demand frequent changes. But for a large system such as large Web systems, or e-commerce systems to be applied. Model by incorporating data from a variety of access and control data can be separated to improve distributed system design. MVC design pattern is composed of three parts. Model is the application object, no user interface. Type in the screen showing that it represents the flow of data users. Controller user interface definition response to user input, the users responsible for the action against the Model into operation. Model View data updated to reflect the adoption of data changes.
    2. MVC design pattern,
    An MVC framework for the design of the system includes many models, but with MVC is most closely related to the following three models : Observer, Cambridge and Strategy.
    2.1 Observer models
    MVC through the use of purchase / notification form and the separation of the Model View. View to ensure that their content accurately reflected Model and state. Once Model content changes, there must be a mechanism to allow notification to the relevant Model View, View can be made relevant at the appropriate time updating of data. This design is also more general problems can be solved, the target separation, making a change to the target audience affect others, which targets those who do not know the details of the object being affected. This is described as Observer in the design model. Model type : Observer model is the object-oriented model, it is behaviour-based model. Model purposes : definition of hierarchical dependence relations between objects, or when a target value of the state change, all its dependent relationship with the object are notified and automatically updated. There are a variety of data may show a way, in different ways and may also show. When a way through a changed data, then the other should be able to show immediately that the data change and do accordingly.
    Effect :
    1. Abstract coupling. I only know that it has a target audience of some observers, the observers met each abstract Observer category simple interface, does not know their specific affiliation categories. This makes the coupling between goals and observers smallest and abstract.
    2. Support radio communications. Needless to notify designated observers goals, how to deal with the observer informed decisions.
    3. Possible accidents updated. We update logic, avoiding mistakes updated.
    2.2 Faculty model
    MVC is an important feature of View can nest. Nest can be used for any type of combination of local maps available, but also management of type nest. This thinking reflects the type and mix of components will be equal treatment design. This object-oriented design ideas in the area of Cambridge has been described as a design model. Model types : Cambridge model is the object-oriented model, it is also the structure type model. Model purpose : to target portfolio into tree structures to express "part-whole" level structure. Prepared for the use and combination of individual target audiences with the use of consistency.
    Effect :
    1. Definition of a target portfolio includes simple objects and the structure of the category level. Simple objects may be complex combinations of objects, and can be targeted portfolio mix. This customer-code used in the target areas can use simple combinations target.
    2. Simplify customer-code. Needless to know their customers - a mix of target audiences is a simple target or can use these items in a consistent manner.
    3. Easier to add new types of components. New components can easily be changed to a combination of customer-targeted codes.
    2.3 Strategy model
    Another important characteristic is the MVC can not change the View of changes View response to user input. This often requires a change in response to the logic of the system is very important. MVC to respond to the logic involved in the Controller. Controller of a category level structure could easily change to the original Controller appropriate, a new Controller. View Controller son used to achieve a specific example of such a response strategy. To achieve different response strategy, as long as examples of the use of different types of replacement will Controller. Also in the running time by changing the View Controller for users to change View of response strategies. This View-Controller relationship was described as an example of Strategy design pattern. Model types : Strategy model is the object-oriented model, it is behaviour-based model. Model purposes : definition of a series of algorithms, and their packaging, and ensure that they can replace each other, making algorithms can independently use its customer-change.
    Effect :
    1. Strategy category levels for Context definition of the relevant algorithms can be trusted or behaviour.
    2. Alternative methods of succession. If the direct successor Context, with different acts will be added Context act, the realization of which would algorithm mixed up with Context, Context hard to preserve and expand, but can not dynamically changing algorithms. Will be enclosed in a separate Strategy category algorithms to enable algorithm independent Context change easily cut over expansion.
    3. Can provide the same acts different date.
    4. Strategy-must understand what customers between different.
    5. Context and Strategy communications between costs.
    6. An increase in the number of targets.
    3. MVC in Web application system
    Now some of the distributed systems such as Web-based B2B e-commerce system, suitable for use MVC framework. Through analysis from the perspective of high-level applications can be a target divided into three categories. Category is shown for the target audience consists of a group of commercial rules and data, there is a category that is receiving requests to control commercial target to complete the request. These applications often need to change is shown, such as web style, color, but also need to demonstrate the contents of the display. And the business rules and data to be relatively stable. Therefore, said that the frequent need to change the View objects that the business rules and data model to be relatively stable target, and that the control of the Controller is the most stable. When the system is usually issued after the View objects by artists, designers or HTML/JSP system managers to manage. Controller target applications development personnel from the development and implementation of rules for commercial and business development personnel from the target data, database managers and experts in the field of common completed. Show in Web?? or customers - control logic can be Servlet or JSP, dynamically generated Html. Generally used Servlet better than using JSP. JSP will be better with the Html code of separate codes for page designers and developers of separation efficiency. Servlet and JSP can complete all complete functions, actually JSP eventually converted into a Servlet. And control of the target system exists in every level, the coordination of cross-layer moves. Contain business rules and data objects exist in the EJB layer (EJB-centred model) or Web?? (Web-centred model).
    3.1 View in the Web application system
    View of the system shows that it fully exist in Web??. General by JSP, Java Bean and Custom Tag. JSP can generate dynamic web content using Java Custom Tag easier Bean, but it can show the logic of packaging, and more conducive to modular trusted. Some well-designed in a number of JSP Custom Tag can even be used in different system duplication. Model for control of JSP and Java Bean objects. JSP through Java Bean objects to retrieve the data model, the Model and Controller object is responsible for updating the data on Java Bean. In general, can we devise all possible screen that users can see all the elements of the system. Based on these elements, to identify the public part of passive components and dynamics. Can consider the use of templates means to separate the content generated JSP public, also need to change their generation Html or JSP from a JSP templates to dynamically introduce these different parts (include methods). Another issue to consider is screen option, when dealing with End users request template automatically available to show that the concern that users must know what is the screen components. So can consider all screens on the definition of a centralized document, such as a document or text document java. Taking into account the possibility of changes in future document definition screens, the best use of text documents such as a XML document, so future changes to the recompilation. According to the URL and user input parameters to shine upon the results of a screen, of course, likely to be made on the basis of the outcome of the implementation of actions to choose different results screen. Therefore, the need for a request for matching resources with document (XML), if a URL request several different results, it must specify in the document need to control the flow (a controller object), as well as the corresponding screen different flows.
    3.2 Model in the Web application system
    Model objects represent business rules and business data exist in EJB layer and Web??. In J2EE norms, the system needs some data stored in the database, such as user account information (account model), the company's data (company model), some not recorded in the database. If a user browsing the current catalogue (catalog model), the contents of his shopping (shopping cart model). Which one of these models exist in the data according to their life cycle and scope to decide. In Web?? a HttpSession and ServletContext and Java Bean objects to store data in the EJB layer is a data storage and logic EJB to. Web?? the Java Bean objects stored in the model layer model of the EJB object data copy. Because there are many different EJB tier model targets, so Web?? through a ModelManager to control the EJB layer object model in ModelManger background model can be used for packaging methods. In the EJB layer and the rules have all the data into EJB model is inappropriate. If the database can visit the Dao object model into objects. Dao can be encapsulated and the specific details of the database in the world, if we can write a different table, a number of databases, or even multiple databases. If the orders can be a model for OrderDAO, it may have to deal with Order table, table and OrderItemLines OrderStatus table. Value can also consider the use of targets. Value can be a target of securing long-range targets, because every time the remote object attributes could be a long-range redeployment process will consume network resources. EJB objects in the distance can be used instead target. In the distance, one-time items to be targeted instead of the value of all attributes.
    3.3 Controller in Web application system
    Coordination with the Model View Controller object to the request of users into the system to identify incidents. In Web?? generally a MainServlet (or Main.jsp), and receiving all requests, it can use screen flow management devices (ScreenFlowManger) decided next screen. There is a general request processors RequestProcessor contains all requests are needed to be done to deal with logic, such as the request translated into system events (RequestToEvent). Acting processors usually also includes a request for ClientControlWebImpl, it is logical to deal with the EJB layer in Web?? Acting. In EJB layer, a layer for EJB tier Web ClientController provide the CD visit. Another StateMachine used to create and delete ejb handle Web?? sent to the incident. Controller Another important function is synchronous View and Model data. ModelManger contained in a ModelUpdateManger, it puts events into a Model System assembly that all the needs of synchronous Model, and then notify Listeners do synchronous operation.
    4. Concluding remarks
    In recent years, with the Internet technology development and the emergence of new business models, the Web is based on a large number of applications. On how to design these systems architecture, and gradually there has been some convergence of opinion, the most important point is that its structure should be rational in the open. Demand than ever faster development of technology and design concepts, systems for the future, the cost of upgrading the smallest, research software systems architecture still very useful and necessary.

    Bravo. And your point is?

  • Communication between applet and Web app (IE6 works IE7 doesn't)

    I'm not 100% sure this is the correct forum to post this in, but as the communication is initiated from the applet I'm posting it here.
    I have an applet that we are slowly breaking pieces out of into a web app.
    The details are as follows.
    The applet calls a servlet on the webserver with the following code.
    URL url = new URL("http://.................");
    ServletMessage message = new ServletMessage(url);
    InputStream returnStream = message.sendPostMessage(sending);The servlet takes the user credentials and other info that was sent and authenticates the user and stores the info that was passed into the session on the web server. Then based on the users permissions and where they want to go in the web app the servlets redirect method calls
    resp.getOutputStream().print("/AppName/appropriateServlet");This sends control back to the applet (including the url of the servlet that needs to be called) which then calls the appropriate servlet
    container.getAppletContext().showDocument(new URL("http://.............." + returnURL), "Title");Now the problem is that in the first and second servlet the request.getSession() returns two different sessions when running under IE7. IE6 returns reference to the same session.
    I don't know what has changed in IE7 but I was hoping somebody else has run into this, or can suggest a more appropriate forum to post this to?
    Thanks

    So the solution I came up with was when the applet jumps to the web app the first time instead of storing everything in session I store them in a map in the servletContext under their employee number.
    I then send control back to the applet with the url they should call. When the applet calls the web app for the second time it includes their employee number as parameter in the url.
    A Login filter then first checks to make sure it isn't on the first call, and checks to make sure they aren't in session... if so it pulls the map out of servletContext and transfers all the data back to the session and clears that user out of servletContext.
    So it stores the user in the servletContext during the transfer back and forth, then back in session like normal.
    I'm pretty sure it is going to work, but I can't test it because our mainframe test region is down which is what handles the authentication of the applet.

  • Broken pipe issue on Weblogic 8.1 and HP-UX

    Hey all,
    I get the following "broken pipe" error when stress-testing the Weblogic AS 8.1 installed on HP-UX 11.
    java.net.SocketException: Broken pipe
            at java.net.SocketOutputStream.socketWrite0(Native Method)
            at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
            at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
            at weblogic.servlet.internal.ChunkUtils.writeChunkNoTransfer(ChunkUtils.
    java:280)
            at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:241)
            at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:311)
            at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:
    387)
            at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:254)
            at weblogic.servlet.internal.MultibyteOutput.write(ChunkOutput.java:482)
            at weblogic.servlet.internal.ChunkOutputWrapper.write
    (ChunkOutputWrapper
    .java:125)
            at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutput
    StreamImpl.java:184)
            at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66
            at java.io.BufferedOutputStream.write(BufferedOutputStream.java:110)
            at java.io.FilterOutputStream.write(FilterOutputStream.java:80)However, a quick glance on the forums revealed that this also happens on Weblogic+linux or tomcat+linux.
    Looks like an operating-system issue. Anyone has a clue ?
    Thank you,
    Cristian

    The following is the scenario where the broken pipe exception occurs to me:
    - webapp on a Linux server with Apache + Tomcat.
    - database (SQL Server) on another computer.
    - the webapp creates one db connection at startup, stores it in the ServletContext and always uses that connection for any db access.
    - If the db server is restarted, or just the SQL Server service is restarted, the connection that was in the ServletContext becomes invalid, and any attempt to access the db through it throws the broken pipe exception.
    At this point the webapp has to recreate the connection and re-store it in the ServletContext in order to gain access to the db again.
    HTH

  • Error importing ""import javax.servlet.ServletContext;""

    Hello:
    I have a JSC update 2 application. My problem is this:
    In the file ViewHandlerImpl.java (only read) i have an error ipmorting javax.servlet.ServletContext, and i have another error in this lines:
    if (!(context.getExternalContext().getContext() instanceof ServletContext)) {
    if (PhaseId.INVOKE_APPLICATION.equals(phaseId) ||
    context.getRenderResponse() ||
    context.getResponseComplete()) {
    destroy(context);
    return;
    In the first line i have the error, this error says that:
    cannot find symbol
    Symbol: class ServletContext
    location: class com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl
    The library exists in my project, any idea how to solution this problem?
    Thanks

    I'm guessing that you are using an IDE. The import line getting red means the class you are trying to import is not in the class path.
    So if you are using an IDE then normally there is a place to add external jar files to your project.If you can tell me which IDE you use I may be able to help(if im familiar with that IDE)
    the next thing is the name of the jar file. it's servlet-api.jar. you can get it from tomcathome/common/lib if you are using tomcat

Maybe you are looking for

  • Error :  java.util.MissingResourceException

    Hi Friends, I had developed one web dynpro application by using Internationalization - I18N of WebDynPro (Java) Application (Blog) but I got one error that is <b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.lang

  • How do I get Apple TV2's "Computers" to display my computer ??

    How do I get my computer to display on the Apple TV2 menu in the Computers category ??  I have homesharing turned on in iTunes and Apple TV2 using the same login name and password.  Is it a firewall problem ?  The other areas of Apple TV2 are working

  • My message center in settings shows the wrong phone number, how do I change it

    Under settings, messages, send and receive. The phone number listed is my husbands number.  How can I change it to mine?   It was originally listed under my number.

  • Calling method from to EO

    I need to call methods filtrarMatricula(codigo) from my EOImpl. this method is in AppModuleImpl. that I can do? thks

  • Where does this file go??

    import java.net.URL; import java.net.MalformedURLException; import java.io.InputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.FileNotFoundException; public class Test{        public static void main(String[] para