Questions tagged [httpsession]

An Java interface used by the servlet container to create a session between an HTTP client and an HTTP server.

An Java interface used by the servlet container to create a session between an HTTP client and an HTTP server. The session object has an expiration time which allows the container to invalidate the session after that specified time of the user inactivity. It is active while the user making requests, across more than one connection or page and remains active after the user exit application and stay active until it's expired. The server persists the session object for the user between restarts. While it's valid the session interface allows the application to bind objects to it and access then from different requests of the same user. A session usually corresponds to one user, who may visit a site many times. The server can maintain a session in many ways such as using cookies or rewriting URLs.

Details from the API docs:

Tutorials:

655 questions
0
votes
1 answer

Getting HttpSession attribute set by first app throws ClassCastException in second app

I have two different applications running on the same server. First application sets an object to an HttpSession. When I get this object from second application it throws ClassCastException. The class is defined in a jar file and both the…
0
votes
1 answer

Closeable objects associated with HttpSession

I can't find any way to destroy Closeable objects associated with HttpSession properly. It would be nice to have some event or callback invoked while session is invalidating. Wonder why I need it? I have connection associated with session, and it is…
shameleo
  • 344
  • 2
  • 13
0
votes
1 answer

How to get username from JSP and to put it into http session for using it in SQL queries

I need to take a username from my JSP page when user authenticated, and put it into Http Session, and after that putting this username into SQL query to get user's info! Here is my login.JSP page <%@taglib…
Serg Shapoval
  • 707
  • 1
  • 11
  • 39
0
votes
2 answers

Servlets: issue with storing/printing specific attributes using HttpSession, array

I am still new to servlets and JDBC stuff and would like some help on the following code: try{ String selectSQL = "select * from product_list where category = '"+category+"'"; Statement stmt = conn.createStatement(); …
Jeff Halo
  • 3
  • 3
0
votes
2 answers

Servlet HttpSession cookies disabled

In a web app, when user logs in, a HttpSession is created using HttpSession s = request.getSession(true); This creates a cookie with jsessionid on the browser. But if cookies are disabled on browser, How can i proceed with login?
0
votes
0 answers

How can I hide signup/ signin(login) link/button after user login.I am using httpSession

I would like to check if session not equals to null,then some button or link will be hidden.Or any other better way to do that? This is my controller : @RequestMapping(value = "/signin", method = RequestMethod.GET) public Object signIn(HttpSession…
Ah Hiang
  • 592
  • 6
  • 13
0
votes
0 answers

Custom SessionID for HttpSession in Spring

I would like to know if it is possible to tell the Session which ID it should carry. Googleling around made me feel like it is not. Is that true? Thank you
Jan Kressin
  • 115
  • 1
  • 9
0
votes
1 answer

Resetting Database when Testuser signs on in JSF Application

my Problem involves the following toolchain: javaee 7 application on a glassfish application Server. JSF with Primefaces as GUI Libraries. Selenium as GUI Testsuite. Core Problem is, that i want to reset the Database (postgres/jpa/eclipselink) to…
AlexEnde
  • 1
  • 4
0
votes
0 answers

How to keep session alive on Android by using HttpURLConnection?

In my android app user enters username and password and i check the response after i sent them to server . If the result is positive i am changing the activity and sending different requests. But server responds me as "You have to log in." despite i…
E. ANDAC
  • 51
  • 1
  • 5
0
votes
1 answer

How to properly logout other users

In my web app I am trying to achieve the functionality, that an admin is able to logout other currently logged in users. What I have done so far: I created a POJO to store significant user information, including a referrence to the users HTTP…
stg
  • 2,757
  • 2
  • 28
  • 55
0
votes
1 answer

Is it necessary to make tag entry in web.xml even after adding @WebListener annotation to my listener class?

Is it necessary to make listener-class tag entry in web.xml even after adding @WebListener annotation to my listener class? Because when I use just @WebListener annotation without making listener-class tag entry in web.xml, my listener class does…
owgitt
  • 313
  • 5
  • 22
0
votes
1 answer

Why setting HttpSession is giving me a blank page?

Here's the part of the code: if (results.get(0).equals(username) && results.get(1).equals(password)) { HttpSession session = request.getSession(false); if(session != null) { session.setAttribute("lg_username", results.get(2)); } …
Ericson Willians
  • 7,606
  • 11
  • 63
  • 114
0
votes
2 answers

Handling HTTP session timeout and redirect in Eclipse RAP application

I am working on an Eclipse RAP application (RCP as web application). After the servlet container has invalidated the HttpSession (session timeout, setMaxInactiveInterval exceeded) the following exception is thrown when clicking on the application in…
StaticNoiseLog
  • 1,370
  • 17
  • 27
0
votes
0 answers

access HTTPSession with javaagent

Is there a way to access session attributes while instrumenting called methods with a javaagent written in javassist? I'm trying with spring web doing the following code in the agent: ServletRequestAttributes attr = (ServletRequestAttributes)…
user1335838
  • 121
  • 1
  • 11
0
votes
1 answer

Data loss/not working of JSP page when browser refreshed

I have created a JSP page, everything is working fine but whenever I refresh the browser I get a message saying //served at somejsp.jsp I have tried using session attributes in servlets as explained on the internet but no results, any…
Danish Ali
  • 137
  • 7
  • 20