javax.el.PropertyNotFoundException

-·2020년 10월 31일
0

javax.el.PropertyNotFoundException

  1. JSTL변수명, 칼럼명에 오타가 없는지
  2. JSTL CORE태그를 쓸때 공백은 없는지 ex) item=" {example}"
  3. 참조되는 클래스앞에 public으로 썻는지

요론 어이없는실수는 지나치기가 쉽다.

첫문자를 소문자로?

1번에서 첫문자가 대문자일 경우 소문자로 안바꾸고 그대로 대문자로 쓰면 에러가 나는 경우가 있고

검색에서도 강의에서도 소문자로 써야된다고 말은하는데 그냥 말만하고 지나가서 찾아봤더니

JavaBeans API specification 문서에 보면

8.8 Capitalization of inferred names.

When we use design patterns to infer a property or event name, we need to decide what rules to follow for capitalizing the inferred name. If we extract the name from the middle of a normal mixedCase style Java name then the name will, by default, begin with a capital letter.

Java programmers are accustomed to having normal identifiers start with lower case letters. Vigorous reviewer input has convinced us that we should follow this same conventional rule for property and event names.

Thus when we extract a property or event name from the middle of an existing Java name, we normally convert the first character to lower case. However to support the occasional use of all upper-case names, we check if the first two characters of the name are both upper case and if so leave it alone. So for example,

  • “FooBah” becomes “fooBah”
  • “Z” becomes “z”
  • “URL” becomes “URL”

We provide a method Introspector.decapitalize which implements this conversion rule.

java개발자들이 평소에 첫문자로 소문자를 많이 쓰니까 거기에 맞춰서 알아서 바꿔주는걸로 되어있는듯 하다.

예시의 규칙처럼 첫대문자는 소문자로 바꿔주지만 처음에 대문자가 연속으로 2개이상 있으면 그대로 적용이 되는듯 하다.

profile
거북이는 오늘도 걷는다

0개의 댓글