• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jetty + Servlet + HttpSession: how?  RSS feed

 
PetriJ Airio
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My simple code to fire up Jetty and simple Servlet for that:



Now when HttpSession is tried to get in line:

HttpSession session = req.getSession();

I got Exception:



What do I have to do to get sessions work correctly?
Googling only finds some instructions for setups via XML conffiiguration
but none how to do it directly in code.

Thanks!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you trying to start Jetty from inside a servlet class?

Jetty is a web server - it must be running FIRST before any request is made.

What is the sequence of events you are trying to create?

Bill
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!