0

I would like to do be like this:

<c:forEach items="#{myService.getServiceById(${item.edit_id})}" var="item">

${item.edit_id}) part of the myService.getServiceById() should be GET param called edit_id. I want to pass it.

It's not working for me.. I've tried in numerous ways and by adding params in other fields (like hidden inputs), no luck. I need to grab that edit_id param from url and pass it to loop. Any solutions?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
DarioBB
  • 663
  • 2
  • 8
  • 29
  • http://stackoverflow.com/a/7775203/3803447 – Geinmachi Sep 24 '15 at 20:52
  • Geinmachi, thnx for link. But now, how to write c:forEach or ui:repeat with it? – DarioBB Sep 24 '15 at 20:54
  • You seem to have got stuck with a wrong approach. The EL syntax is also technically incorrect. EL things (`#{}` and `${}`) cannot be nested. There are several ways in which query string parameters can be passed to a managed bean such as by using `` depending upon the functional requirements. – Tiny Sep 24 '15 at 20:56
  • So how to write it if they cannot be nested.. ? – DarioBB Sep 24 '15 at 20:58
  • Just don't nest them at all. You should see `#{...}` as one big scope where various variables can interact with each other. – BalusC Sep 24 '15 at 21:29
  • Balus C, but I managed to nest them and now it works (I used @ManagedProperty("#{param.parameter}") from link). Look: #{myService.getServiceById(item.id)} How would you make it any other way? Is this bad approach? It works now. – DarioBB Sep 24 '15 at 21:46

0 Answers0