Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-23-2009, 12:01 PM
Member
 
Join Date: Jan 2009
Location: Bangalore
Posts: 4
Rep Power: 0
saikumarkomati is on a distinguished road
Send a message via Yahoo to saikumarkomati
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..
__________________
regards
saikumar komati
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 01-23-2009, 05:32 PM
Steve11235's Avatar
Senior Member
 
Join Date: Dec 2008
Posts: 972
Rep Power: 2
Steve11235 is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-23-2009, 07:30 PM
Member
 
Join Date: Jan 2009
Location: Bangalore
Posts: 4
Rep Power: 0
saikumarkomati is on a distinguished road
Send a message via Yahoo to saikumarkomati
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..
__________________
regards
saikumar komati
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-23-2009, 08:24 PM
Steve11235's Avatar
Senior Member
 
Join Date: Dec 2008
Posts: 972
Rep Power: 2
Steve11235 is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-24-2009, 04:19 AM
Senior Member
 
Join Date: Jan 2009
Posts: 360
Rep Power: 2
toadaly is on a distinguished road
Default
Another option is to use CORBA or RMI so the apps can all act as a single distributed application.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel macros to control Java application musicgold Advanced Java 8 04-25-2009 11:43 PM
Control printing queue pjmorce Advanced Java 3 11-07-2008 09:57 AM
Control on exe jazz2k8 New To Java 3 08-14-2008 03:06 PM
How to draw directly on an SWT Control Java Tip SWT 0 07-02-2008 08:51 PM
control app width based on certain control thebillybobjr SWT / JFace 0 05-15-2008 05:52 PM


All times are GMT +2. The time now is 06:46 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org