public class ModelRecordElResolver
extends javax.el.ELResolver
Constructor and Description |
---|
ModelRecordElResolver() |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getCommonPropertyType(javax.el.ELContext context,
Object base) |
Iterator<FeatureDescriptor> |
getFeatureDescriptors(javax.el.ELContext context,
Object base) |
Class<?> |
getType(javax.el.ELContext context,
Object base,
Object property) |
Object |
getValue(javax.el.ELContext context,
Object base,
Object property) |
static void |
init() |
static void |
init(javax.servlet.ServletContext servletContext) |
boolean |
isReadOnly(javax.el.ELContext context,
Object base,
Object property) |
static void |
setResolveBeanAsModel(boolean resolveBeanAsModel)
设置为 true 时,使用生成器生成的实现了 IBean 接口的 Class 将被当成 Model 来处理,
getter 不被 jsp/jstl 用来输出数据,仍然使用 model.get(String attr) 来输出数据。
有利于在关联查询时输出无 getter 方法的字段值。建议mysql数据表中的字段采用驼峰命名,
表名仍然用下划线方式命名。 resolveBeanAsModel 默认值为 false。
注意:这里所指的 Bean 仅仅指用 BaseModelGenerator 生成的实现了 IBean接口后的类文件
|
void |
setValue(javax.el.ELContext context,
Object base,
Object property,
Object value) |
static void |
setWorking(boolean isWorking) |
public static void setResolveBeanAsModel(boolean resolveBeanAsModel)
使用方式, 在 YourJFinalConfig 中创建方法,并调用本方法: public void afterJFinalStart() { ModelRecordElResolver.setResolveBeanAsModel(true); }
public static void setWorking(boolean isWorking)
public static void init(javax.servlet.ServletContext servletContext)
public static void init()
public Object getValue(javax.el.ELContext context, Object base, Object property)
getValue
in class javax.el.ELResolver
public Class<?> getType(javax.el.ELContext context, Object base, Object property)
getType
in class javax.el.ELResolver
public void setValue(javax.el.ELContext context, Object base, Object property, Object value)
setValue
in class javax.el.ELResolver
public boolean isReadOnly(javax.el.ELContext context, Object base, Object property)
isReadOnly
in class javax.el.ELResolver
public Iterator<FeatureDescriptor> getFeatureDescriptors(javax.el.ELContext context, Object base)
getFeatureDescriptors
in class javax.el.ELResolver
Copyright © 2018. All rights reserved.