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 bring variable from previous session to next session

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
my jsp form is like that there is table having edit and delete option in each row
so when i click on edit button
through following it take me to the servlet with the help of P_id variable which is unique in my database and it should redirect me to the jsp page

function editRecord(P_ID){

window.location.href="../edit/UserServlet?"+P_ID;
}


following is my servlet code


but it is not redirecting to the jsp page i tried to check the code but putting out.println on various places then i find that due that session it is not working because if i am passing any particular value of P_ID then it is working
here i am using following


String str = request.getQueryString();
int P_ID = Integer.parseInt(str);


as in session string can be passed but P_ID is integer type so i have to do typecasting but i think it is not taking that but this session is working in my delete code so i used in this also. i am not getting why this is not working in my edit code.

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post, essentially the same question, multiple times.
Let us continue the discussion in your original topic here https://coderanch.com/t/571694/Servlets/java/exception-while-running-code
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic