Passing Objects Between Web Applications

Hello, I have a question in which I have posted in several different forums. I'm hoping that someone may be able to help me with this.
I have a JSP "application" in which I several WAR files that contain different portions of the application. The logic is in place that each application is in separate WAR file for SCM. For the purpose of getting help, I will only concentrate on two different WAR files and a JAR file, which is located in the <TOMCAT_HOME>/lib directory.
The JAR file contains a couple of classes which hold generic information that is used between all of the different subapplications.
ASD.war: contains a couple of files for the master application that links different sub-applications that a user has access to. This WAR file is what is initially loading the JAR file with the information.
* Login.html: Prompts user for username/password and forwards to login.jsp
* Login.jsp: verifies that above is a valid database user and loads the JAR's class with relevent information and if so, loads up contents.jsp
* Contents.jsp: shows a list of applications that the user has access to. It contains hyperlinks to different applications (WAR files).
SCR.war: contains an application that tries to use the loaded variables/values from the JAR file supplied/populated by the ASD.war application
* SCR_Role.jsp: contains the different roles in which the logged in user has priviledges to. It tries to utilize the username/password that was populated in the Login.jsp (ASD.war).
The problem, of course, is that the reference to the JAR class doesn't exist for the SCR application. I have tried this with using static variables, which works. But of course this is not wise or pratical for a multi-user use of the application(s).
Can anyone suggest things that I may try. Right now, I'm getting near to suppling an addition database table that will temporarily be populated with the username/password so that the sub-application can load and remove the record. This would work; I don't want these values being passed repeatedly throughout the life of the session, I would like to pass the reference to the object. By making the table, I would still run into problems whereas I want to pass non-string values to another application.
Thanks for any help that you can provide.
Jim

I think that I may have found a solution... There might be a better way, and maybe this will be able to get someone else thinking about something related...
Ok, I have my jar file which contains now loginInfo & a new staticLoginInfo. My loginInfo contains all of the instance variables; whereas the staticLoginInfo contains static references to the instance class.
ASD.jar - staticLoginInfo.java:
private static Vector reference = new Vector();
public static int setUp(loginInfo login)
int seq = reference.size();
reference.add(seq,login);
return (seq)
public static loginInfo getLogin(String seq)
return ((loginInfo)(reference.get(Integer.parseInt(seq))));
Now I have a war file that contains contents.jsp which contains links to the different applications that the logged in user has access to.
ASD.war - contents.jsp:
seq = staticLoginInfo.setUp(login);
<a href="/SCR/SCR_Role.jsp?seq=<%=seq%>">...
Now my SCR.war file contains SCR_Role.jsp that shows different "roles" that that person has within the application...
SCR.war - SCR_Role.jsp:
loginInfo tLogin = (loginInfo)staticLoginInfo.getLogin((String)request.getParameter("seq"));
login.setUsername(tLogin.getUsername());
login.setPassword(tLogin.getPassword());
login.setDatabase(tLogin.getDatabase());
Believe it or not, this works. I thought that I would be able to just put login = (loginInfo)staticLoginInfo..., and this works for each page that I put this in; but by setting a temporary variable (tLogin), it carries throughout the rest of the application...
Thanks for all the help for those that tried...
Jim
</a>

