Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Posts: 65764
130
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
Boost this thread!