• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url connection using https?

 
sujit menon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

i have josso integrated web applications running on tomcat/apache web server.
i want to connect from one application java class to another servlet residing in another web application using url connection in https.
but dont know neither does it work nor does it throw any exception?
this is what i gave.

URL servletURL = new URL( connectionURL );
URLConnection servletConnection = servletURL.openConnection( );
servletConnection.setDoOutput( true );
servletConnection.setUseCaches( false );
InputStream in = servletConnection.getInputStream( );
StringBuffer response = new StringBuffer( );
int chr;

while( ( chr = in.read( ) ) != -1 ) {
response.append( ( char ) chr );
}

in.close( );
should i define it explicitely for https?
can someone help me on this?

thanks in advance
sujit
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "it does not work" mean? What do you expect to happen, and what is actually happening?
 
sujit menon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for not stating what should happen.
The problem is its not getting submitted to a servlet. URLConnection is code is there in WAR file. And the servlet resides in another war file.
Its not even going to the servlet. And not no exception ios getting thrown in the URLConnection implemented class
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should tell more about a servlet you'd like to invoke. Does it require get or post? Does it require any authentication? Did you use https based URLs?
 
sujit menon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the servlet which i need to invoke will get parameter from the request & reply back with a status.it does operation like insertion to database.it all is ok it will return success.


yes our whole application is https.i did specify authentications like truststore and password.
will it block the url connection?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic