This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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


Win a copy of Building Microservices this week in the Design forum!
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: 63227
    
  69

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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing values from servlets to jsp page via request.getRequestDispatcher method
 
It's not a secret anymore!