Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

assign expression language value to a string  RSS feed

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to assign the retrieved EL value to a string , but it doesnot worked.



please help me with correct code.


 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tushar,

Can you please try below code.



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EL was meant to replace scriptlets in a JSP, not work in conjunction.

You should choose to either use scriptlets, or to use the EL. Using both is just a mess.
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You should choose to either use scriptlets, or to use the EL. Using both is just a mess.


Dear sir ,
i know its a mess but i require it for comparision , as newbie to EL , don't know how to compare using EL.
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ ujjwal soni

tried your code and got the error below :


is anything required to be changed in web.xml ??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tushar panda wrote:i know its a mess but i require it for comparision

Hogwash. Scriptlets aren't required to do anything with the EL. If are trying to learn the EL, learn it right. That means no scriptlets.

So what are you really trying to do?
 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea, check your web.xml for below entries ?

If they dont exist or they differ, put those in.



Also, which tld ru using, is it c.tld or some other one for core libs, of its other then put that name in.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ujjwal soni wrote:If they dont exist or they differ, put those in.

NO!
Do not add that to your web.xml. Never take the TLDs out of the jar file. Simply put the jstl jar file (or files) in WEB-INF/lib.

Do not, I repeat do not, extract the tld files, nor put any delcarations like this in your web.xml. It's unnecessary and just leads to other problems.

Also, which tld ru using

ujjwal soni, Please use real words when posting to the forums. Abbreviations such as "ru" in place of "are you" only serve to make your posts more difficult to read. Please read this for more information.
 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Well i meant by the lines in web.xml not with the tlds.

I will take care from next time that correct words are being used..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ujjwal soni wrote:Well i meant by the lines in web.xml not with the tlds.

That's what I was talking about. The JSTL should not be declared in the web.xml. Nor should the c.tld file be removed from the jar file and placed anywhere within the web app.

The TLD files are already in the JSTL jar files and the container will find them there.
 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, got your point....Thanks....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!