reset password
Author Message
mkhalil
Posts: 8
Posted 13:20 Nov 27, 2010 |

When I try to get the value of ${filesList.public} on the .JSP page, the page throw this Error:

HTTP Status 500 -

org.apache.jasper.JasperException: /WEB-INF/jsp/files/view.jsp(71,5) "${folderList.public == true}" contains invalid expression(s): javax.el.ELException: [public] is not a valid Java identifier
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

.....

And for the othere ifelds(${folderList.regular== true}, or ${folderList.folder == true}, ..  )  everything is ok

Any idea?
 

cysun
Posts: 2935
Posted 12:50 Nov 28, 2010 |

${file.public} is used in other JSPs (e.g. instructor/gradeSubmission.jsp) and didn't cause any problem.

mkhalil
Posts: 8
Posted 13:15 Nov 28, 2010 |

I just login as instructor > Homework1> click on any student > it's throw the same error ?

SEVERE: Servlet.service() for servlet jsp threw exception

org.apache.jasper.JasperException: /WEB-INF/jsp/instructor/gradeSubmission.jsp(86,8) "${file.public}" contains invalid expression(s): javax.el.ELException: [public] is not a valid Java identifier

at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)

at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)

.........

cysun
Posts: 2935
Posted 14:43 Nov 28, 2010 |

You may be using a different version of EL in which "public" is considered a keyword.

Just change the getter and setter in File so the property name is filePublic or something.

kknaur
Posts: 540
Posted 19:09 Nov 28, 2010 |

"When I try to get the value of ${filesList.public} on the .JSP page"

 

It looks like you are trying to call .public on a filesList which obviously can't work since filesList is what I assume to be a list of file objects correct?  if this is the case then you need to do something like filesList.item.public.  So you need to get an actual file in the list and then called the .public on it.  If you are using a the foreach JSTL tag then you set a var attribute to be something like file and then you would call filesList.file.public.  That's how I seemed to handle this type of thing in my code.  If I am wrong sorry for the confusion.

Last edited by kknaur at 19:12 Nov 28, 2010.