A doubt about servlet and http..

S

Scorpio

Hi to all,

I've a doubt about servlet: can one submit http / https request to the SAME
servlet, or must he have one servlet for http and another for https ?

Thanx.

Scorpio.
 
S

Silvio Bierman

Scorpio said:
Hi to all,

I've a doubt about servlet: can one submit http / https request to the SAME
servlet, or must he have one servlet for http and another for https ?

Thanx.

Scorpio.

Most servlet containers allow you to use multiple listeners in combination
with a set of servlet mappings. That means that the listeners which may be
using HTTP or HTTPS are transparent to the servlets handling the requests.

Regards,

Silvio Bierman
 
S

Sudsy

Scorpio said:
Hi to all,

I've a doubt about servlet: can one submit http / https request to the SAME
servlet, or must he have one servlet for http and another for https ?

Thanx.

Scorpio.

The protocol (HTTP/HTTPS) is independent of the servlet implementation.
It's handled transparently by the webserver. The HttpServletRequest and
HttpServletResponse objects handed to your methods are the same in any
case. Then only way the servlet can tell that it was invoked via HTTPS
rather than HTTP is the isSecure() method inherited from ServletRequest.
You might want that if you ever implement a secure login.
 
S

Scorpio

Silvio and Sudsy,

thanx for your answer. I was quite sure that Servlet could manage both http
and https request, and redirect them to jsp or other servlet in a
transparent manner, but I needed confirms.

The problem I'm involved with is about redirecting from http to https and
vice-versa; in some cases, JSP pages displaying results can't be viewed from
browser while using my webapp in "secure" mode. There must be some http
server misconfiguration......

Regards,

Scorpio.
 
S

Scorpio

I've seen this before. The problem turned out to be that the session
id wasn't being received properly when switching between HTTP and
HTTPS. IIRC the solution was to upgrade from jserv to mod_jk. That
permitted the JSESSIONID attribute to be properly interpreted and
sent to Tomcat.
Perhaps if you describe your system more completely then I and
others might have some ideas for you.

Thank you for your interest.

I'm developing with IBM WebSphere 5.0.2, under Linux enviroment. To switch
from https and http, I use both javascript functions (with window.location =
url_containing_a_servletname) and forms. In the first time, I tought to be a
problem with sessions... But the strange behaviour of the application
occours even when i switch between html pages (no jsp) from https and http,
so i'm a bit confused...

What does you mean with "IIRC the solution was to upgrade from jserv to
mod_jk." ?
Do you know if there's some articles regarding this issue ?

Thanx !

Scorpio.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top