Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet to Servlet Call redirecting to Login page

 
Pathikreet Dutta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a situation wherein im calling a servlet from an Applet using the HTTPUrlConnection class.
But whenever im trying to hit the servlet i can see in the Java Console that the call to the Servlet URL is automatically redirected to the login page of the application as it is secured.

Any pointers on how i can make it work?
 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what were you expecting? Not the login page? Does the desired page have special privileges (eg require login) to access?
 
Pathikreet Dutta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually my requirement is to upload some files chunk by chunk to the server side code and this shud happen in the backend. So if a user is already logged in , then the applet should be able to go into the servlet. Moreover the login page that it is redirecting to also does not pop up , i just saw it in the Java Console.
for e.g;
Networking : Connecting to "..../Servlet" with JsessionID
Netwroking : Connecting to "..../login.html"
 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try printing the jsessionid to the console or something.

Another question I have is does applet know about session?? Because they are not the same as web apps/pages.

EDIT: Did a bit of googling and found that the session ID needs to pass to the applet in order for it to "know" it has a session. Answering my own question is I guess not.

Assuming you got the session ID, how are you initializing the applet?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic