Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing parameters between 2 web applications

 
James bosplhf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm using Wesphere Application Server 7 and have 2 web applications.
The first application is calling the second and needs to pass some variables to it.
How should I do it ?

** Sending the session is impossible.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "calling" mean, exactly? Http?
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use JNDI, or alternatively a database if you have on available.
Edit: oh is missed the 'calling' bit, nevermind.
 
James bosplhf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, calling an http url of the second app.
 
James bosplhf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jelle Klap wrote:You could use JNDI, or alternatively a database if you have on available.
Edit: oh is missed the 'calling' bit, nevermind.


DB - I prefer not to use DB .
JNDI - can you be more specific ?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could pass it along as an URL parameter.
 
James bosplhf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But it's not secure, isn't it?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many aspects to security - in which way would you consider an HTTP call that happens entirely on a single machine (in other words, no chance of network snooping) to be insecure? Or are these two web apps not running on the same machine?

You could always make the call over HTTPS, and make the call a POST instead of a GET.
 
kri shan
Ranch Hand
Posts: 1462
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP Session might work between two application.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... except that James ruled that out in his post.
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the http url do? Are you linking to a page in the other application or invoking a method and getting back a result? Should the call be authenticated and authorized?
I would suggest using an integration solution like REST?
 
Prasad Krishnegowda
Ranch Hand
Posts: 667
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kri shan wrote:HTTP Session might work between two application.

No, It doesn't work.

@OP: You can try to use JMS also..
 
Sourabh Bawage
Ranch Hand
Posts: 33
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
url rewriting might be helpful....

for example...

htto://localhost:8080/jsp2.jsp?name=tom&roll=231

and you can use
request.getParameter("tom");
to get the value....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64701
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sourabh Bawage wrote:url rewriting might be helpful....

There is no "rewriting" to this. Just placing a query stirng onto the URL.

request.getParameter("tom");

Not quite. You pass the name of the parameter, not the value, which is what you are trying to obtain.
 
Sourabh Bawage
Ranch Hand
Posts: 33
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

request.getParameter("tom");

Not quite. You pass the name of the parameter, not the value, which is what you are trying to obtain.

ya....i know...wrote it by mistake....
Thanks....
 
Sourabh Bawage
Ranch Hand
Posts: 33
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Sourabh Bawage wrote:url rewriting might be helpful....

There is no "rewriting" to this. Just placing a query stirng onto the URL.



can you please explain how url rewriting is different from "Just placing a query stirng onto the URL"??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64701
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
Sourabh Bawage
Ranch Hand
Posts: 33
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.studytonight.com/servlet/url-rewriting-for-session-management.php

i just wanted to confirm this article about URL rewriting is not correct....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64701
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The article is fine and talks about re-rewriting the URL to add the session info when cookies cannot be used. It has nothing at all to do with this topic that we are discussing here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic