Getting session information in servlet?

In Apache SOAP, org.apache.soap.rpc.SOAPContext can be used as a parameter to get at session data in your servlet. The JDeveloper web services publishing wizard won't expose a method with this parameter, saying that the XML Schema mapping and/or serializer is not specified. Is there an OC4J equivalent to get at session information?

Hi.
Most definitely possible. A few months ago I coded something very similar - jsp
form, submit to a servlet. I needed to get and set session info in both the
servlet and jsp. The code was very basic (ie no tricks involved) and worked
well. FWIW both my servlet and jsp were in the same webapp.
Good luck,
Michael
PeterH wrote:
Howdy.
re meant something else
That's what I'm trying to figure out. :>
re what do I mean by...
I have one jsp page, that has a an html form on it with elements that get
passed to a servlet through a submit button on the form. I would like to be
able to get information about the session from within the servlet. Is that
possible?
Let me know if I'm not explaining myself properly and you need more info.
I'm relatively new to this stuff. But I'm learning! :>>>>
Thanks for your reply.
<[email protected]> wrote in message news:[email protected]..
Hrm. Whoever told you this probably meant something else. What do you mean
by a 'servlet being called from a jsp' ?
PeterH <!REMOVEBeforeSending![email protected]> wrote:
I was told today when using a servlet within a web app (being called
from a
jsp), you do not have access to the session object. Is that true?Short of
passing session attributes via the servlet call, how can you access the
session information?
Thanks for any ideas.--
Dimitri
Michael Young
Developer Relations Engineer
BEA Support