Similar Messages

  • Difference Between Web application design and Report Designer

    Hi,
    I have searched in the forum as well i Google it but still i am not clear the difference between Web application Designer and report Designer , why especially we go for WAD ? and  what is not possible in Report designer which we can do in WAD  Please some one explain me that would be great helpful to me. i am having lot of confusion in this issue.
    thanks,
    Gal

    Hi,
    The Report designer is completely for formating of your query and results. Here you have the flexibility to design your query(one/more) results in your own way.
    The WAD is for displaying various web items at one short for a single/multiple query. And here you have the flexibility to do the XML coding on the web items, but not as much you have the flexibility on Report Designer.
    But, Report designer will have more performance issues than WAD. So, generally it helps when you need extreme formating of your reports.
    Hope this clears your doubt.
    Regards,
    Srinivas.

  • How to Pass Java Objects between Web Dynpro and Java SAP iViews

    Basically I have an SAP web dynpro iView that I do stuff with and I want to pass an object to another iView which is just a regular Java iView. From what I've read and tried, I can't just stick something in the session object and hope that the Java iView can pull it down the other end. I had a dream that it was possible (seriously).
    Anyway, are there any possible solutions around? Please advice and share you throughts. I will try to dream about it again tonight and see if its really gonna work this time.
    thanks for your help in advance

    There is no easy way you can pass objects other than those supported by express such as String, map, list etc.
    Though not advised, you can create a class with static variables to handle the storage of such java objects during transition between form and workflow. You will need to somehow identify the objects uniquely .

  • How to exchange a java object  between two applications using web service?

    Hi,
    I am working with Eclipse 3.2 and the application server is weblogic 10.
    I have two applications, each one works in an instance of the server.
    The first application contains a method called "send " which return a java object.
    The second one contains a method called "receive" which must receive this object.
    The two applications must exchange the object using web service,
    Can you help me please?
    Thanks.

    Have you defined your service class/methods accepting, or returning, the appropriate objects? If so, does the generated WSDL appear to be correct? I have just completed a web service project and found that passing specific objects to be simple, however, I was passing objects which were simply container objects with bean characteristics. Also, might I suggest that you have a play with netbeans. I found that IDE to be great for creating and consuming web services!

  • 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
              

  • Need a way to pass object to another application

    Hello Everyone,
    I need to pass an object from one application to another. I wanted to do that using request.setAttribute(Object) but this works only on RequestDispatcher.forward(URL) method and can be used only within the application you are currently in. It does not work for absolute URLs therefore I cannot go to another application. I also tried response.sendRedirect(URL) but then request object is lost when redirected to another application.
    Any help will be greatly appreciated,
    Thanks in advance,
    Y.M.

    if your two application servers are on the same box,
    then you can get the RequestDispatcher object from
    another ServletContext and then use the
    request.setAttribute() call.
    ServletContext newContext =
    getServletContext().getContext(webApp);
         if( newContext == null )
    throw new IllegalArgumentException("Invalid webApp
    p '"+webApp+"' does not exist.");
    request.setAttribute("myobject", objToPass) ;
    RequestDispatcher dispatcher =
    newContext.getRequestDispatcher(urlToGoTo) ;
    dispatcher.forward(request, response);
    Unfortunately those apps are on different servers ...

  • Best way to have only one  instance of an object in web application.

    Hello,
    I defined a class that provides services to my web application: subscribes user, check if user already subscrubed etc. The objects don't need to save any session information. So it is like a Stateless Session Bean (from what I've read about Session beans).
    The webapp is small and I don't want to use EJBs.
    What would be the best way to have one instance of the above class in my webapp ?
    Would making the class static be a good method ? Using a factory ?
    Is there a way to put in web.xml something that asks the container to instantiate an object that is not a servlet and place it in Application scope, so that I cann retrieve it whenever required in my app ?
    Other suggestions ?
    Thank you,
    Vlad.

    Hi
    The best way to have only one instance is use the singleton pattern. The idea is : the class has a private
    contructor, a public static method that returns an instance of this object and a static member that is false if not any instance and true if there si an instance.
    To obtain one instance you can do some like
    MyObject ob=MyObject.getIntance();
    this method inspect the static member and returns null if true. If false set to true and return the object
    via the private constructor.
    You can lear more at book of Gramma .... (gang of four)
    Hope this helps

  • Passing object between dialogs. please help

    I have a panel which displays student's info.
    There is a button called "Create New Student"
    When the button is clicked, a new Dialog will shows up, where users can enter basic info for new student.
    My question is, after a user finish entering data for new student, a new Student Object will be created.
    How do I pass this Student Object back to original frame?
    The basic question would be how do I pass object from a Dialog to its' caller Panel.
    Thanks

    Put your Student object in global scope or in sucha
    scope that both the dialog boxes can access it!
    That is not a good idea. I think there is some misunderstanding here.
    Putting Student object at global scope has nothing to
    do with encapsulation. Furthermore, it is a
    requirement! In OP's main panel he/she needs
    reference to Student object. In Student
    creation dialog, we need to create a new
    Student. These two requirements necessitate the
    accesibility of Student class.Yes, they both need to see the class. But it would be a bad idea to make the object that is in the main panel a global variable for the dialog to update.

  • Pass object between forms

    Hi:
    Is there any way of returning an object to a parent form?

    Hi Raúl,
    What is usually done is have a global object such as Application where all other objects hang from. Have a look at the TechDemo AddOn 2.0 from Sebastien Danober. It is avaiable for download here:
    https://www.sdn.sap.com/irj/sdn/softwaredownload?download=/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/business_packages/a1-8-4/add-on technical demo v2 for sap business one 2005.zip
    Hope helps,
    Ibai Peñ

  • How are permissions applied between Web Applications and from Service Applications?

    I'm quite confused about how permissions are applied to Content Databases in relation to service accounts. So, as an example, I have two web applications - Intranet whose service account is DOMAIN\sps_webapp_default - and My Sites whose service account is
    DOMAIN\sps_webapp_social.  The "sps_webapp_social" account has full control (through User Policy) to the Intranet web app.
    When I go to My Sites> Sites> Suggested Links and click on any suggestions I get the below error and the site is not "followed".  This Content Database sits under the Intranet web app which the sps_webapp_social has full control to.
    I'm also getting similar permission issues when the account that runs various service applications tries to connect to the DB (such as workflow service).  This is happening to new or migrated sites.  I know permissions can be applied directly
    in SQL but this can't be the way to do it? 
    Is there a simple reason why these permissions aren't propagating through?

    I resolved my issue. I deleted the Work Management Service Application and created it again - this time, I made sure the IIS Pool (I created its own application pool) service account running this was the same as the My Site service account. 
    So, running under DOMAIN\sps_webapp_social.  This seemed to clear up all of my permissions issues being thrown up in Event Viewer too.
    My Sites really is a complicated beast...  I'm getting there.  Hopefully this helps somebody else!

  • Passing values between adf application and web services

    hi i have a situation where i have jsff page which got username,surname,lastname,email i what to pass this value to my webservices how can i do that. this is how i create my webservicesright click viewControler->web services->web services Data Control
    i what to pass the value to webservices workflow i already have a screen in my workflow now i what to pass the adf application values to that webservices am in jdeveloper 11.1.1.6.0
    i try this
    <af:inputText simple="true"
                            required="#{bindings.Username.hints.mandatory}"
                            columns="#{bindings.Username.hints.displayWidth}"
                            maximumLength="#{bindings.Username.hints.precision}"
                            shortDesc="#{bindings.Username.hints.tooltip}" id="it1"
                            value="#{bindings.Username.inputValue}">
                <f:validator binding="#{bindings.Username.validator}"/>
                <af:setPropertyListener from="#{bindings.Username.inputValue}"
                                        to="#{bindings.start_user_details}"
                                        type="action"/>
              </af:inputText>

    i make my webservices to pass values
    <af:inputText simple="true"
                            required="#{bindings.Username.hints.mandatory}"
                            columns="#{bindings.Username.hints.displayWidth}"
                            maximumLength="#{bindings.Username.hints.precision}"
                            shortDesc="#{bindings.Username.hints.tooltip}" id="it1"
                            value="#{bindings.Username.inputValue}">
                <f:validator binding="#{bindings.Username.validator}"/>
                <af:setPropertyListener from="#{bindings.Username.inputValue}"
                                        to="#{bindings.approveUser_username}"
                                        type="action"/>
              </af:inputText>
    but am geting error reference approveUser_username not found

  • Passing VARs between MXML Application and MXML components!

    Hi,
    I'm trying to pass a variable between the MXML Application and the MXML Component with ValueObjects.
    But when i call the variable on the MXML Component it is null!
    ValueObject Class Code:
    package valueObjects
        [Bindable]   
        public class MyGlobalVars
            public var NomeGaleria: String;
            public function MyGlobalVars()
    MXML Application Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns:comp="components.*" layout="vertical" height="100%" width="100%" >
    <mx:Script>
        <![CDATA[
            import valueObjects.MyGlobalVars;
            import mx.managers.PopUpManager;
            import mx.core.Container;
            [Bindable]
            public var nomeGaleria:MyGlobalVars;
            private function AbreGaleria():void{
                  nomeGaleria=new MyGlobalVars();
                nomeGaleria.NomeGaleria = "Moda";
                PopUpManager.addPopUp(new galeriaImagens(),this,true);
        ]]>
    </mx:Script>
    <mx:Panel height="673" width="839" verticalAlign="middle" borderStyle="none" layout="absolute">
        <mx:Canvas id="SMGaleria" width="815" height="30" x="2" y="98"">
            <mx:LinkButton x="474" y="5" label="moda" click="AbreGaleria()"/>   
         </mx:Canvas>
        <mx:ViewStack id="content" height="440" width="815" borderStyle="none" x="2" y="128">
            <comp:galeriaImagens id="GaleriaImagens" x="0" y="5" strGaleria="{nomeGaleria}"/>
        </mx:ViewStack>
    </mx:Panel>
    </mx:Application>
    MXML Component Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow  xmlns:mx="http://www.adobe.com/2006/mxml"
        showCloseButton="true" creationComplete="CenterMe()" backgroundColor="#000000" xmlns:components="components.*" >
    <mx:Script>
        <![CDATA[
            import valueObjects.MyGlobalVars;
            import mx.controls.Alert;
            [Bindable]
            public var strGaleria:String;
            private function CenterMe(): void{
                 Alert.show(strGaleria);
        ]]>
    </mx:Script>
    </mx:TitleWindow>
    On the MXML component the value of strGaleria is null! It would not have to be: Moda??

    You may need to change your code as follows:
    <comp:galeriaImagens id="GaleriaImagens" x="0" y="5" strGaleria="{nomeGaleria.NomeGaleria}"/>
    Previously you had set strGaleria to the value of the object, not the string within the object.
    But I think you will still have a problem because function AbreGaleria will not be called until the user clicks the link button, and only then will NomeGaleria have a value, so I would set a default value as follows, otherwise at app launch it will be null:
    public var NomeGaleria: String = "";
    or  if that does not work
    public var NomeGaleria: String = " ";
    Another possible problem is that you are calling this code at the component creationComplete, but the LinkButton has not been clicked yet, so the value object string value has not been set, so the alert will not display anything:
    private function CenterMe():void{
        Alert.show(strGaleria);
    I think you need to reorganize some things here.
    If this post answers your question or helps, please mark it as such.

  • Use HTTP Session to pass Object from Web Dynpro for Java to JSP page

    Is it possible to get a handle on the HTTP Session object from within a Web Dynpro application? I want to place a Java object in there that can be retrieved by a JSP page.
    Thanks in advance.

    Hi Tom Cole,
       You can try this. i am not sure if this will work or not.
    HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
    You can also try this.
    IWDRequest mm_request = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
    HttpServletRequest request = (HttpServletRequest)mm_request.getProtocolRequest();
    IWDRequest basically wraps the HttpServletRequest. if you are using NW04s then the getProtocolRequest() may not be available.
    Regards,
    Sanyev

  • How to load objects in web application context during oc4j startup?

    Hi
    How I can put some objects in application context during oc4j application startup?
    I'm using oracle as10g j2ee and web cache edition.
    Thanks

    An idea would be to write your own OC4JStartup implementing class and have this thing create the objects you want and bind them to JNDI.

  • Passing Objects in Web Services..

    I need to pass an object that I create back to the client calling the web service. I am using the SJSE wizard to create the web service. When I go to supply an input parm/attribute using the wizard, the only options are primitives and String. I need to be able to pass my own object back and forth. Is there a good example of this out there.. using SJSE.
    I know it can be done with AXIS outside of SJSE. I'm wanting an easier way.
    J

    One solution could be to use axis with ide:
    http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=55589
    http://forum.sun.com/jive/thread.jspa?forumID=122&threadID=96801
    http://coding.mu/archives/2005/08/26/using-apache-axis-in-netbeans-50/
    Or you could create a HashSet of objects that are accessible via string keys...

Maybe you are looking for