permaculture playing cards
The moose likes Servlets and the fly likes Web client to obtain data from 2 servers [newbie question] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Web client to obtain data from 2 servers [newbie question]" Watch "Web client to obtain data from 2 servers [newbie question]" New topic

Web client to obtain data from 2 servers [newbie question]

c orange

Joined: Jan 27, 2009
Posts: 10
Please let me know if this is the wrong category to put this.

I am attempting to create a web application(using jsp, servlets, maybe javabeans too) that
can connect to 2 different servers hosted externally.

question 1: should i do this(as i just tried it) <form action="" method="post">
<input type="text" name="username"> , <input type="text" name="password"> in my GoToSite.jsp file.
should i place these 3 strings in a file?

basically should the jsp "deal" with the connecting, and handling of the response object. or should that really be a role?

question 2: Server A specifically indicates to provide those 2 parameters and call their loginServlet. but with the response object returned, either to the JSP or the Servlet file(whichever i ultimately choose), how would i dismantle the returned object to get specific info? a direct connect/startup of the app on Server A provides many dropdown lists that users can choose. Server A app also does not provide any APIs, so not sure how to call methods thru the Server A app to get info required. No permissions granted to connect to database hosting Server's data either.

question 3: application on Server B can only be accessed if i'm on VPN. is it possible to establish a connection using jsp,servlet,beans technology in java for my app?

in view of these, is this an impossible or over-the-top(OTT) application to get created?
if not OTT, how long would it take to create this bearing in mind, i'm VERY new to this.

any comments/suggestions is most appreciated!

thank you!
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33107

Even if you were experienced this would be a problem.

#3 strikes me as a showstopper. You aren't going to able to access something behind a (VPN) firewall. You'll need to talk to the server people about a way to open it up. Or more likely to export the data someplace where it can be accessed.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
c orange

Joined: Jan 27, 2009
Posts: 10

thanks for the comments.

so aside from ths vpn issue(assuming i can get past that),
do you think the web app(all other aspects of it) is really quite a task(more than 3months?)
for a novice to create?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
I suggest looking at the HttpClient toolkit - open source java from the Apache commons project.

Here is a place to start.

I agree. Here's the link:
subject: Web client to obtain data from 2 servers [newbie question]
jQuery in Action, 3rd edition