*
The moose likes JSP and the fly likes request attribute set in the jsp cannot be retrieved in the servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "request attribute set in the jsp cannot be retrieved in the servlet" Watch "request attribute set in the jsp cannot be retrieved in the servlet" New topic
Author

request attribute set in the jsp cannot be retrieved in the servlet

pritam mukherjee
Greenhorn

Joined: May 25, 2010
Posts: 3
For a POC purpose i was trying to set an attribute in the request and application scope in a JSP page. The JSP code is:-


When i submit the JSP in the respective Servlet i get the request attribute as null but the context attribute is retrieved properly.
The servlet code is :-


Please let me know why the request attribute is coming as null in the servlet while the context attribute is coming properly.
Thanks in advance.


Regards,
Pritam
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Welcome to the ranch.

Please edit your post to remove the unreadable blue code and replace it to UseCodeTags. If people cannot read your code, how can they help you?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12755
    
    5
When i submit the JSP in the respective Servlet


What does that mean exactly?

You do realize that a request object only has the lifetime of a single request, right?

Bill
 
jQuery in Action, 2nd edition
 
subject: request attribute set in the jsp cannot be retrieved in the servlet
 
Similar Threads
Remove duplicates in arraylist
sending a Collection from JSP to Servlet
Eliminating Duplicate in Arraylist and moving the dups to another arraylist.
Show HashMap in Datatable. UIColumn with embedded Datatable. Help Needed
Using of nested Datatables