• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

getting session variable from multi part request

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i am having trouble when i upload file and sending multipart request into servlet, i can not get session variable at same time. session var is definitely already setup, because i can get this session var when i am doing normal request.
this is more less code how do i get session var :


do you have any idea ? thank you.


do you have any idea?
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google for "Apache Common File Upload"
 
Wiyanto Ngasinur
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my problem is not uploading file, uploading file already fine... what i need is to get session variable during uploading file.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the problem to your above code?what error you are getting?
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please provide the following details:
1. Where are you setting up the attribute in session?
2. And what is the flow after that(how are you submitting your request etc. ?)
 
Wiyanto Ngasinur
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi let say, session var is already set on during login request... and i'm able to get this session var, all over servlet in normal request on my application, now my situation here, i need to upload file, upload file request is being sent to servlet. And there is no problem in this area. The problem comes when i upload file, i need those session var... am i making sense here ?

My question is simple, is it possible to get session var from multipart request from HttpServletRequest instance ?
 
Marshal
Posts: 67286
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is stopping you? If you aren't going to explain your issue, you can't expect much int he way of help.
 
Wiyanto Ngasinur
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear Bibeault,
does my previous explanation is not enough to explain situation here?
ok let me paste some of code :

during successful login i set session var


and this session var is being used on all page over application, and i able to get this session var on struts action i made, problem comes when i upload file using struts action that i made, i couldnt get this var. the code i use to get this session var is :



please let me know if i am missing something here ?


 
Bear Bibeault
Marshal
Posts: 67286
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
Wiyanto Ngasinur
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i thought struts action itself was actually is servlet, but thanks anyway.
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!