Win a copy of liveProject: Build an ML Recommender System this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

JSP accessing problem

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello i m building a web app containing Login.html,dBHelperServelt,Welcome.jsp,Questions.Jsp ,Finish.jsp

now i want to print result on finish page username and other stuff is in dBHelperServelet but i canot access it because there is no direct link between Finish.jsp and dBHelper

dBHelper is already request dispatching to welcome.jsp

so how to access my database content which is in dBHelperServelt

please note there is no direct connection between dBHelp.... and Finish.Jsp
 
Marshal
Posts: 26540
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

obaid abbassi wrote:so how to access my database content which is in dBHelperServelt



Your dbHelperServlet gets data from the database and then forwards to welcome.jsp? And then some other requests take place and finally something forwards to finish.jsp? Then it sounds like that data from the database should be put into the session. To do that, dbHelperServelt should put the data into one or more session attributes.
 
Paul Clapham
Marshal
Posts: 26540
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And, welcome to the Ranch!
 
obaid abbassi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:And, welcome to the Ranch!



---------------------------This is dBHelper-----------------------
String nam=request.getParameter("name" );
            HttpSession session=request.getSession(true);
                     //session.setAttribute("Name",nam);
 
                       session.setAttribute("Name",nam);
                  RequestDispatcher rd=request.getRequestDispatcher("Question.jsp");
               
               rd.forward(request, response);

----------------------------------------------this is finish jsp------------------------------------

  <% <br /> HttpSession sess=request.getSession(true); <br /> <br /> <br /> String R=(String)sess.getAttribute("Name"); <br /> <br /> %>
       
<h1> The value is  <%=R%>
 </h1>

   
 
   
  although i have on session in dbHelper but receiving null value still why?    
   
   


 
reply
    Bookmark Topic Watch Topic
  • New Topic