• 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

how to get data from an HTTPS request

 
Greenhorn
Posts: 22
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone,i got some trouble while getting data from an https request
my web.xml look like this......I wanna use https to send data to a servlet

and


here is my servlet:


however,when i run it,i got this in my log

all parameter values are null

can anyone one tell me what is wrong??thanks
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your web.xml really looks like this:

it is rather surprising you got anything at all. Are you trying to do this in an IDE?

All classes used in servlets should be in a package and the class files stored accordingly - the reason being that when the JVM sees a reference to a class with no explicit package, it looks in the "current directory" - something you have no control over.

Bill
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The classes should be in packages, that is right.

More accurately this a compile time thing. When the compiler is done with the code,
it puts complete class references (that is, along with the package names, even for the java.lang classes) into the class file.
The JVM does not guess the packages, the compiler does.

On the compilation level it is not possible to access a class in the default package from outside this package,
because the reference wihtout explicit package "path" will be understood by the compiler to be of the same package as the source class.

With reflection it is possible though, so it is possible for the servlet container.
 
Zeonbong Wong
Greenhorn
Posts: 22
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:If your web.xml really looks like this:

it is rather surprising you got anything at all. Are you trying to do this in an IDE?

All classes used in servlets should be in a package and the class files stored accordingly - the reason being that when the JVM sees a reference to a class with no explicit package, it looks in the "current directory" - something you have no control over.

Bill


My web.xml does look like that,and it works,except the wrong outcome
 
Zeonbong Wong
Greenhorn
Posts: 22
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ivan Jozsef Balazs wrote:

The classes should be in packages, that is right.

More accurately this a compile time thing. When the compiler is done with the code,
it puts complete class references (that is, along with the package names, even for the java.lang classes) into the class file.
The JVM does not guess the packages, the compiler does.

On the compilation level it is not possible to access a class in the default package from outside this package,
because the reference wihtout explicit package "path" will be understood by the compiler to be of the same package as the source class.

With reflection it is possible though, so it is possible for the servlet container.


but i still cant solve my problem~any ideas?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you saying this problem only occurs when you configure the servlet to use HTTPS? Or have you not tried HTTP, and you're just assuming that HTTPS must be the problem?
 
Ivan Jozsef Balazs
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What URL are calling or what form do you submit against what URL?
 
Zeonbong Wong
Greenhorn
Posts: 22
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Are you saying this problem only occurs when you configure the servlet to use HTTPS? Or have you not tried HTTP, and you're just assuming that HTTPS must be the problem?


using HTTP it works perfectly,but using HTTPS,it doesn't
 
Zeonbong Wong
Greenhorn
Posts: 22
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ivan Jozsef Balazs wrote:What URL are calling or what form do you submit against what URL?


i dont really remember is that matters??
 
Ivan Jozsef Balazs
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



If those variables are assigned null, then there was no parameters
usernameorMailbox
password
isAutoLogin

From where on Earth are they supposed to be there if not from the URL or the form?
 
Zeonbong Wong
Greenhorn
Posts: 22
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ivan Jozsef Balazs wrote:


If those variables are assigned null, then there was no parameters
usernameorMailbox
password
isAutoLogin

From where on Earth are they supposed to be there if not from the URL or the form?


the form~it is okay using http to post but isn't using https
 
reply
    Bookmark Topic Watch Topic
  • New Topic