This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
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

Android form not working properly

 
Peter Dolinsky
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i´m using 3 jsp pages to retrieve personal info of registered members: checklogin.jsp, this file is verifying, whether someone is registered, select.jsp, this file contains the select query and GSON.jsp, this file contains gson object with results from the previously mentioned select query. The login and password is sent from android application...My problem is that the output shows everywhere null.
This part of code (checklogin.jsp) records data from login form. (the username is stored to session)


This part of code is selecting info of this logged member and stores this info to sessions(select.jsp)


This part is displaying the info(gson.jsp):


This gson.jsp is showing null everywhere. I dont know where is the problem, because when i tried to login from jsp form(not from android), the gson.jsp shows me the info of logged person.

Can you help me?
Thanks.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sessions are usually tracked by cookies, does the Android device have cookies turned off? Are you properly encoding the URL to account for this (ref: http://docs.oracle.com/javaee/6/tutorial/doc/bnagm.html)?
 
Peter Dolinsky
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the NetBeans project settings, but the output is same. Cookies..i´m connecting through application, not through browser. How can i delete cookies in application?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what NetBeans has to do with it: probably nothing. If you are using app code to connect to the server then you need to handle Cookies yourself. Android has the Apache HTTP Client built in which will make Handling the cookies and requests easier. You should read the documents on http://hc.apache.org/httpclient-3.x/ to learn how to use it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic