• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using setAttibute for send parameters to the servlet  RSS feed

 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Im coding like this:



And the I try to send the "from" value to my controller like this:



When I press the link and chech the HTML generated it looks like this:



It is not getting the value of the request which I suppose is been set at the setAttribute line of code.


Any idea?

Regards,
Isaac
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mixing scriptlets with JSTL and EL is a big mess. I suggest against it.

That said, what's up with <c:out value="${request.getAttribute('from')}"/>?

Any reason it's not just <c:out value="${from}"/>?

Or, if the string is trusted, just ${from}?

Why are you still using scriptlets in a page that's enabled for JSTL and EL?
 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now it works fine, when using this:



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But really, ditch the scriptlets. (Unless that was just for testing? In which case, <c:set> would be a better choice.)
 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oki, yes I will do it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!