Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Escaping quotes in my jstl

 
Cedric Bosch
Ranch Hand
Posts: 99
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going crazy with this. What's wrong ? I'm trying to send parameters in a link so I can get this parameter (an id) and get all the forum-threads that are relatives to this parameter. Because I can't set attributes in a link. Or can I ?




\ does not work but I read it's not used in html. I'm really lost on this one.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you need the c:out element there, do you? It would be much simpler if you just left it out.

If you do need it because you are escaping XML then declare the c:url outside it.
 
Cedric Bosch
Ranch Hand
Posts: 99
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:I don't think you need the c:out element there, do you? It would be much simpler if you just left it out.

If you do need it because you are escaping XML then declare the c:url outside it.


Actually I do for some reason. I asked on some forums why but didn't really get an answer. If I don't put the c:out tag all i'll get is literrally the EL expression on my page. So for example if I put ${ count} and <c:out value="$count"/> (count = 7). Then i'll have on my web page : ${ count} in the first one and 7 in the second one. So my EL expressions are not considered unless they are in a JSTL tag. ?? weird and annoying.
Your techniques work tho:



this seems to be working. By any mean if you know why my EL expressions don't work tell me.

Thanks anyway.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think maybe multi-line string literals aren't allowed in HTML, so you could try putting it all in one long line.

And it sounds like you are using an old version of JSTL. I haven't had to use c:out for about five years now.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need c:out to get the EL interpreted, your web app is configure badly.

If $(3+4} on the page doesn't display 7, don't do a single thing until it does. Otherwise, you are just fighting against bad config.
 
Cedric Bosch
Ranch Hand
Posts: 99
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:If you need c:out to get the EL interpreted, your web app is configure badly.

If $(3+4} on the page doesn't display 7, don't do a single thing until it does. Otherwise, you are just fighting against bad config.


Thansk !! I was using JBoss 7 And I think it was using a bad library or something. I upgraded to wildfly now and it works. My teacher told to use jboss for some reason.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All servers will support the EL if properly configured.
 
You don't like waffles? Well, do you like this tiny ad?
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!