EL expression can not get boolean type variable values

Today, debugging programs,

There is a boolean variable named isAdmin the type acquired in jsp page is empty,

This is simply not to get variable does not exist or the situation, ah, but obviously in Action is the assignment to false.

 

Internet search a bit, some students have encountered such a problem, a good solution to this, get a look at the method code isAdmin,

Name is isAdmin, into getIsAdmin enough. The reason we know everything.

 

This problem occurs because the MyEclipse automatically generates get and set methods when the variable XXX,

If the type of the variable is boolean, then the name of the method is to get isXXX,

If the variable named isXXX, then the same names and variable names get method is also isXXX.

example:

Entity class

jsp page

 

Guess you like

Origin www.cnblogs.com/wanlipenghtml/p/11246310.html