This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@RequestAttribute in spring mvc not fetch the value

 
Anand Sivathanu
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

@RequestAttribute in spring mvc not fetch the value.

I have a modelAttribute.here "foo" attribute is set a value of "bar"




I try to invoke the request attribute value for "foo" using @RequestAttribute("foo").But value is null.

Then i try using request.getAttribute("foo").value is printed. I not know what is wrong in @RequestAttribute("foo").





Please help me in this issue.

Regards,
Anand
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@RequestAttribute is not a Spring annotation, so I am not sure what you have going there. Of course it would not be hard to extend to Spring to add such an annotation using a custom WebArgumentResolver.
 
Anand Sivathanu
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In HTTP Servlet request object, "foo" is set to value "bar".

Using @RequestAttribute("foo"), I try to fetch the value.

In spring showcase tutorial,they have mentioned that we can fetch the value of foo using @RequestAttribute("foo").

But not fetch. why it is not fetching? this is my question
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic