| | |
Getting session
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2007
Posts: 59
Reputation:
Solved Threads: 3
Hello,
How can I get a reference to a session? I have a page, which forms a query string, and in another page I would like to display the attributes of it. I don't want to introduce scriplets, so I am trying to do this in a pure Java file, where request is not an implicit-object. When I was using Struts, I was able to get that reference by HttpSession session = ServletActionContext.getRequest().getSession(); Can I do something similar without Struts? I tried to google it, but nothing helpful.
Thanks in advance.
How can I get a reference to a session? I have a page, which forms a query string, and in another page I would like to display the attributes of it. I don't want to introduce scriplets, so I am trying to do this in a pure Java file, where request is not an implicit-object. When I was using Struts, I was able to get that reference by HttpSession session = ServletActionContext.getRequest().getSession(); Can I do something similar without Struts? I tried to google it, but nothing helpful.
Thanks in advance.
You don't need `session' to display the request parameters; just use
BTW, you can get a reference to the `session' using the
request.getParameter("parameterName") inside your servlets' doGet / doPost and you should be good to go.BTW, you can get a reference to the `session' using the
HttpServletRequest ; read the API docs. I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Similar Threads
- Session end (PHP)
- Session variable (ASP.NET)
- session variable:again (ASP.NET)
- how can i used session and cookies ??? (PHP)
- How to maintain session for Web Services Object? (VB.NET)
Other Threads in the Java Forum
- Previous Thread: need help
- Next Thread: How to implement while and loop
Views: 848 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code color compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool keyword linux list loop map method methods mobile netbeans newbie number object oracle pong print problem producer program programming project projectideas read recursion reflection rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows






