Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    4
    Rep Power
    0

    Default Delegate Control from one Application to another

    Hi all,
    This is kumar, i m trying to deligate control from one application to another, i m able to do the same using res.sendRedirect(string).
    But the problem here is i am not able to transfer any data from application 1 to application 2.

    To explain in details i had an 3 applications A, B, C. Whenever a request is made to anyof A or B the control has to goto C and i should come up with a login screen. When i submit my credentials, they are validate in c and should be sent back to application actual application. When the actual application A or B receives the request it should contain the credentials i had entered in the Login Screen of C.

    I will be glad, if someone please help me in acheiving this..

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    I haven't done this for a good while, and I've forgotten exactly how it works, and I did this for Tomcat, but...

    You can make your servlet require authentication. The *server* will then display a form, which you can define, that returns a user name and a password field. The server will check the credentials against the servlet's requirements and allow the servlet to display, if the user is authorized. The user principal object is part of the session.

    I added other fields and used Javascript to cram all the information into the name field. I then created a user principal that validated the user. The class (UserPrincipal?) was trivial, but I realized I could add as much to my subclass as I wanted. I validated against a database of users that I maintained, but you can implement *any* method you want.

    Exactly how you do this will depend on your server. It seemed terrible when I started, but it turned out to be fairly easy and very powerful. The best part is, you use the server to handle authentication, so you don't have to code for it in your applications.

  3. #3
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    4
    Rep Power
    0

    Default

    Sorry Steve, I didnt get what i wanted.. may i didnt give you the correct query..

    As per your explanation above i understand the applications work on same servers.. but that is not the case with me.. i have three different aplications workin on three diff servers and 3 different systems.. when the 1st server makes authentication and deligates i want the credentials to be carried to another application on 2nd server.. and i hope the transfer of data from server1(application 1) to server2(application 2) is no where related with the type of server we use.. Correct me if i m wrong.. Please provide me with some information..

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    OK. I thought application 3 simply allowed the user to log in.

    You can do this easily using JavaScript, as long as the browser security settings don't interfere.

    On Server1, create a page containing a form. Make the post address of the form Server2. Fill in all the form fields before sending it to the browser. Add JavaScript at the end of the HTML that immediately posts the form. You might want to hide the form under a layer and put a message for the user in the layer, just in case the page is on the browser long enough for the user to see it. Server2 will see a normal POST request and receive all the form fields.

    I wouldn't use this in all my applications, but this is a special case.

  5. #5
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Another option is to use CORBA or RMI so the apps can all act as a single distributed application.

Similar Threads

  1. Excel macros to control Java application
    By musicgold in forum Advanced Java
    Replies: 8
    Last Post: 04-25-2009, 11:43 PM
  2. Control printing queue
    By pjmorce in forum Advanced Java
    Replies: 3
    Last Post: 11-07-2008, 09:57 AM
  3. Control on exe
    By jazz2k8 in forum New To Java
    Replies: 3
    Last Post: 08-14-2008, 03:06 PM
  4. How to draw directly on an SWT Control
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 08:51 PM
  5. control app width based on certain control
    By thebillybobjr in forum SWT / JFace
    Replies: 0
    Last Post: 05-15-2008, 05:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •