aspose file tools*
The moose likes JSP and the fly likes Sending the value from jsp to jsp in two different web applicaitons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Sending the value from jsp to jsp in two different web applicaitons" Watch "Sending the value from jsp to jsp in two different web applicaitons" New topic
Author

Sending the value from jsp to jsp in two different web applicaitons

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
Hi,
i should have to send the value like username from one application to other application which are running in same server.i am redirecting to other application using response.sendRedirect(url) if i am adding the username at the end of url it is revealing the username in the url and using request scope its not possible so how can i do that?


Thanks
Ganesh Kumar CH


SCJP5 and SCWCD1.5
Think Twice Act Wise...
jhon masco
Ranch Hand

Joined: May 13, 2010
Posts: 93
Please write the line of code.
You code is similar to this??


Are you using

for request the parameter?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60075
    
  65

Any means that you use to pass the information to the other application via HTTP will expose the values unless you use SSL.

Perhaps you can use a server-side sharing mechanisms like the database if they share a database.

Are you trying to implement single-sign-on?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
yeah i am trying to implement sso for my application......

i m just redirecting to my application jsp page from other application jsp page using the following code



so its being displayed in URL along with value and there is no sharing database...

How can i implement this? My thought is that i will encrypt the username value in source end and decrypt in destination end so that it wont be revealed...

Do you suggest this?


Aim: How can i get the value from one webapplication to other webapplication either using objects like request,response,session and application or in different way?
jhon masco
Ranch Hand

Joined: May 13, 2010
Posts: 93
I dont understand why you can not get the value from the url really but...
please try JSTL redirect and request the value in the destiny page with JSTL too.
May be this work. Also would be fine if you can show a piece of you code.


Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
i think that it will not work....

As per my knowledge if we redirect to new webapplication i.e new request so that container will create new request and response objects...
Noel Alex
Greenhorn

Joined: Jul 25, 2011
Posts: 7

Hello,

yeah i am trying to implement sso for my application......

How about using something like Java CAS ?
Regards,
Simple


MWaNDuLu
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
i am using my official SSO login page for my application....
Niju Thomas
Greenhorn

Joined: Jul 29, 2011
Posts: 13
it is possible as sending through url.If you want to hide encrypt it through xml configuration file.
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
could you please let me know how to encrypt through xml configuration file?
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Why don't you POST it instead.


Regards
KumarRaja

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
Hi Raja,

Check this http://www.jguru.com/faq/view.jsp?EID=285822
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

I did not mean to POST it through sendRedirect.. I meant that you can POST to servlet/jsp by other means. afterall its a HTTP request and you can use other means, for eg, HTTP Post. I had not tried this personally before, so would be glad to know the results if it works for you.
Pete Nelson
Ranch Hand

Joined: Aug 30, 2010
Posts: 147

Kumar Raja wrote:I did not mean to POST it through sendRedirect.. I meant that you can POST to servlet/jsp by other means. afterall its a HTTP request and you can use other means, for eg, HTTP Post. I had not tried this personally before, so would be glad to know the results if it works for you.


POST isn't any more secure than GET. You still end up sending the username over the network, and you're still vulnerable to someone altering the request to change the username to whatever they wish.

The only way I can see to do this securely is through some sort of shared persistence between the web application contexts. This could be a database, a datafile, Kerberos server, etc. The browser can't be the ONLY way your two web applications communicate, or it's only going to be as secure as that browser.


OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

How about encrypting the username through some Private/Public key encryption, before POSTing. I do not mean to oppose your proposal of shared persistence, but just curious on encryption+POST
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60075
    
  65

Maybe I missed a nuance somewhere, but why not just use SSL?
Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
At present, i done it using encryption/decryption with

Is there any other way except shared DB,server and SSL?
gabrilla ebinezer
Greenhorn

Joined: Sep 23, 2011
Posts: 1
You will have to configure your web-server accordingly. Tomcat for example provides a valve for that. See here: http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Single_Sign_On

Note: The localhost-URL you posted, only works on your computer (hence the name "local").

It would be much easier though to just add all of your modules into one Web-Application or to use one of the countless Java Web Application Frameworks.

application development company
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending the value from jsp to jsp in two different web applicaitons
 
Similar Threads
how to add dynamic value in URL from faces-config
How to get Username and Pwd from DB
Session tracking in servlets
How to get username of currently logged user on client machine
Set the value in html:select tag