wood burning stoves*
The moose likes Servlets and the fly likes passing values from servlets to jsp page via request.getRequestDispatcher method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "passing values from servlets to jsp page via request.getRequestDispatcher method" Watch "passing values from servlets to jsp page via request.getRequestDispatcher method" New topic
Author

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

Vivek Kr Agrawal
Ranch Hand

Joined: Sep 08, 2012
Posts: 51

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.


Vivek Agrawal
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vivek Kr Agrawal
Ranch Hand

Joined: Sep 08, 2012
Posts: 51


Thanks...
 
Don't get me started about those stupid light bulbs.
 
subject: passing values from servlets to jsp page via request.getRequestDispatcher method