• Post Reply Bookmark Topic Watch Topic
  • New Topic

EL is not working  RSS feed

 
misha nesterenko
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello



after execution I get in output ${cmd} but not its contents, how to solve this?
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a useBean element to define "cmd" as the name of an actual Java object.
 
Nikhil Pasupukuntla
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try including isELIgnored= "false" in the page directive.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <jsp:useBean> is not necessary if the scoped variable cmd has already been established on the request by a controller. Is that the case?

Actually, if you are seeing ${cmd}, including the delimiters, on the browser, it more likely means that the EL is not enabled, probably due to a misconfiguration of your application. See the JSP FAQ for information on properly configuring you web application.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nikhil pasupukuntla wrote:Try including isELIgnored= "false" in the page directive.

No, that's a band-aid. The real fix is to configure the web app correctly eliminating the need for goop on all the pages.
 
misha nesterenko
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this variable goes from spring model, which scope is it in jsp page?

actually isELIgnored="false" helped, but how can configure application to avoid including this attribute
 
Nikhil Pasupukuntla
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to set the <el-ignored> tag in DD to configure for the entire application.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
misha nesterenko wrote:actually isELIgnored="false" helped, but how can configure application to avoid including this attribute

Yeah, but you don't want to put that on every page.

The most likely culprit is your deployment descriptor. Is it defined using the Servlet 2.3 DTD? If so, that will disable the EL!

See the JSP FAQ for the proper way to set up the web.xml.
 
misha nesterenko
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you, proper xmlns helped
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!