Session between WAR files

hello,
I am asking a question, however I still did not try it out (just being onest).
Would a session variable work between two WAR files?
For-example: Imagine I have WAR file A, that have a link to page WAR file B. Will the page in WAR file B have access to the session variables set by WAR file A?
As I maybe said more then once. I want to develop a website in a modularized way. I want to have the basic structure of the website in one WAR file, and then have the other sections to be loaded inside an other WAR file.
I realized that most of the websites on the internet just make a clear cut of reporoducing the common parts in the other WAR files. However this is something I would like to avoid, since I feel it is wrong. However is this the only way how this can be done?
I have searched a lot on the internet, but can not find a lot of examples! :(
thanks and regards,
sim085

No, I don't think you'll find sessions being shared between different webapps.
The assumption tends to be that webapps are developed independantly, and might have conflicting session attribute keys. Details of session behaviour are in the web.xml file associated with each app, they can have different expiry times etc..
I've shared data between webapps using my own cookies and common classes rather than using session.

Similar Messages

  • Difference between .war file and .ear file

    Hi,
    what is the difference between .war file and .ear file ?
    Please let me know with appropriate explanation.

    War file means web application archive. It is archived file having a collection of JSP, servlets and static pages that together costitute a web application. It contains one WEB-INF directory which will have a file named web.xml which defines the structure of the web application.
    On the other side EAR file is Enterprise application archive. It is file having packaged content of one or more modules into a single archive so that the deployment of all the modules can be done simultaneously on the application server. It also contains XML files called deployment descriptors which gives the details of the deployment method. This deployment descriptor will be present in the folder META-INF folder.
    So the main difference betwwen the two is that Ear file is having collection of various modules to be deployed on the application server while the WAR file is used to deploy the web applications.

  • Session sharing between war files ???

              It seems that web-apps run in their own context, eg. are loaded by
              seperate classloaders. This means that a user will be prompted to log on
              to each web-app.
              Is it possible to share a session (eg. have a single login) for multiple
              web-apps (war-files) ???
              /Peter Reetz - Kapow
              

    A Web Session is defined for a Servlet Context. The Javadoc for HttpSession says the following:
    "Session information is scoped only to the current web application (ServletContext), so information stored in one context will not be directly visible in another."
    So, session is designed to work that way. You should be having separate web applications since you said you have separate JVM's. So, to workaround this, you can use a database to store session objects based on the session id of a user thus maintaining unique and proper data for each user. This will make the application a little slower compared to inmemory solution, but will make sure that proper data is served in a clustered environment too since session data is stored in the database and each bean/object do not maintain any state as such so that more number of users can also be supported. This will return proper data in case the user gets to a different app server in the cluster for high-availability and also as fail-safe.
    We implement this in our application that uses a cluster of 4 app-servers as it has many applications and has to support large number of concurrent users using any of these applications with a single sign-on.
    Amar.

  • How does one pass data between war files

    Hello All,
    I need to be able to pass values between 2 war files.
    example:
    from a JSP file in the 1st war file i get the login information and need to pass
    the userid and password to another JSP in the 2rd war file.
    Question: How does one go about doing this.
    I'm using webLogic server 6.1 on NT.
    Thanks - Bala

    The problem is that web applications do not share the same session by
    default. If you set the cookie name to be the same for both web
    applications, you should be able to pass the data in the HttpSession...
    Bala Ganesh wrote:
    Hello All,
    I need to be able to pass values between 2 war files.
    example:
    from a JSP file in the 1st war file i get the login information and need to pass
    the userid and password to another JSP in the 2rd war file.
    Question: How does one go about doing this.
    I'm using webLogic server 6.1 on NT.
    Thanks - Bala

  • Behaviour differences between  war file and exploded directory

    Hi,
    I'm baffled by differences in how my web app behaves when deploy in a war file and when deployed in exploded directory.
    Firstly when I deploy in exploded directory format (using wldeploy in ant) - the jsps do not precompile. However, when I deploy the war file - again using ant and wldeploy - precompile works just fine - and general performance seems better.
    Secondly - the webapp has a pdf file - which is used as a template to dynamically produce a document. When deployed
    in exploded format - the webapp works fine and is able to read the pdf. However, when I deploy in war file, the pdf cannot be read.
    Surely the behaviour should be the same whether we deploy as a war or exploded.
    Someone please help
    Tariq

    Some behaviors will be different between a WAR file deployment and an exploded WAR deployment.
    With respect to JSP precompile, you just say "they do not precompile", so I can't tell anything about that.
    When you read files from an exploded WAR, you can reference them in two ways: as a resource, or as an absolute file path. When you read files from a WAR file, you can only read files as a resource, and not as an absolute file path. You're not giving any information about how you're reading the file, so I can't tell about that either.
    You'd have to provide more detail to get better answers.

  • Communication between war files

    Hi Team,
    I have a requirement. I had set a data in servletContext using getServletContext.setAttribute() in a servlet, which is in one war file. Now i want that data which has been set, in another jsp or servlet which is in another war file .How can i achieve this? Please help

    Both on the same server?
    You can potentially use the method of ServletContext: servletContext.getServletContext("/pathToOtherContext");
    In a secure environment that should always return null. Enabling it is a server specific ability.
    On Tomcat you can do that through the [context configuration|http://tomcat.apache.org/tomcat-6.0-doc/config/context.html], specifying crossContext=true for the application you want to be able to make such a call.
    cheers,
    evnafets

  • Sharing sessions between web applications (WAR files)

    I am using weblogic 6.1. The opinion I have read indicates that
              sessions cannot be shared between WAR files. That is, I cannot put an
              attribute on the session from a servlet/JSP in one WAR file and read
              it out from the other. The only justification I've seen is "security".
              Now, I find this rather difficult to accept for several reasons:
              1. I cannot fathom what kind of "security" would prevent me from
              sharing the session between two web applications that I wrote myself.
              Let's say I want to write a system that I divide up, for
              modularity/separate deployment purposes, into 5 different WAR files.
              Why should I not be able to just sign on once and pass that logon
              information in the session from one to the other? (I know, I can use
              cookies or URL rewriting - but that doesn't seem to be to be a good
              solution. And if you can share information through cookies, why not
              through sessions?) What about other user information like currently
              selected language?
              2. Several app servers (iPlanet and I have heard two others) allow you
              to share sessions between WARs. Why not weblogic?
              Thanks for any information you can give me. I have not been able to
              find anything in weblogic documentation about this. If I am
              misunderstanding the server capabilities, please enlighten me.
              Thanks,
              <>< gary
              

    http://www.weblogic.com/docs51/classdocs/webappguide.html
              --kumar allamraju
              Grant Lewis wrote:
              > I'm currently evaluating weblogic and I can't find any references in
              > their documentation set stating they support web applications or war
              > files. They explicitly state in their docs the Servlet 2.2 specification
              > has been supported since version 4.5. I'm evaluating version 5.1. Can
              > anybody clear up the confusion for me.
              >
              > Grant
              

  • 45 min long session of log file sync waits between 5000 and 20000 ms

    45 min long log file sync waits between 5000 and 20000 ms
    Encountering a rather unusual performance issue. Once every 4 hours I am seeing a 45 minute long log file sync wait event being reported using Spotlight on Oracle. For the first 30 minutes the event wait is for approx 5000 ms, followed by an increase to around 20000 ms for the next 15 min before rapidly dropping off and normal operation continues for the next 3 hours and 15 minutes before the cycle repeats itself. The issue appears to maintain it's schedule independently of restarting the database. Statspack reports do not show an increase in commits or executions or any new sql running during the time the issue is occuring. We have two production environments both running identicle applications with similar usage and we do not see the issue on the other system. I am leaning towards this being a hardware issue, but the 4 hour interval regardless of load on the database has me baffled. If it were a disk or controller cache issue one would expect to see the interval change with database load.
    I cycle my redo logs and archive them just fine with log file switches every 15-20 minutes. Even during this unusally long and high session of log file sync waits I can see that the redo log files are still switching and are being archived.
    The redo logs are on a RAID 10, we have 4 redo logs at 1 GB each.
    I've run statspack reports on hourly intervals around this event:
    Top 5 Wait Events
    ~~~~~~~~~~~~~~~~~ Wait % Total
    Event Waits Time (cs) Wt Time
    log file sync 756,729 2,538,034 88.47
    db file sequential read 208,851 153,276 5.34
    log file parallel write 636,648 129,981 4.53
    enqueue 810 21,423 .75
    log file sequential read 65,540 14,480 .50
    And here is a sample while not encountering the issue:
    Top 5 Wait Events
    ~~~~~~~~~~~~~~~~~ Wait % Total
    Event Waits Time (cs) Wt Time
    log file sync 953,037 195,513 53.43
    log file parallel write 875,783 83,119 22.72
    db file sequential read 221,815 63,944 17.48
    log file sequential read 98,310 18,848 5.15
    db file scattered read 67,584 2,427 .66
    Yes I know I am already tight on I/O for my redo even during normal operations yet, my redo and archiving works just fine for 3 hours and 15 minutes (11 to 15 log file switches). These normal switches result in a log file sync wait of about 5000 ms for about 45 seconds while the 1GB redo log is being written and then archived.
    I welcome any and all feedback.
    Message was edited by:
    acyoung1
    Message was edited by:
    acyoung1

    Lee,
    log_buffer = 1048576 we use a standard of 1 MB for our buffer cache, we've not altered the setting. It is my understanding that Oracle typically recommends that you not exceed 1MB for the log_buffer, stating that a larger buffer normally does not increase performance.
    I would agree that tuning the log_buffer parameter may be a place to consider; however, this issue last for ~45 minutes once every 4 hours regardless of database load. So for 3 hours and 15 minutes during both peak usage and low usage the buffer cache, redo log and archival processes run just fine.
    A bit more information from statspack reports:
    Here is a sample while the issue is occuring.
    Snap Id Snap Time Sessions
    Begin Snap: 661 24-Mar-06 12:45:08 87
    End Snap: 671 24-Mar-06 13:41:29 87
    Elapsed: 56.35 (mins)
    Cache Sizes
    ~~~~~~~~~~~
    db_block_buffers: 196608 log_buffer: 1048576
    db_block_size: 8192 shared_pool_size: 67108864
    Load Profile
    ~~~~~~~~~~~~ Per Second Per Transaction
    Redo size: 615,141.44 2,780.83
    Logical reads: 13,241.59 59.86
    Block changes: 2,255.51 10.20
    Physical reads: 144.56 0.65
    Physical writes: 61.56 0.28
    User calls: 1,318.50 5.96
    Parses: 210.25 0.95
    Hard parses: 8.31 0.04
    Sorts: 16.97 0.08
    Logons: 0.14 0.00
    Executes: 574.32 2.60
    Transactions: 221.21
    % Blocks changed per Read: 17.03 Recursive Call %: 26.09
    Rollback per transaction %: 0.03 Rows per Sort: 46.87
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Buffer Nowait %: 99.99 Redo NoWait %: 100.00
    Buffer Hit %: 98.91 In-memory Sort %: 100.00
    Library Hit %: 98.89 Soft Parse %: 96.05
    Execute to Parse %: 63.39 Latch Hit %: 99.87
    Parse CPU to Parse Elapsd %: 90.05 % Non-Parse CPU: 85.05
    Shared Pool Statistics Begin End
    Memory Usage %: 89.96 92.20
    % SQL with executions>1: 76.39 67.76
    % Memory for SQL w/exec>1: 72.53 63.71
    Top 5 Wait Events
    ~~~~~~~~~~~~~~~~~ Wait % Total
    Event Waits Time (cs) Wt Time
    log file sync 756,729 2,538,034 88.47
    db file sequential read 208,851 153,276 5.34
    log file parallel write 636,648 129,981 4.53
    enqueue 810 21,423 .75
    log file sequential read 65,540 14,480 .50
    And this is a sample during "normal" operation.
    Snap Id Snap Time Sessions
    Begin Snap: 671 24-Mar-06 13:41:29 88
    End Snap: 681 24-Mar-06 14:42:57 88
    Elapsed: 61.47 (mins)
    Cache Sizes
    ~~~~~~~~~~~
    db_block_buffers: 196608 log_buffer: 1048576
    db_block_size: 8192 shared_pool_size: 67108864
    Load Profile
    ~~~~~~~~~~~~ Per Second Per Transaction
    Redo size: 716,776.44 2,787.81
    Logical reads: 13,154.06 51.16
    Block changes: 2,627.16 10.22
    Physical reads: 129.47 0.50
    Physical writes: 67.97 0.26
    User calls: 1,493.74 5.81
    Parses: 243.45 0.95
    Hard parses: 9.23 0.04
    Sorts: 18.27 0.07
    Logons: 0.16 0.00
    Executes: 664.05 2.58
    Transactions: 257.11
    % Blocks changed per Read: 19.97 Recursive Call %: 25.87
    Rollback per transaction %: 0.02 Rows per Sort: 46.85
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Buffer Nowait %: 99.99 Redo NoWait %: 100.00
    Buffer Hit %: 99.02 In-memory Sort %: 100.00
    Library Hit %: 98.95 Soft Parse %: 96.21
    Execute to Parse %: 63.34 Latch Hit %: 99.90
    Parse CPU to Parse Elapsd %: 96.60 % Non-Parse CPU: 84.06
    Shared Pool Statistics Begin End
    Memory Usage %: 92.20 88.73
    % SQL with executions>1: 67.76 75.40
    % Memory for SQL w/exec>1: 63.71 68.28
    Top 5 Wait Events
    ~~~~~~~~~~~~~~~~~ Wait % Total
    Event Waits Time (cs) Wt Time
    log file sync 953,037 195,513 53.43
    log file parallel write 875,783 83,119 22.72
    db file sequential read 221,815 63,944 17.48
    log file sequential read 98,310 18,848 5.15
    db file scattered read 67,584 2,427 .66

  • Session sharing among multiple WAR files inside an EAR file

    Hi all,
    Is there a way where I can share my session object among multiple WAR files which are inside an EAR file?
    Please suggest.

    r035198x wrote:
    Some application servers (like Weblogic) allow to configure session sharing when you deploy the application.Sidenote: which is completely against the servlet spec.

  • Cookies between multiple WAR files

              If you were to use multiple Web Applications, deployed in separate WAR files, on
              the same application, could they all use the same Cookie? Since cookies are used
              for storing session info, and all of these web apps would reside on the same managed
              server (clustered group of managed servers), shouldn't they all have the same
              CookieName set? If not, wouldn't the NES plug-in get confused, assuming the same
              proxy path was used to access all of the Web Applications?
              

    If you were to use multiple Web Applications, deployed in separate          > WAR files, on the same application, could they all use the same
              > Cookie?
              Yes.
              > Since cookies are used for storing session info, and all of these web
              > apps would reside on the same managed server (clustered group of
              > managed servers), shouldn't they all have the same CookieName
              > set? If not, wouldn't the NES plug-in get confused, assuming the
              > same proxy path was used to access all of the Web Applications?
              I believe WL either creates a different session cookie for each app. This is
              easy by adding a path to the cookie to restrict its "view".
              However, that doesn't stop you from having a shared cookie.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "djmv" <[email protected]> wrote in message
              news:3ed77e08$[email protected]..
              >
              

  • 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

  • How to Persis session between two ear files

    Can anybody tell me how to persists session between two ear files?
    Please Help its urgent!!
    Rahul

    Rahul -- there's nothing as a J2EE spec requirement or even a proprietary feature of OC4J/OracleAS which will enable this.
    If you have two different EAR files, then they are two different applications, and each will have their own session which can't be shared amongst each other.
    If you have data which needs to be shared across different applications then you could either put it on a shared file system or write it to a database which you can then read from in the other application.
    One way to do this is to implement the HttpSessionAttributeListener interface which will be called when object are added/removed/updated from a session, and then make a determination on whether the new object needs to be stored in a common place to facilitate sharing between applications.
    This is more likely to be a hackaround and ideally you'd examine why you want to share session state across applications and rearchitect so you don't need to do it -- but if you want to try a solution without a major revisiting of the whole application, then perhaps it's an option.
    cheers
    -steve-
    cheers
    -steve-

  • Jaas.conf file conflicts between WARs.....

    We have several different apps running in a TomCat container and each one contains its own jaas.conf file in its WAR file. Is there anyway for these apps to all find their own jaas.conf file? As far as I can tell, there is no way to do this.
    Right now, each app sets a system property like this:
    String jaas_conf = getServlet().getServletContext()
    .getRealPath("/WEB-INF/jaas.conf");
    System.getProperties().setProperty(
    "java.security.auth.login.config",jaas_conf);
    The problem here is that only the most recently loaded app can ever find its jaas.conf file.
    Is there a way to do this?
    Thanks!
    Tim

    Right now, each app sets a system property like this:
    String jaas_conf = getServlet().getServletContext()
    .getRealPath("/WEB-INF/jaas.conf");
    System.getProperties().setProperty(
    "java.security.auth.login.config",jaas_conf);
    Don't know exactly about jaas, but can you make a copy of the System propreties, or make a new property and fill it with your info and then use that as a parameter for your jaas instance?

  • War file and access control with WebLogic

    I am trying to put some access control on different files in my war-file, but just can't get it to work... It seems like all roles defined in weblogic.properties gives the user access to all files in the war. I just don't understand the connections between the security realm, the weblogicURL.policy file and the web.xml file... If I do not specify a weblogic.security.URLAclFile, no access control is done at all.
    This is how my weblogic.properties file looks like:
    weblogic.security.URLAclFile=e:\\weblogic\\weblogicURL.policy
    weblogic.password.koko=kokokoko
    weblogic.password.arnebelinda=arne1234
    weblogic.security.group.ppuseradmins=arnebelinda
    and my weblogicURL.policy:
    deny Principal weblogic.security.acl.GroupImpl "everyone" {
    Permission weblogic.security.acl.URLAcl "weblogic.url", "/admin/-";
    and finally, my web.xml-file:
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
         <session-config>
              <session-timeout>30</session-timeout>
         </session-config>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>admin</web-resource-name>
                   <url-pattern>index.jsp</url-pattern>          </web-resource-collection>
              <auth-constraint>
                   <role-name>ppuseradmins</role-name>
              </auth-constraint>
         </security-constraint>
         <login-config>
              <auth-method>BASIC</auth-method>
              <realm-name>WebLogic Server</realm-name>
         </login-config>
         <security-role>
              <role-name>ppuseradmins</role-name>
         </security-role>
    </web-app>
    it does not matter which user is part of the ppuseradmins group. The user koko is not a member, but is given access to my whole .war anyway (after submitting correct username/password). Omitting the <realm-name> does not seem to work either; the default realm is not used, instead null is used.
    Does anybody have a clue? I would really appreciate it!
    I am using WebLogic 5.1 sp 9
    best regards,
    PJ

    In you pocily file entry, you have specified "/admin/-"
    However, in the <security-constraint> element in web.xml, your <url-pattern> is not set to /admin
    Could that be the problem ?

  • War file and access control

              I am trying to put some access control on different files in my war-file, but just
              can't get it to work... It seems like all roles defined in weblogic.properties
              gives the user access to all files in the war. I just don't understand the connections
              between the security realm, the weblogicURL.policy file and the web.xml file...
              If I do not specify a weblogic.security.URLAclFile, no access control is done
              at all.
              This is how my weblogic.properties file looks like:
              weblogic.security.URLAclFile=e:\\weblogic\\weblogicURL.policy
              weblogic.password.koko=kokokoko
              weblogic.password.arnebelinda=arne1234
              weblogic.security.group.ppuseradmins=arnebelinda
              and my weblogicURL.policy:
              deny Principal weblogic.security.acl.GroupImpl "everyone" {
              Permission weblogic.security.acl.URLAcl "weblogic.url", "/admin/-";
              and finally, my web.xml-file:
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <session-config>
              <session-timeout>30</session-timeout>
              </session-config>
              <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
              </welcome-file-list>
              <security-constraint>
              <web-resource-collection>
              <web-resource-name>admin</web-resource-name>
              <url-pattern>index.jsp</url-pattern> </web-resource-collection>
              <auth-constraint>
              <role-name>ppuseradmins</role-name>
              </auth-constraint>
              </security-constraint>
              <login-config>
              <auth-method>BASIC</auth-method>
              <realm-name>WebLogic Server</realm-name>
              </login-config>
              <security-role>
              <role-name>ppuseradmins</role-name>
              </security-role>
              </web-app>
              it does not matter which user is part of the ppuseradmins group. The user koko
              is not a member, but is given access to my whole .war anyway (after submitting
              correct username/password). Omitting the <realm-name> does not seem to work either;
              the default realm is not used, instead null is used.
              Does anybody have a clue? I would really appreciate it!
              I am using WebLogic 5.1 sp 9
              best regards,
              PJ
              

    In you pocily file entry, you have specified "/admin/-"
    However, in the <security-constraint> element in web.xml, your <url-pattern> is not set to /admin
    Could that be the problem ?

Maybe you are looking for

  • Backing up Ipad without lost Password

    Is it possible to backup an Ipad first generation iOS 5.1.1 WITHOUT a password if I have forgotten the password used to do previous backups?  I do not need to do a Restore.  I have tried doing the backup in a computer where I have never backed up thi

  • Problems with TFPT on OS X Tiger (Workaround Bonjour error)

    Hello, I'm trying to update the firmware in my DCM-202 modem via TFTP and I keep getting an error "Workaround Bonjour Unknown Error 0". This occurs when I enter the following command lines in the terminal sudo service tftp start sudo launchctl load -

  • Increase of Threads in Managed Nodes

    Hi, I have the following question. I am analyzing the performance of an Weblogic OSB Cluster in a Production Environment witch is compose by 4 managed servers, with 4 GB of memory each.} This is the Server Start of each one: -server -Xms4096m -Xmx409

  • Hover Text

    Experts, I have a following requirement: I have a dashbaord prompt like: Search Value(Label) Edit box(the user can enter a value) Go button We want, when the user hovers over the label, our customized message shows up. Let me know how can we achieve

  • Link to files

    Will InDesign CC be able to link to files saved in the Cloud?