File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • 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
  • 0
  • 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: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks...
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic