Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6209283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:57:28+00:00 2026-05-24T05:57:28+00:00

I am new to JSP and Java Servlet. I am quite confusing about Session

  • 0

I am new to JSP and Java Servlet. I am quite confusing about Session object. I saw session When I learned PHP session and cookie. Are there complete different things? And how a Session object is created, structured and used. This object is in JSP or Java Servlet? could somebody tell me this by words(like concept). In addition, in what situation a JSP page would be appropriate for?(when should I use a Java Servlet and when should I use a Java Servlet Page).For Java Servlet object, for example, ran an email site. There will be a lot of users. How does one Java Servlet object deal with interactions from so many browsers?(like hundreds of logging, reading, etc.)I know there should be only one copy of Java Servlet object exists. But why? If only one there, when is it created and destroyed. Ah… So many questions. If someone can help me I will really grateful for this. Thanks a million!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:57:28+00:00Added an answer on May 24, 2026 at 5:57 am
    1. You can think about a session object as a file . every user have a session with id called jsessionid , the structure of a session is normally a map data structure which store key value

    in Servlert you can construct a session object like this

    HttpSession session = request.getSession(true);
    

    then you can add item to the session like this

    session.setAttribute(string ,object); ex : session.setAttribute("username","foo");
    

    the session object exist in servlet and jsp , and btw jsp eventually is a servlet
    but the difference is that when u want to use session in a jsp page there is no need to construct it. its defeind by default just use it

    session.setAttribute(string,object);
    
    1. JSP page used when a page contains a lot of html element and have a lot of design
      and jsp let you maintain the page easily on the other hand you can use servlet as jsp page
      but you will deal with every line o html source code

    JSP is preferred as a view in the MVC model
    and the servlet as controller .

    the server keeps one object for each servlet and when a new request come the servlet object put the new request (client ) in a new thread so if you have 100 client at a time the is
    100 thread in server . but you can configure the server to construct more than one object of a servlet .

    i hope i could help u ..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to deploy a new version of a Java application (JSP/Servlet) deployed
How do you remove a cookie in a Java servlet? I tried this: http://www.jguru.com/faq/view.jsp?EID=42225
I have done Java and JSP programming in the past, but I am new
Hi guys : I've used JSP/Servlet frameworks pretty broadly, generally picking up Java EE
I understand how to access Session attributes using EL in my JSP/Servlet application: <p>
I am very new in jquery and json.i know jsp and java in my
I am new to JSP and generating a form with a text area. Is
i am new in JSP,i have some problem with the following code : <%@
So I am pretty new to JSP. I have tried this a few ways.
I try to create a new file inside a JSP and try to save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.