Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
pritam mukherjee
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic