• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing values from servlets to jsp page via request.getRequestDispatcher method

 
Vivek Kr Agrawal
Ranch Hand
Posts: 51
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to fetch a bean object from database(which is working fine) in a servlet and passing it to a jsp page. My code in servlet is as:


My read_liability_proposal.jsp page looks like



I am getting null everywhere except for Proposal Id.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64962
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Point #1: You should be using the EL in your JSP pages, not scriptlet expressions. See this JspFaq entry.

Point #2: You don't fetch scoped variables with getParameter(); you use getAttribute() -- the fact that you set them with setAttribute() should be a clue.
 
Vivek Kr Agrawal
Ranch Hand
Posts: 51
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic