File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes jspx file not working with foreach Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jspx file not working with foreach" Watch "jspx file not working with foreach" New topic

jspx file not working with foreach

Klament J. Kruoghst
Ranch Hand

Joined: Oct 24, 2008
Posts: 37
Hi, I've been working with jspx all day and everything worked fine until I used the foreach. So I copied a simple example online to make sure it worked and it isn't. The code is OK because I runned it in another server and it worked fine, mine doesn't display the values in the iteration, it is just blank.

Here's the code:

This is what I see in the source code:

I just wanted you to notice that the values are empty, nothing is displayed inside the <LI> as it's supposed to. What should I change to make in my computer? I'm using Apache 5.5 and its runtime. (I have java 1.6 but I believe the project is running with apache's JRE)
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Why are you using the jspx JSP document format? That format is intended as an intermediary format for containers and for JSPs that are auto-generated by software by serializing a DOM. It is not intended for hand-coding. The markup requirements are just too stringent and you spend more time fighting the markup than in getting things done. And then, the final product is so wordy that the meaning of the JSP is lost in the markup.

I strongly suggest just using the JSP page format as it is intended.

[Asking smart questions] [About Bear] [Books by Bear]
Klament J. Kruoghst
Ranch Hand

Joined: Oct 24, 2008
Posts: 37
Thanks for your response.
I had to move on so i did it in JSP (and obviously works) but I still need to make it work on jspx because that's the one we're using so I'm not allowed and... well, all I want is to make it work independent of the reason, but thanks for the comment.

I'm just stumped as to why it doesn't work on my and it does on the other. Plus I'd learn more about compatibility issues.
I agree. Here's the link:
subject: jspx file not working with foreach
It's not a secret anymore!