Similar Messages

  • Passing Session info between servlets

    We are running WebLogic 5.1, sp 4 and Apache 1.3 on Solaris 2.6 and we are
              successfully proxying requests to the server. But we are unable to pass
              session information between servlets. We are NOT using URL encoding. We are
              instead using cookies. We believe our configuration is correct because the
              BEA example session servlet works. Does anyone have any recommendations or
              suggestions?
              Thank you,
              Jorge
              Jorge A. Martin
              Systems Analyst
              The Kinetic Group
              1950 Stemmons Freeway, Suite 3040
              Dallas, Texas 75207
              

    This is a basic misunderstanding of how Java Works:
    String name +r = request.getParameter(name +r);1) You can't use a + on the left part of an assignment operation - it must be a plain variable reference. This isn't like JavaScript where you have an eval(...) capability.
    2) Your Strings are being defined inside the For Loop, which means they will leave scope once the loop ends and you won't be able to refer to them anymore.
    3) Is there already a String value named 'name' which you are using in getParameters(name+r)? You should probably use getParameter("name"+r) instead.
    What you want to do is either put the values in an array so they are easy to access:
    String name[] = new String[value1];Then loop through the parameters to assign values:
    for(int r = 0; r< value1; r++) { //Start at 0 to value1-1 because arrays are 0 based.
      String nameParam = "name"+ (r+1);
      name[r] = request.getParameter(nameParam);Now I can access the names in order:
    name1 via name[0]
    name2 via name[1]
    name3 via name[2]
    etc...Before going any further I would stop working on Servlets and go back to some good Basic Java Tutorials and books until you get a better grasp of how the language works.

  • How to get the complete sessions information ?

    Dear All,
    Can any one post a script to get complete sessions information.
    Thanks in advance

    Hi,
    The following script may help u on finding the active sessions on your Oracle database .
    SELECT SID,
    serial#,
    username,
    (SELECT holding_session
    FROM dba_waiters
    WHERE waiting_session = s.SID
    AND ROWNUM = 1
    AND holding_session NOT IN (SELECT waiting_session
    FROM dba_waiters))
    holding_session,
    DECODE (s.status,
    'ACTIVE', ROUND (last_call_et / 60),
    0
    ) time_min,
    DECODE (s.status,
    'ACTIVE', last_call_et,
    0
    ) time_sec,
    (SELECT used_urec
    FROM v$transaction t
    WHERE t.addr = s.taddr) undo_records,
    (SELECT ROUND (sl.sofar / sl.totalwork * 100, 2)
    FROM v$session_longops sl
    WHERE s.SID = sl.SID
    AND s.serial# = sl.serial#
    AND s.status = 'ACTIVE'
    AND sl.time_remaining > 0) progress,
    (SELECT event
    FROM v$session_wait w
    WHERE w.SID = s.SID) wait_event,
    (SELECT ROUND (VALUE / 1024 / 1024, 2) || 'M'
    FROM v$sesstat
    WHERE SID = s.SID
    AND statistic# = 20) pga_size,
    (SELECT ROUND (VALUE / 1024 / 1024, 2) || 'M'
    FROM v$sesstat
    WHERE SID = s.SID
    AND statistic# = 15) uga_size,
    (SELECT VALUE
    FROM v$sesstat
    WHERE SID = s.SID
    AND statistic# = 4) commits,
    (SELECT sql_text
    FROM v$sql t
    WHERE s.sql_address = t.address
    AND s.sql_hash_value = t.hash_value
    AND ROWNUM = 1) sql_used,
    (SELECT MESSAGE
    FROM v$session_longops sl
    WHERE s.SID = sl.SID
    AND s.serial# = sl.serial#
    AND s.status = 'ACTIVE'
    AND sl.time_remaining > 0) long_ops,
    (SELECT LOWER (ins.instance_name)
    || '_ora_'
    || LTRIM (TO_CHAR (a.spid))
    || '.trc' filename
    FROM v$process a
    WHERE a.addr = s.paddr) trace_file_name,
    resource_consumer_group,
    s.status,
    server,
    osuser,
    program,
    module,
    action,
    NVL (LOWER (s.machine), ins.host_name) machine
    FROM v$session s,
    v$instance ins
    WHERE username IS NOT NULL
    AND s.status = 'ACTIVE'
    AND s.audsid <> USERENV ('sessionid')
    ORDER BY DECODE (s.status,
    'ACTIVE', ROUND (last_call_et),
    0
    ) DESC
    Regards,
    Kumar
    [www.idatamax.com]

  • Get the session information like time left to session expiry or logoff etc

    Hi Experts,
    In webdynpro ABAP I would like to get the session information like time left to session expiry or logoff etc. Please suggest me whether ther are any clasess or code available to get the info.
    Advance Thanks,
    Thanks,
    AMS

    Hi,
    What do you want to do with that information ?
    Regards

  • Session management in servlet

    Hi,
    I am using OC4J Server.
    I know the session in servlet can be managed with cookies. In addition, the session can be managed in HTTP session of OC4J. And How about the URL rewriting? Does it mean there are 3 methods to keep track of the servlet session. What are the difference of them. I am quite confused.
    Thanks in advance

    I see. Thanks.
    So it means there are two kinds of cookies, permanent cookies and session cookies.
    session cookies are used to store the session information.
    I have another question. I want to write a permanent cookies to the browser and get it again even if the browser is closed.
    The source code is like:
    Cookie cookie = new Cookie(cookieName, cookieValue);
    response.addCookie(cookie);
    Then I try to write some cookies in the browser, close the browser and open the browser again and I try to retreive the cookies using the following codes but the cookies disappear.
    Cookie[] cookies = request.getCookies()
    if (cookies != null && cookies.length > 0) {
    for (int i = 0; i < cookies.length; i++) {
    Cookie cookie = cookies;
    Is this the correct way to store and retrieve permanent cookies?
    thanks in advance

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

  • Want to see session information through coherence console

    I use coherence*web to push the http session information in,and I changed the coherence.cmd to let the configuration point to session-cache-config.xml
    which is like:
    set java_opts=-Xms%memory% -Xmx%memory% -Dtangosol.coherence.distributed.localstorage=%storage_enabled% -Dtangosol.coherence.cacheconfig=session-cache-config.xml %jmxproperties%
    %java_exec% -server -showversion %java_opts% -cp "%coherence_home%\lib\coherence.jar;E:\coherence-java-3.7.1.0b27797\coherence\lib\coherence-web.jar;E:\wls12c\oepe_12.1.1.0.0\plugins\javax.servlet_2.5.0.v201103041518.jar" com.tangosol.net.CacheFactory %1
    when I start coherence.cmd and change to session-storage, I want to list the data,but get the nullpoint exception:
    Map (session-storage): list
    2012-06-08 13:34:38.675/11.309 Oracle Coherence GE 3.7.1.0 <Error> (thread=main,
    member=5):
    java.lang.NullPointerException
    at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readAttribute
    s(AbstractHttpSessionModel.java:1809)
    at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readExternal(
    AbstractHttpSessionModel.java:1735)
    at com.tangosol.util.ExternalizableHelper.readExternalizableLite(Externa
    lizableHelper.java:2041)
    at com.tangosol.util.ExternalizableHelper.readObjectInternal(Externaliza
    bleHelper.java:2345)
    at com.tangosol.util.ExternalizableHelper.deserializeInternal(Externaliz
    ableHelper.java:2746)
    at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelpe
    r.java:262)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.partitionedService.PartitionedCache$ConverterFromBinary.convert(PartitionedC
    ache.CDB:4)
    at com.tangosol.util.ConverterCollections$AbstractConverterEntry.getValu
    e(ConverterCollections.java:3548)
    at com.tangosol.coherence.component.application.console.Coherence.doList
    (Coherence.CDB:83)
    at com.tangosol.coherence.component.application.console.Coherence.proces
    sCommand(Coherence.CDB:450)
    at com.tangosol.coherence.component.application.console.Coherence.run(Co
    herence.CDB:37)
    at com.tangosol.coherence.component.application.console.Coherence.main(C
    oherence.CDB:3)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.tangosol.net.CacheFactory.main(CacheFactory.java:827)
    Map (session-storage):
    Anyone have some experiences and can give me some suggestion?
    I do not want to use the httpsession language in jsp, and I just want to use API to access the hpptsession information.
    Thanks a lot!

    Sharing the information directly by accessing the caches will be a bit difficult, because the data format for the session is highly optimized. For example, large attributes are often split out separate from the bulk of the "core" session data, to make moving the session around the network more efficient. What may be the simplest solution (depending on the application's needs) is to use a "back channel" from the ASP.NET application to the Java EE application, for example over REST. This would be a reasonable approach if there are a few items that you want to access and/or update in the session.
    On the Java side, you can "get" a session using the HttpSessionContext interface, but you have to explicitly enable that feature (because it was deprecated in Servlet 2.1):
    public HttpSession getSession(String sId)To enable the feature, you have to set the coherence-enable-sessioncontext property to true. This property is in the XML configuration file that is added to the WAR by Coherence*Web install (WebPluginInstaller) step. I'm not sure how this gets set up in WebLogic (since there is no separate "install" step), but it should still be supported.
    Is this what you were looking for?
    Peace,
    Cameron.

  • What is session tracking in servlets?

    Hi ,
    I'm studying servlets I don't have the clear idea about session tracking and Why and where we need to use it. Can any one say about this.....
    Thanks in advance,
    Maheshwaran Devaraj

    Well Mheshpmr session tracking in servlets is very important...There are a number of problems that arise from the fact that HTTP is a "stateless" protocol. In particular, when you are doing on-line shopping, it is a real annoyance that the Web server can't easily remember previous transactions. This makes applications like shopping carts very problematic: when you add an entry to your cart, how does the server know what's already in your cart? Even if servers did retain contextual information, you'd still have problems with e-commerce. When you move from the page where you specify what you want to buy (hosted on the regular Web server) to the page that takes your credit card number and shipping address (hosted on the secure server that uses SSL), now let me tell you, how does the server remember what you were buying?
    Well There are three typical solutions to this problem.
    1. Cookies. You can use HTTP cookies to store information about a shopping session, and each subsequent connection can look up the current session and then extract information about that session from some location on the server machine. This is an excellent alternative, and is the most widely used approach. However, even though servlets have a high-level and easy-to-use interface to cookies, there are still a number of relatively tedious details that need to be handled:
    * Extracting the cookie that stores the session identifier from the other cookies (there may be many, after all),
    * Setting an appropriate expiration time for the cookie (sessions interrupted by 24 hours probably should be reset), and
    * Associating information on the server with the session identifier (there may be far too much information to actually store it in the cookie, plus sensitive data like credit card numbers should never go in cookies).
    2. URL Rewriting. You can append some extra data on the end of each URL that identifies the session, and the server can associate that session identifier with data it has stored about that session. This is also an excellent solution, and even has the advantage that it works with browsers that don't support cookies or where the user has disabled cookies. However, it has most of the same problems as cookies, namely that the server-side program has a lot of straightforward but tedious processing to do. In addition, you have to be very careful that every URL returned to the user (even via indirect means like Location fields in server redirects) has the extra information appended. And, if the user leaves the session and comes back via a bookmark or link, the session information can be lost.
    3. Hidden form fields. HTML forms have an entry that looks like the following: <INPUT TYPE="HIDDEN" NAME="session" VALUE="...">. This means that, when the form is submitted, the specified name and value are included in the GET or POST data. This can be used to store information about the session. However, it has the major disadvantage that it only works if every page is dynamically generated, since the whole point is that each session has a unique identifier.
    Servlets provide an outstanding technical solution: the HttpSession API. This is a high-level interface built on top of cookies or URL-rewriting. In fact, on many servers, they use cookies if the browser supports them, but automatically revert to URL-rewriting when cookies are unsupported or explicitly disabled. But the servlet author doesn't need to bother with many of the details, doesn't have to explicitly manipulate cookies or information appended to the URL, and is automatically given a convenient place to store data that is associated with each session.

  • Session managing testing servlets

    I am running two 5.1 sp1 servers in a cluster using in-mem replication
              with a wl proxy server, all on NT boxes. I've written three servlets:
              Login, Logout, and Test2
              Login creates a new session if one isn't present. Logout kills the
              session if there is one present. Test2 tests for the existence of a
              session.
              -- I start the server and create a new session with the Login
              servlet.
              -- I test with Test2 servlet ( I get Test2: init) and it doesn't see
              the session I had just created.
              -- I reload Test2 and it recognizes the session OK.
              -- It recognizes the session with all subsequent calls to it as well.
              -- Killing the server and making the session failover to another
              server will make the Test2 servlet not see the session for the first
              time again (If that is the first time that the servlet is loaded on that
              particular server).
              Same happens with Logout servlet. It seems that when a servlet is
              initially loaded on a server it doesn't see sessions already present but
              it picks up that info on all subsequent loads. What can I do to make
              sure all my servlets see all the sessions all the time (otherwise this
              failover demo I'm doing is quite useless).
              Thanks, Timur
              

              Prasad Peddada wrote:
              > Timur Maltaric wrote:
              >
              > > Say I had two servers in the cluster to begin with. Sessions were created and killed as users logged on and off.
              > > One server dies suddenly and one is left operating in the cluster. Shouldn't this one that is operating be able to
              > > correctly handle any new sessions that will be created?
              >
              > Yes.
              >
              > From your earlier mail:
              >
              > The log attached to an earlier message shows that Login servlet starts a new session, and writes a cookie. Good.
              > Requesting Test2 doesn't read that cookie and returns session = null. Requesting Test2 again reads the cookie
              > correctly and gets the correct session information.
              >
              > From the log files:
              >
              > Tue May 30 10:17:42 EDT 2000:<D> <ServletContext-General> Found servlet for Virtual Path: '/Test2'
              > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: ServletPath: /Test2
              > Tue May 30 10:17:42 EDT 2000:<D> <ServletContext-General> Invoking servlet
              > Tue May 30 10:17:42 EDT 2000:<D> <ServletContext-General> Checking ACL: weblogic.servlet.Test2
              > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> Parsing cookies
              > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: Found cookie:
              > javax.servlet.http.Cookie@b8f4916
              > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: SessionID:
              > OTPNVO0XpIhya1eIDpzrNar9gwDuzpm198DEKR9ho5uhKqSfIOis7UdLQ0773aTGodGkgNoKH0A3|-5241978140997784602/168297227/6/7001/7001/7002/7002/7001/-1|NONE|-5241978140997784602
              > found in cookie
              > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: Trying to find session:
              > OTPNVO0XpIhya1eIDpzrNar9gwDuzpm198DEKR9ho5uhKqSfIOis7UdLQ0773aTGodGkgNoKH0A3|-5241978140997784602/168297227/6/7001/7001/7002/7002/7001/-1|NONE|-5241978140997784602
              >
              > Contrary to what you said the weblogic server is reading your session. All the requests are in the same session.
              The first time (notice time) that the request is made for Test2 weblogic server is NOT reading the session info. Second request for Test2 (one you quoted) is OK.
              Why?:
              Tue May 30 10:17:13 EDT 2000:<D> <ServletContext-General> Found servlet for Virtual Path: '/Test2'
              Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: ServletPath: /Test2
              Tue May 30 10:17:13 EDT 2000:<D> <ServletContext-General> Invoking servlet
              Tue May 30 10:17:13 EDT 2000:<D> <ServletContext-General> Checking ACL: weblogic.servlet.Test2
              Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> Parsing cookies
              Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: Get query parameter: WebLogicSession found value: null
              Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: SessionID not found
              Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> Test2: init
              >
              > Contact support if you have a reproducible test case and we will go from there.
              I am contacting support.
              >
              >
              > I don't think it matters how many servers are in the cluster because none are really failing. Correct me if I'm wrong.
              >
              > True.
              >
              > - Prasad
              >
              > >
              > > Timur
              > >
              > > Prasad Peddada wrote:
              > >
              > > > If you have only one server in the cluster how do you expect it to failover and retrieve your session
              > > > information.
              > > >
              > > > - Prasad
              > > >
              > > > Timur Maltaric wrote:
              > > >
              > > > > There was only one server running in the cluster when these requests were made. That shouldn't be a problem
              > > > > though.
              > > > >
              > > > > Timur
              > > > >
              > > > > Prasad Peddada wrote:
              > > > >
              > > > > > The same cookie is being sent five times as you can see. Are you sure your clustering is
              > > > > > working. I don't think the servers are recognizing each other. Do you have two servers
              > > > > > running when you made these requests.
              > > > > >
              > > > > > C:\TEMP>grep
              > > > > > "OTPNVO0XpIhya1eIDpzrNar9gwDuzpm198DEKR9ho5uhKqSfIOis7UdLQ0773aTGodGkgNoKH0A3|-5241978140997784602/16829722
              > > > > >
              > > > > > 7/6/7001/7001/7002/7002/7001/-1|NONE|-5241978140997784602" weblogic.log | wc -l
              > > > > > 5
              > > > > >
              > > > > > - Prasad
              > > > > >
              > > > > > Timur Maltaric wrote:
              > > > > >
              > > > > > > Here is a snippet from the log. Test2 doesn't recieve the cookie on first load but
              > > > > > > recieves it thereafter.
              > > > > > >
              > > > > > > Timur
              > > > > > >
              > > > > > > Prasad Peddada wrote:
              > > > > > >
              > > > > > > > I don't think domain property applies to your case. Did you try turn on the
              > > > > > > > debugging and did you notice anything wrong. When you requested Login, you should
              > > > > > > > have got a cookie that should have been passed back when you requested Test2. Do
              > > > > > > > you see that in log?
              > > > > > > >
              > > > > > > > - Prasad
              > > > > > > >
              > > > > > > > Description about domains:
              > > > > > > >
              > > > > > > > When searching the cookie list for valid cookies, a comparison of the domain
              > > > > > > > attributes of the cookie is made
              > > > > > > > with the Internet domain name of the host from which the URL will be fetched.
              > > > > > > > If there is a tail match, then
              > > > > > > > the cookie will go through path matching to see if it should be sent. "Tail
              > > > > > > > matching" means that domain
              > > > > > > > attribute is matched against the tail of the fully qualified domain name of
              > > > > > > > the host. A domain attribute of
              > > > > > > > "acme.com" would match host names "anvil.acme.com" as well as
              > > > > > > > "shipping.crate.acme.com".
              > > > > > > >
              > > > > > > > Only hosts within the specified domain can set a cookie for a domain and
              > > > > > > > domains must have at least two (2)
              > > > > > > > or three (3) periods in them to prevent domains of the form: ".com", ".edu",
              > > > > > > > and "va.us". Any domain that fails
              > > > > > > > within one of the seven special top level domains listed below only require
              > > > > > > > two periods. Any other domain
              > > > > > > > requires at least three. The seven special top level domains are: "COM",
              > > > > > > > "EDU", "NET", "ORG", "GOV", "MIL", and
              > > > > > > > "INT".
              > > > > > > >
              > > > > > > > The default value of domain is the host name of the server which generated
              > > > > > > > the cookie response.
              > > > > > > >
              > > > > > > > Timur Maltaric wrote:
              > > > > > > >
              > > > > > > > > weblogic.httpd.session.cookie.domain
              > > > > > > > >
              > > > > > > > > what does this do? What should I set it to?
              > > > > > > > >
              > > > > > > > > Prasad Peddada wrote:
              > > > > > > > >
              > > > > > > > > > Turn on the weblogic.debug.httpd=true and see if the cluster's are receiving
              > > > > > > > > > cookie's or not and try with IE as well.
              > > > > > > > > >
              > > > > > > > > > Try setting this property on the weblogic servers in the backend and see if
              > > > > > > > > > it helps.
              > > > > > > > > >
              > > > > > > > > > weblogic.httpd.session.cookie.domain
              > > > > > > > > >
              > > > > > > > > > - Prasad
              > > > > > > > > >
              > > > > > > > > > Timur Maltaric wrote:
              > > > > > > > > >
              > > > > > > > > > > I am running two 5.1 sp1 servers in a cluster using in-mem replication
              > > > > > > > > > > with a wl proxy server, all on NT boxes. I've written three servlets:
              > > > > > > > > > > Login, Logout, and Test2
              > > > > > > > > > > Login creates a new session if one isn't present. Logout kills the
              > > > > > > > > > > session if there is one present. Test2 tests for the existence of a
              > > > > > > > > > > session.
              > > > > > > > > > >
              > > > > > > > > > > -- I start the server and create a new session with the Login
              > > > > > > > > > > servlet.
              > > > > > > > > > > -- I test with Test2 servlet ( I get Test2: init) and it doesn't see
              > > > > > > > > > > the session I had just created.
              > > > > > > > > > > -- I reload Test2 and it recognizes the session OK.
              > > > > > > > > > > -- It recognizes the session with all subsequent calls to it as well.
              > > > > > > > > > >
              > > > > > > > > > > -- Killing the server and making the session failover to another
              > > > > > > > > > > server will make the Test2 servlet not see the session for the first
              > > > > > > > > > > time again (If that is the first time that the servlet is loaded on that
              > > > > > > > > > > particular server).
              > > > > > > > > > >
              > > > > > > > > > > Same happens with Logout servlet. It seems that when a servlet is
              > > > > > > > > > > initially loaded on a server it doesn't see sessions already present but
              > > > > > > > > > > it picks up that info on all subsequent loads. What can I do to make
              > > > > > > > > > > sure all my servlets see all the sessions all the time (otherwise this
              > > > > > > > > > > failover demo I'm doing is quite useless).
              > > > > > > > > > >
              > > > > > > > > > > Thanks, Timur
              > > > > > > > > >
              > > > > > > > > > --
              > > > > > > > > > Cheers
              > > > > > > > > >
              > > > > > > > > > - Prasad
              > > > > > > >
              > > > > > > > --
              > > > > > > > Cheers
              > > > > > > >
              > > > > > > > - Prasad
              > > > > > >
              > > > > > > ------------------------------------------------------------------------
              > > > > > > Name: weblogic.log
              > > > > > > weblogic.log Type: Text Document (application/x-unknown-content-type-txtfile)
              > > > > > > Encoding: base64
              > > > > >
              > > > > > --
              > > > > > Cheers
              > > > > >
              > > > > > - Prasad
              [att1.html]
              

  • Get client information

    Hello...
    I want to write servlet which get client information
    IP,OS,DATE,TIME,BROWSER,SCREEN SIZE, COUNTRY and send all information
    on server.
    If source code possible plzzz give me..
    thankx in advance...

    If you write a HttpServlet (just subclass it) you have the request as a HttpServletRequest. From this object you can get information such a browser etc. Try (inside your servlet code):
    PrintWriter out = res.getWriter();
    out.println("<HTML><BODY>");
    out.println("<H1>Client information</H1>");
    out.println("<B>Client address: </B>" + req.getRemoteAddr() + "<BR>");
    out.println("<B>Client host: </B>" + req.getRemoteHost() + "<BR>");
    out.println("<B>Client user: </B>" + req.getRemoteUser() + "<BR><BR>");
    out.println("<B>Server name: </B>" + req.getServerName() + "<BR>");
    out.println("<B>Server port: </B>" + req.getServerPort() + "<BR>");
    out.println("<B>Requested URL: </B>" + req.getRequestURL().toString() + "<BR>");
    out.println("<B>Path info: </B>" + req.getPathInfo() + "<BR>");
    out.println("<B>Method: </B>" + req.getMethod() + "<BR>");
    out.println("<B>Protocol: </B>" + req.getProtocol() + "<BR>");
    out.println("<B>Query string: </B>" + req.getQueryString() + "<BR><BR>");
    out.println("<B>Session ID: </B>" + req.getRequestedSessionId() + "<BR>");
    out.println("<B>Valid session: </B>" + req.isRequestedSessionIdValid() + "<BR>");
    out.println("<B>Secure connection: </B>" + req.isSecure() + "<BR>");
    out.println("<B>Authentication type: </B>" + req.getAuthType() + "<BR>");
    out.println("<B>Character encoding: </B>" + req.getCharacterEncoding() + "<BR>");
    out.println("<B>Content length: </B>" + req.getContentLength() + "<BR>");
    out.println("<B>Content type: </B>" + req.getContentType() + "<BR>");
    out.println("<B>Context path: </B>" + req.getContextPath() + "<BR>");
    out.println("</BODY></HTML>");
    Where req and res are the HttpServletRequest and HttpServletResponse objects passed to your servlet with doGet() or doPost().
    If if doesn't work out for you - give me you e-mail and I'll send over a complete example. Please notice that screen resolution etc. isn't available in the request object. For that you need to get them with for example JavaScript and then send then as parameters to the servlet.
    Good luck!

  • Single Sign-On and session information

    I have an Oracle Portal application with many Java Web Applications. I wish to
    provide Single Sign-On to this applications. I know how to configure Single
    Sign-On and how to get the user login in Java. I want to store session
    information such as: User First and Last Name, User Social Security Number. I
    want to get this information from the database after authentication, store it
    in session and then access this information from all my applications.

    Are you familiarized with sys_context function?
    Hope this is useful help.
    BR,
    Marcos

  • How to get javabean data in Servlets.( JavaBean -- Servlet(Controller)

    how to get javabean data in Servlets.
    1) I am using name ,password in Jsp(View )
    2) when I submit this Bean will be called and Setter methods will be called .
    3) In ServletController (controller) I want to get data of javabean.
    In this I have to do validation of user.
    I want to pass the javabean obj as like -->
    request.getAttribute("beanObj");
    My intention is to get all the poperties in javabean by passing bean id
    or beanobj ,
    Is there any way to get all the data using bean id or beanObj.
    Plz Reply,

    Now in the Servlet we can get the same bean by this code:
    PageContext pageContext = JspFactoryImpl.getDefaultFactory().getPageContext(this, request, response, null, true, 8192, true);
    UserBean userbean = (UserBean)pageContext.getAttribute("userbean", PageContext.SESSION_SCOPE);
    String userid = userbean.getUsername();
    For this code to work it is needed to import 2 files:
    import org.apache.jasper.runtime.JspFactoryImpl;
    import javax.servlet.jsp.PageContext;
    The JspFactoryImpl is in jasper-runtime.jar file provided in tomcat dir.It seems to me that you are exactly knowing what you are doing :-(
    You can get a Bean stored in a Session by
    request.getSession().getAttribute("userbean");
    In the login.jsp page for example we have the code
    <jsp:useBean id="userbean" scope="session"class="com.newproj.UserBean" />
    <jsp:setProperty name="userbean" property="*" />the jsp:setProperty is not called when you click on the submit button
    if fills the bean with the request values from the previous request.
    andi

  • How to get log information about any interface...scenario etc

    I have created an package which loads file in a perticular folder dynamically.
    here after loading each file i want to maintain the log i.e number of records inserted,updated,deleted,error etc,i came to know that in work repository snp_session,snp_sess_task_log, will have the statistics.but in these table records loaded available in the insert step.how do i query these tables properly,how do i get session no other information from odi.
    plz help me.
    Jai

    Thank u.
    I got one more way to solve this.
    SELECT <%=odiRef. getPrevStepLog("sess_no")%> FROM DUAL
    we can use this statement in a variable.
    After execution of the interface we can use this variable which lets us to know session_no of previous interface then we can use this session_no to get the log by quering tables in work_rep.
    Regards,
    Jai

  • Getting session has timed out while trying to redeem a gift card. have had no problem in the past.  am running a g4 since 2002 with os 10.4 and itunes 9. have no internet problems and can connect to store ok. so far apple no help keeps blaming it on othrs

    am having trouble for the first time trying to redeem a gift card. Everything same on computer, OS, and internet connection. have been able to redeem other cards. this time am getting "SESSION HAS TIMED OUT" while trying to redeem card. have contacted apple and checked out all their suggestion iE:( must be your connection. typed in code wrong, too old version of itunes, etc) anything but why would a gift card code bee tied to a specific vetrsion of ITUNES. Rediculous!! there has to be others out there that have an older version if itune than i have. has anyone ever had the error "SESSION HAS TIMED OUT" and if so was it corrected?? any information other than apples {change password and give us lots of personal info they probably have) would be appreciated..

    Hello,
    As far as I can see, that Verizon Jet Pack wireless Modem uses WPA2 to connect.
    The Router might complicate things right now.
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    Is that Interface dragged to the top of Network>Show:>Network Port Configurations and checked ON?
    The Interface that connects to the Internet, needs to be drug to the top of System Preferences>Network>Show:>Network Port Configurations and checked ON.
    If using Wifi/Airport...
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.

  • How to get the information like IP address,Host name of connected clients v

    Hi Every one,
    I want to get the information like (IP Address,Hostname,Active sessions , Database Server….etc) of the connected clients
    via V$Views(ORACLE).
    And then I like to load these infromation into a table “Client_Table”.
    Could some one give me suggestion that which V$ views/method I use in order to get the above information and then
    how to load these information into a table “Client_table”?
    Your suggestions will be highly appreciated.
    With Regards
    BILAL

    You could use a LOGON TRIGGER so every session insert its own environment into your client_info table.
    You could use the following view and choose whatever attribute you need:
    create or replace view my_userenv (
    AUDITED_CURSORID ,
    AUTHENTICATION_DATA ,
    AUTHENTICATION_TYPE ,
    BG_JOB_ID ,
    CLIENT_IDENTIFIER ,
    CLIENT_INFO ,
    CURRENT_SCHEMA ,
    CURRENT_SCHEMAID ,
    CURRENT_SQL ,
    CURRENT_USER ,
    CURRENT_USERID ,
    DB_DOMAIN ,
    DB_NAME ,
    ENTRYID ,
    EXTERNAL_NAME ,
    FG_JOB_ID ,
    GLOBAL_CONTEXT_MEMORY ,
    HOST ,
    INSTANCE ,
    IP_ADDRESS ,
    ISDBA ,
    LANG ,
    LANGUAGE ,
    NETWORK_PROTOCOL ,
    NLS_CALENDAR ,
    NLS_CURRENCY ,
    NLS_DATE_FORMAT ,
    NLS_DATE_LANGUAGE ,
    NLS_SORT ,
    NLS_TERRITORY ,
    OS_USER ,
    PROXY_USER ,
    PROXY_USERID ,
    SESSION_USER ,
    SESSION_USERID ,
    SESSIONID ,
    TERMINAL
    ) AS SELECT
    SYS_CONTEXT ('USERENV', 'AUDITED_CURSORID') ,
    SYS_CONTEXT ('USERENV', 'AUTHENTICATION_DATA') ,
    SYS_CONTEXT ('USERENV', 'AUTHENTICATION_TYPE') ,
    SYS_CONTEXT ('USERENV', 'BG_JOB_ID') ,
    SYS_CONTEXT ('USERENV', 'CLIENT_IDENTIFIER') ,
    SYS_CONTEXT ('USERENV', 'CLIENT_INFO') ,
    SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMA') ,
    SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMAID') ,
    SYS_CONTEXT ('USERENV', 'CURRENT_SQL') ,
    SYS_CONTEXT ('USERENV', 'CURRENT_USER') ,
    SYS_CONTEXT ('USERENV', 'CURRENT_USERID') ,
    SYS_CONTEXT ('USERENV', 'DB_DOMAIN') ,
    SYS_CONTEXT ('USERENV', 'DB_NAME') ,
    SYS_CONTEXT ('USERENV', 'ENTRYID') ,
    SYS_CONTEXT ('USERENV', 'EXTERNAL_NAME') ,
    SYS_CONTEXT ('USERENV', 'FG_JOB_ID') ,
    SYS_CONTEXT ('USERENV', 'GLOBAL_CONTEXT_MEMORY') ,
    SYS_CONTEXT ('USERENV', 'HOST') ,
    SYS_CONTEXT ('USERENV', 'INSTANCE') ,
    SYS_CONTEXT ('USERENV', 'IP_ADDRESS') ,
    SYS_CONTEXT ('USERENV', 'ISDBA') ,
    SYS_CONTEXT ('USERENV', 'LANG') ,
    SYS_CONTEXT ('USERENV', 'LANGUAGE') ,
    SYS_CONTEXT ('USERENV', 'NETWORK_PROTOCOL') ,
    SYS_CONTEXT ('USERENV', 'NLS_CALENDAR') ,
    SYS_CONTEXT ('USERENV', 'NLS_CURRENCY') ,
    SYS_CONTEXT ('USERENV', 'NLS_DATE_FORMAT') ,
    SYS_CONTEXT ('USERENV', 'NLS_DATE_LANGUAGE') ,
    SYS_CONTEXT ('USERENV', 'NLS_SORT') ,
    SYS_CONTEXT ('USERENV', 'NLS_TERRITORY') ,
    SYS_CONTEXT ('USERENV', 'OS_USER') ,
    SYS_CONTEXT ('USERENV', 'PROXY_USER') ,
    SYS_CONTEXT ('USERENV', 'PROXY_USERID') ,
    SYS_CONTEXT ('USERENV', 'SESSION_USER') ,
    SYS_CONTEXT ('USERENV', 'SESSION_USERID') ,
    SYS_CONTEXT ('USERENV', 'SESSIONID') ,
    SYS_CONTEXT ('USERENV', 'TERMINAL')
    from dual;

Maybe you are looking for