473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

What is the use of session attribute in the project?

in my project we used the following code in many pages and i did not understand the use of this
Expand|Select|Wrap|Line Numbers
  1. HttpServletRequest request = (HttpServletRequest) FacesContext
  2.                 .getCurrentInstance().getExternalContext().getRequest();
  3.         String path = request.getContextPath();
  4.         String basePath = request.getScheme() + "://" + request.getServerName()
  5.                 + ":" + request.getServerPort() + path;
  6.         this.basePath = basePath;
  7.  
  8.         HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
  9.                 .getExternalContext().getSession(false);
  10.         SessionVO sessionBean = ((SessionVO) session.getAttribute("sessionDto"));
  11.         this.commentVO.setCurUserId(sessionBean.getUserId());
Jan 28 '11 #1
0 1151

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jcs79 | last post by:
I want to use session attributes to save info on a user who wants to navigate my site. When the user logs in I use: HttpSession sess = request.getSession(true); sess.setAttribute("customer",...
2
by: Hugh McLaughlin | last post by:
Hello everyone and thanks for your help in advance. I am working on an application to track visitors to my website. However, I am confused as to what data to capture for the session, specifically...
3
by: LUIS FAJARDO | last post by:
I want to create a new Windows Project with .NET using C# as the primary language. The purpose of this project is to build some kind of "process application" that doesn't have UI (User...
6
by: academic | last post by:
I want to compile a simple c program. Not c++ Not even Windows. Just a simple program to run in a DOS window. In vs2005 what type of project to I use. I can't get started. I tried a couple...
2
by: Bob | last post by:
Hi, I have a Windows app project that generates some data. This data now has to be sent to a web server as a request and hopefully it will get a response. The request / response format has been...
11
by: David Thielen | last post by:
Hi; Is there some kind of session ID variable that I can get in the code behind and that is available in Session_OnEnd() to know what session ended? -- thanks - dave...
2
by: Cylix | last post by:
I am going to write a BHO project for my company using, I got an c# example for the startup, but I don't know what kind for project should I choose in VB.NET. C# example:...
8
by: psbasha | last post by:
I saw some of the Books ,they are referring to attributes.Correct me if my understanding is correct about the attributes. In classes we have data variables and methods.So clubbing together they...
1
by: djksac | last post by:
I need some help. I am taking Bsc Business Computing. As I have to do my dissertation/project for the final year, and i have to do something related to IT and Business.. such as a e-commerce...
2
by: mhb22079 | last post by:
Hello: I am new to JAVA and the creation of JSP pages but I believe I have correctly coded what would be needed for a user to log into a page and go to another page to and still know that they...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.