• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Use Http And Https in Same application

 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have one web application working in https: , but for dome url (i mean paths) i have to use http only ..How can I configure http and https in same application. Please give some idea to do this...

Thnaks in advance
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can change the header details of the request before it reaches the action class.

You write one class which extends RequestProcessor, the looks like below one

//First check if the connection is secure.
try{
if (request.getHeader("HTTP")==null || !request.getHeader("HTTP").equals("on")){
response.sendRedirect("HTTP"+request.getRequestURI()+"?"+request.getQueryString());
return false;
}
}
catch(Throwable t){
log("There is a Exception in the request Processor while redirecting the request",t );
return false;
}
//
return true;
}


The RequestProcessor class will be excecuted before calling the action class and change the header from HTTPS to HTTP.

I have not tested the code. But, have a try and also look for other replies.
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Saravanaprabu...

Whether we can do anything through Tomcat Configarations ?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic