Maintaining session

hi all..
am using tomcat6 server..... i've three web appllications in there.....how do i maintain my session thru these three web application.... any1 help me out of this........

gunmark wrote:
no... am not using any servlet to call other web context.... say for example
http://localhost:8080/appA/menu.jsp
http://localhost:8080/appB/work.jsp
am calling appB's work.jsp from appA's menu.jsp when i submit a button
>
is it possible to do it in dis way............... or how do i do it????Its your homework,
if yes
ask your teacher how to do it,if no
try to refer books indepth.. (both servlet and jsp) please....regards
vijay.dr

Similar Messages

  • Maintaining Session State

    Hello,
    Does anyone know how to maintain session and application variables through server restarts? I want to be able to shutdown and startup my Tomcat server without having the users lose their session and application variables (and consequently, their data and login state).
    Any ideas?
    Thanks!
    -David

    I dont think its possbile since stopping and restarting gets new sessions. Only way that I would know would be to use cookies.
    But then again i dont like the idea of saving passwords in cookies

  • Maintain session in JSP frame

    Hi,
    I am having trouble in maintaining session in jsp frames. -
    Here is sample code
    parent.jsp
    <HTML>
    <HEAD>
    <LINK rel=stylesheet type="text/css" href="defaults.css">
    <TITLE>abc</TITLE>
    <%     
         String checkAmount = "100.00";
         session.setAttribute("checkAmount", checkAmount);
         System.out.println("checkAmount in ppmain"+session.getAttribute("checkAmount"));
    %>
    <FRAMESET rows="235,*" frameborder="no" >     
    <FRAME NAME="pptop" SRC="top.jsp" frameborder=0 scrolling=no noresize >
    <FRAME NAME="ppbottom" SRC="bottom.jsp" frameborder=0 scrolling=no marginwidth=0 marginheight=0 noresize>
    </FRAMESET>
    </HTML>
    top.jsp -
    <HTML>
    <HEAD>
    <LINK rel=stylesheet type="text/css" href="defaults.css">
    <TITLE>top</TITLE>
    <%     
    System.out.println("session in top "+session);
    System.out.println("checkAmount in top "+session.getAttribute("checkAmount"));
    %>
    </HTML>
    It is not able to retain session in the top.jsp ( in SOP for session I get different session ID in parent.jsp and top.jsp
    This Works well in local but when gets deployed to WAS6 server troubles starts.
    Any help is appreciated.
    Thanks

    When you create URLs, you might want to try using JSTL to rewrite them:
    <FRAME NAME="pptop"
           SRC="<c:url value='top.jsp'/>"
           frameborder=0
           scrolling=no
           noresize >
    <FRAME NAME="ppbottom"
           SRC="<c:url value='bottom.jsp'/>"
           frameborder=0
           scrolling=no
           marginwidth=0
           marginheight=0
           noresize>Or you can use:
    SRC='<%= response.encodeURL("top.jsp") %>'

  • Regarding maintaining session in flex

    Hello,
              I am developing a flex application which is using jsp for database connectivity. I am using HTTP request for connecting to jsp page and passing and retrieving parameters. Now I wanted to ask how can I maintain session in flex so that I can know which client has logged into the system and on the basis of that can assign privileges to the client. Is it possible in flex and how?Reply needed urgently.
    Thanks in advance.

    Hi a.bhavika,
    There is not specifically any session management in Flex as it runs everything on the client side if at all you want to mainatain you can maintain it on the server side. ...and I think for your case I dont think you need any session managemenet as at the time of login only you can identify which user has logged in to the syetem and based on the user logged in you can load all the previleges of that particular user in the Flex application.
    Check out the links below for your understanding...
    http://www.forta.com/blog/index.cfm/2006/9/24/flex-and-session-state-management
    http://www.assembla.com/wiki/show/romoz/Session_Management_in_Flex
    Thanks,
    Bhasker

  • Maintain session in Multiple soap calls

    Hi Experts,
    We have an requirement which runs 2 synchronous calls.
    1st synchronous cal is for validating user credentials and
    2nd synchronous call (for successful log in) for uploading data in R/3 system.
    The main task is to maintain session(ex: time 15 mins) .
    1st synchronous call looks like Mobile Application (soap sender)<--->PI<----->(Soap receiver)Active Directory.
    2nd synchronous call looks like Mobile Application (Soap sender)<--->PI<----->(Proxy)R/3 system.
    can you pls let me know how can I achieve this requirement and
    how to maintain session ID, session (is it in PI or in third party) and from where to maintain session.
    Thanks in Adv..

    I am calling multiple web service apis from my bpel process on the same link. The Web services are written such that I always have to call a "login" api first which creates a context that's maintained throughout the session. Thus subsequent ws calls have to be made in the same session because all the other web service apis require the context to be present.
    You can think of this as a stateful SessionBean (sort of).
    The question is does bpel support this?

  • Maintaining Sessions through Multiple Servlets and Contexts

    Hi,
    I have a webapplication that works like this:
    * User connects to a login servlet on HTTPS
    * Users information is authenticated on HTTPS
    * An object is stored in the session for other servlets to validate the users access
    * Authenticated users are forwarded to an HTTP page where the session is used to make sure they were granted access
    My problem is this....Since I create the session in an HTTPS context, when I am in the HTTP context, I am unable to access the session and constantly get NULL. Is there any way that I can access the session from an HTTP context?

    What you can do is, just login using HTTPS and switch over to HTTP
    and then store data in session.That is true, but what I want in the session is basically a flag on whether or not the user was granted access. I would much rather set all that up on the secure line, and then just access it from the unsecure ones...
    For example, you are creating session using the
    http://testdev:port/index.jsp page.
    If access the same page(with hostname)
    http://10.300.20.18:8080/index.jsp, you can't get the session even
    though both are same web server and same web application. Because the
    browser treats it different sessionI think if you use my above solution with the explicit passing of the jsessionid, you can move from one domain to another and still maintain session. Not positive on that though...

  • Maintaining session in portal

    Hi,
    I want to maintain session expire time in portal for my iViews both Porta components and Web Dynpro. Where can I set this value.
    Please let me know
    Thanks
    Bobby M

    Hi,
       I'm sorry. Messed it up Go through Web Dynpro application needs to never expire..
    Regards,
    Satyajit.
    Message was edited by:
            Satyajit Chakraborty

  • Maintain session

    I have a client side java program running. It is to comunicate with a web server using HTTP. How do I maintain session in my java program in the client machine. I have no access to the web server.
    java.net.URL and java.net.HttpURLConnection are not maintaining session, tough allow me to transact. It creates a new session for every hit.
    help!!!
    Trijoy
    [email protected]

    Hello Darted,
    I have a small task ahead. My boss hates logging in userid and passwords every time he logs ont a site, which he dose 10-15 times a day. Due to session timeouts, he has to repeat the login process.
    The requirement is that, I should have a process running, that will maintain the session throughout the day by hitting the URL every 18 mins or so..(session timeout is of 20 mins), and when he writes the URL the old session is maintained.
    The process is such that it sends data over http to the server. The data is accepted only for the live and valid session. At present we are sending it through a form (post). If the state can be maintained in the java applet, swing or whatever, we will remove the HTML form and will automate the process of form sending.
    I am looking for a mechanism which emulates a browser, i.e. maintain the session till it gets time out or browser is closed.... only I want to avoid using a browser and refreshing it every time and want to implement it thru java so that I can have control over it.
    Thanks
    Trijoy
    PS. Any help in design, source code, suggestion is highly appreciated

  • Cisco ace Load balancer not maintaining session persistence

    Hi All,
    We have observed from the IIS logs on the internal webservers that loadbalancer is not maintaining session persistence for two specific request for the internal servers.
    https://123.xyz.com/Webresource.axd
    https://123.xyz.com/ScriptResource.axd
    Error
    Webresource.axd : 500
    Scriptresource.axd: 404
    Session persistence is maintained for all other requests hitting loadbalancer.
    Issue is observerd on hits for these two specified components. WebResource.axd and ScriptResource.axd are Http Handlers used by ASP.NET and Ajax to add client-side scripting to the outgoing web page.
    For e.g /WebResource.axd d=t2GXfySdqWmJ-lZSI0KVbw2&t=634868473645172160 is valid for server 1 and return 200 response but the same request is seen on few other servers where the response is 404 even though load balancer cookie is same. This means that if the request for the both the axd contains a valid decrypter and it connects to the right server then the response seen is 200.
    The url passed by the user contains d and t parameters when are unique for each user session.
    Solution tried:
    Accessed website via another VIP without http redirect rule but could not see difference.
    Tried to match machine key across all servers : Failed . Could see the ‘d’ value different for each server.
    Load balancer VIP :
    x.x.x.x
    redirect: http > https
    SSL Offload : ON
    Poool:
    WEB1
    WEB2
    WEB3
    WEB4
    WEB5
    All servers listening on port 80
    sticky config:
    sticky ihttp-cookie cookie1 vip-1.1.1.1-80-stickyfarm
      cookie insert browser-expire
      replicate sticky
      serverfarm vip-1.1.1.1_80
    sticky http-cookie cookie1 vip-farm:1.1.1.1:443
      cookie insert browser-expire
      replicate sticky
      serverfarm farm:1.1.1.1:443
    Has anyone else come across similar issue?
    Can you plese check if there is any config on cisco ace that will ensure that session persistence is maintained for these 2 requests.
    Thank you for all the help.
    regards,
    Sangram

    Hello Sangram,
    We would need simultanous packet traces before and after the ACE to get to the root cause of this issue so I would recommend that you open a cisco tac case for more in depth troubleshooing of this issue.
    Joel Lamousnery
    CCIE R&S - 36768
    Engineer, Customer Support
    Technical Services

  • Maintaining session info on the CSS

    I know by default the CSS cannot do this but what if I want it to. I have an IM application that a person has requested be put behind the CSS. They want it to be able to maintain sessions during a failover event. Any way to do this with the CSS?

    You could talk to your Cisco office and see if they would consider it for a future release. If there’s enough demand, you may get it through. What messaging software are you using?

  • How to maintain Session between two ear files?

    HI Guys
    I have deployed two ear files in oc4j. One is used to open applet and other for business operations.
    My problem is after calling applet my session gets invalidate. How to save session between two context
    I am new in this field please help!!
    the sooner the better
    Rahul

    Can I do this if I integrate oc4j with apache!!
    Can I maintain session
    Plz. Help
    Rahul

  • Jaxm - Maintaining Session State

    Hi,
    I have the following problem:
    My client dispatches jaxm-soap-messages to a java-servlet using the reference implementation of sun (wsdp). For each time I use the same SOAP-connection object. The problem is, that the servlet opens with each inquiry a new session. How can I maintain the session ( for example setting a cookie in case of http as the protocoll)? Is there a mapping between parameter in soap-header to http-header ?
    Greetings,
    Zubow

    Hi. I ran into the same situation a while back. I'll tell you how
    I resolved the problem.
    You have to build your own handler class. Extend the javax.xml.rpc.handler.GenericHandler class. Implementing the handleRequest(MessageContext msg) method.
    1 public boolean handleRequest(MessageContext context)
    2 {
    3 try
    4 {
    5 SOAPMessageContext smc = (SOAPMessageContext)context;
    6 SOAPMessage message = smc.getMessage();
    7 MimeHeaders mimeHeaders = message.getMimeHeaders();
    8 if(mimeHeaders.getHeader("Cookie")==null && getCookie()!=null)
    9 {
    10 mimeHeaders.setHeader("Cookie",getCookie());
    11 }
    12 }
    13 catch(Exception e)
    14 {
    15 throw new JAXRPCException(e);
    16 }
    17 return true;
    18 }
    19 public boolean handleResponse(MessageContext context)
    20 {
    21 try
    22 {
    23 SOAPMessageContext smc = (SOAPMessageContext)context;
    24 SOAPMessage message = smc.getMessage();
    25 MimeHeaders mimeHeaders = message.getMimeHeaders();
    26 if(mimeHeaders.getHeader("Set-Cookie")!=null && getCookie()==null)
    27 {
    28 String[] headerValues = mimeHeaders.getHeader("Set-Cookie");
    29 String cookie = headerValues[0];
    30 if(cookie.indexOf(";") >= 0)
    31 {
    32 cookie = cookie.substring(0,cookie.indexOf(";"));
    33 }
    34 setCookie(cookie);
    35 }
    36 }
    37 catch(Exception e)
    38 {
    39 throw new JAXRPCException(e);
    40 }
    41 return true;
    42 }
    The overall concept is to handle the soap message before it goes back
    to the server. You need to add the COOKIE header variable set to JSESSIONID=your session id
    to the message header before every request goes to the server. The handleResponse looks for set-Cookie variable that comes back from the
    very first request.
    Hope that helps.
    Mike
    first request.

  • Problems with maintaining session state using mod_ose

    I am using 9i AS(version 1.0.2.0) and oracle 8i(version 815).
    Because i need to maintain client sessions for my application, I
    have activated mod_ose(for stateful session). As suggested in
    the oracle documentation, i created a package containing
    variables for which state needs to be maintain per client. The
    state is maintained by the app server but it is not maintained
    properly. All the new clients that connect to the app server
    share the same session variable values. If I change a package
    variable value from one client, other clients take the same
    value.
    Any solution?
    Suggestions are most welcome.
    Thanks in advance.

    We installed oracle9i AS on solaris, configured OSE and the
    problem is not occuring now. Not sure whether its solaris that
    worked or 9i AS had some problem on NT machine earlier.
    Regards,
    Sharad

  • Maintain session in JSP after using filters

    I have to extend this application to maintain the session , because there are 10 jsp pages in my application.
    When the user logs in , and hits a tab(which should redirect to another jsp page - assume users.jsp) the page is redirected back to the login page (instead of the users.jsp page) because of the filter.
    How do I maintain the session here , so that a user who is logged in (with user name and password) could access the other pages instead of just being redirected back to the login.jsp page.
    this is my filter page
    package com.bea.genesis.tenantmgmt.utils;
    import java.io.IOException;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class FacesRedirectFilter implements Filter {
         public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain)
         throws ServletException, IOException
              HttpServletRequest request = (HttpServletRequest)req;
              HttpServletResponse response = (HttpServletResponse)res;
              //String uri = request.getRequestURI();
              String relativePath = request.getServletPath();
              if ((relativePath.indexOf("/pages/") >= 0) && relativePath.endsWith(".jsf")) {
                   //int length = uri.length();
                   //String newAddress = uri.substring(0, length-3) + EXTENSION;
                   //response.sendRedirect("login.jsf");
                   RequestDispatcher rd = request.getRequestDispatcher("login.jsf");
                   rd.forward(req, res);
              chain.doFilter(request, response);
         public void destroy() {
              // TODO Auto-generated method stub
         public void init(FilterConfig filterConfig) throws ServletException {
              // TODO Auto-generated method stub
    Please reply
    thanks

    Thanks for the reply , How do I test in the filter whether the user is loged in or not.(I dont have clue , how to do tht)
    this is my login Bean ---
    import java.util.Map;
    import javax.faces.context.FacesContext;
    public class LoginBean extends AbstractBean {
         private String loginId;
         private String password;
         private LoginService loginService;
         private LoginValidator loginValidator = new LoginValidator();
         private TenantProfileService tenantProfileService;
         public String getLoginId() {
              return loginId;
         public void setLoginId(String _loginId) {
              loginId = _loginId;
         public String getPassword() {
              return password;
         public void setPassword(String _password) {
              password = _password;
         public LoginService getLoginService() {
              return loginService;
         public void setLoginService(LoginService loginService) {
              this.loginService = loginService;
         *public String login() {*
    *          String authenticationStatus = GenesisConstants.RESULT_FAIL;*
    *          appLogger.enterMethod(this, "login", loginId);*
    *          if (loginValidator.validateData(this)) {*
    *               try {*
    *                    long profileId = loginService.authenticateUser(loginId,*
    *                              password);*
    *                    TenantProfileData tenantProfileData = retrieveTenantProfile(profileId);*
    *                    if (tenantProfileData == null || !tenantProfileData.getStatus().equalsIgnoreCase(*
    *                              GenesisConstants.TENANT_STATUS_ACTIVE))*
    *                         throw new LoginException(*
    *                                   "Tenant profile Not Active for the user.");*
    *                    authenticationStatus = GenesisConstants.RESULT_SUCCESS;*
    *               } catch (LoginException le) {*
    *                    appLogger.error("Error in User Authentication", le.getMessage());*
    loginValidator.addErrorMessage(null, le.getMessage());
    *                    authenticationStatus = GenesisConstants.RESULT_FAIL;*
              appLogger.exitMethod(this, "login", loginId);
              return authenticationStatus;
         public TenantProfileData retrieveTenantProfile(long profileId) {
              appLogger.enterMethod(this, "viewTenant");
              FacesContext facesContext = FacesContext.getCurrentInstance();
              Map<String, Object> sessionMap = facesContext.getExternalContext()
                        .getSessionMap();
              appLogger.debug("profileId==", profileId + "");
              TenantProfileData tenantProfileData = new TenantProfileData();
              try {
                   appLogger.debug("invoking TenantProfileService.getTenantById");
                   tenantProfileData = tenantProfileService.getTenantById(profileId);
                   appLogger
                             .debug("successfully completed TenantProfileService.getTenantById");
              } catch (TenantProfileServiceException te) {
                   appLogger.debug("exception in TenantProfileService.getTenantById");
                   throw new DataException(te.getMessage());
              sessionMap.put("tenantProfileData", tenantProfileData);          
              appLogger.exitMethod(this, "viewTenant");
              return tenantProfileData;
         public TenantProfileService getTenantProfileService() {
              return tenantProfileService;
         public void setTenantProfileService(
                   TenantProfileService tenantProfileService) {
              this.tenantProfileService = tenantProfileService;
    PLEASE HELP
    THANKS

  • Please help me-it's urgent,maintaining session and security using cookies.

    hi folks,
    i presently developing a web site for an engineering colleege ,i am facing prob in maintaining the session using cookies,and destroying a cookie and keeping security to the user,There are four links on my webpage ,including a logout link,when i click the other links other than the logout,it works perfectly,and when i click the logout link,i am not able to disable the cookie and still able to visit previous pages by clicking the back button.please give a suggestion as such to disable the cokie and maintain the security for my web site.
    Thank u....

    Try out this login if it helps you.
    Create a bean that stores some String value. Then make a object of this bean using the useBean tag with session scope when a user logs in. Store the name of the user in the bean and also set the same name value in the Session object. Then on every JSP page compare the value set in the session object with the bean variable (which will be having a session scope). If the value match, then the JSP page output must be displayed to the user. Then on the logout link, invalidate the session object using the invalidate() method of the session class. As a result now when you will try to navigate back to the old JSP page, null will be returned to you when you will try to retrive the name value from the session object. And since this null will not match with the value in the bean, you should not proceed further with generating the output. Hope this help
    Nirav ([email protected])

  • Adobe Air and maintaining session state

    OK, here's a short run down. I'm working on an Air app per client  request. It's a tight time frame so I'm going the HTML/JavaScript route  since that is what I know. I've only been digging into this for a couple  of days, read a handful of tutes and articles but I just haven't found  this yet.
    What are some methods for maintaining some session-like variables throughout the app (since it will have multiple html "pages")?
    I've seen where some are using an encrypted local store, not sure I  really want to do that as this app will be in a public place. I suppose I  could use an encrypted querystring - not sure of the implications  there. What else is there? I've also played around with SharedObject but can't seem to persist it between pages.

    I dont think its possbile since stopping and restarting gets new sessions. Only way that I would know would be to use cookies.
    But then again i dont like the idea of saving passwords in cookies

Maybe you are looking for

  • Required components for Forms&Reports 11.1.2 with SSO support

    Hi. Dont know if this is the right forum but I would like to know if any of you has an experience in integrating Forms&Reports 11.1.2 with Oracle Access manager. I am in process of upgrading Oracle Forms&Reports 10g configured to use single sign-on t

  • How do I create image pushing slide show in Flash?

    Hi. I am wondering if anybody can tell me how to create a picture PUSH. I have three images that I wish to work with. By pushing I mean having an image come in from the left (or right) and place itself on top of the other (or pushing the other out of

  • Re: Skype to go number is no longer working

    I have a similar problem in that my Skype to go umber (US to UK) is connecting to a US business and not the UK line.  I am running the latest version of Skype.

  • Web Application to Web Service Scenario

    Hi All. The following is the scenario: Sender: Web Application Receiver: Web Service Adapters To be used: Sender Adapter: HTTP Receiver Adapter: SOAP Query: 1. What will be the TS type in the SLD? Standalone Java or WebAS Java? Or, do we need SLD ent

  • Distribute Crystal Report from BOE Server

    Hi, ========= Installation on Client machine: Crystal Report 2008 V1 SP1 and SP2 SAP Integration Kits XI 3.1 SP2 Installation on BOE Server: BOE XI 3.1 SP2 SAP Integration Kits XI 3.1 SP2 Installation on BW: SAP BW 7 ======== Created crystal report o