aspose file tools*
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
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: 61206
    
  66

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: 12783
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request attribute set in the jsp cannot be retrieved in the servlet