Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request object from http to https

 
sreeni san
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a form generated by servlet1 (by calling http://servlet/servlet1) and on submitting this form another servlet, servlet2 is called through "https" protocol. In the servlet2, the request object is found to be null disabling me to collect parameters passed from the servlet1 form.

Please help me solve this problem.

Thanks

Sreeni
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sreeni san:
In the servlet2, the request object is found to be null [...]
This looks really unlikely. Can you give more, or more precise, information?

- Peter
 
Tommy Greenberg
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure your setup is correct. There is a lot more the "HTTPS" then writting it in a URL. You can handle "HTTPS" many different ways. You can do it in your code, web.xml, and/or web server or servlet engine.

If your SSL and HTTPS are setup correctly make sure that your calling servlet is using the same protocol as your request handling servlet.

Meaning

Servlet1 -[HTTPS]-> HTML FORM1 -[HTTPS]-> Servlet2

Not

Servlet1 -[HTTP]-> HTML FORM1 -[HTTPS]-> Servlet2

This is because https and http use different ports, so if you switch the ports in mid request, you'll have servlet1 writting to a different port than the one servlet2 is reading from.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic