• 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 getSession in simple java class?

 
Ranch Hand
Posts: 214
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

i have a code in jsp in which i am setting a value in session and wanna get it in a simple java class...


I used this but its not showing

request object...

please give me another solution...

Thanks
 
Ranch Hand
Posts: 227
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Usually, it is not this easy to get a hold of web-container objects (like request, response, session etc.) in POJOs. Still, it would help if you could provide more details like:

1. Which MVC framework are you using, if any?
2. What is the flow of request? How is the POJO (simple Java class) gets invoked?
3. Does the information that you're trying to pass from JSP to POJO have to be in Session scope, or can it be in Request scope too?

Cheers!
 
Rd Dari
Ranch Hand
Posts: 214
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Aditya,

I want to send a mail to a vendor(vendors) using a button request (ORDER) when I click this button a window will open in which a checkbox,vendor name input type,services and email_address fetching from the database and I check a checkbox or all button for all checkbox list and its submit button will send the request on a servlet in which i am fecthing all the fields from the request.getParameter in this servlet i am using a simple java class.... like this and want to set value in this mail table which will show in the mail i send header of the table but in the table i want to send value according to runtime user....











this is all the pages..............
 
Aditya Jha
Ranch Hand
Posts: 227
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be I'm missing something here... why can't you pass userid as a parameter to the method in the simple class (mail.MailToVendor() I suppose), just like you're passing vendor name, email address etc.?
 
reply
    Bookmark Topic Watch Topic
  • New Topic