public class ScriptTemplateView extends AbstractUrlBasedView
AbstractUrlBasedView
サブクラス。 設定されていない場合、Web アプリケーションコンテキストで単一の ScriptTemplateConfig
Bean を検索し、それを使用して構成されたプロパティを取得することにより、各プロパティが自動検出されます。
Nashorn JavaScript エンジンは Java 8+ を必要とし、適切に実行するために sharedEngine
プロパティを false
に設定する必要がある場合があります。詳細については、ScriptTemplateConfigurer.setSharedEngine(Boolean)
を参照してください。
ScriptTemplateConfigurer
, ScriptTemplateViewResolver
logger, REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME
BINDING_CONTEXT_ATTRIBUTE
コンストラクターと説明 |
---|
ScriptTemplateView() Bean として使用するコンストラクター。 |
ScriptTemplateView(StringSE url) 指定された URL で新しい ScriptTemplateView を作成します。 |
afterPropertiesSet, getUrl, setUrl, toString
createRequestContext, formatViewName, getApplicationContext, getBeanName, getDefaultCharset, getModelAttributes, getRequestContextAttribute, getRequestDataValueProcessor, getSupportedMediaTypes, obtainApplicationContext, render, resolveAsyncAttributes, resolveAsyncAttributes, setBeanName, setDefaultCharset, setRequestContextAttribute, setSupportedMediaTypes
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
isRedirectView
public ScriptTemplateView()
public ScriptTemplateView(StringSE url)
public void setEngine(ScriptEngineSE engine)
ScriptTemplateConfigurer.setEngine(ScriptEngine)
のドキュメントを参照してください。public void setEngineName(StringSE engineName)
ScriptTemplateConfigurer.setEngineName(String)
のドキュメントを参照してください。public void setSharedEngine(BooleanSE sharedEngine)
ScriptTemplateConfigurer.setSharedEngine(Boolean)
のドキュメントを参照してください。public void setScripts(StringSE... scripts)
ScriptTemplateConfigurer.setScripts(String...)
のドキュメントを参照してください。public void setRenderObject(StringSE renderObject)
ScriptTemplateConfigurer.setRenderObject(String)
のドキュメントを参照してください。public void setRenderFunction(StringSE functionName)
ScriptTemplateConfigurer.setRenderFunction(String)
のドキュメントを参照してください。public void setResourceLoaderPath(StringSE resourceLoaderPath)
ScriptTemplateConfigurer.setResourceLoaderPath(String)
のドキュメントを参照してください。public void setApplicationContext(@Nullable ApplicationContext context)
ApplicationContextAware
通常の Bean プロパティの設定後、ただし InitializingBean.afterPropertiesSet()
またはカスタム init メソッドなどの init コールバックの前に呼び出されます。ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
、ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
および MessageSourceAware
の後に呼び出されます(該当する場合)。
ApplicationContextAware
の setApplicationContext
AbstractView
の setApplicationContext
context
- このオブジェクトによって使用される ApplicationContext オブジェクト BeanInitializationException
protected ScriptEngineSE getEngine()
protected ScriptEngineSE createEngineFromName(StringSE engineName)
protected void loadScripts(ScriptEngineSE engine)
protected ScriptTemplateConfig autodetectViewConfig() throws BeansException
public boolean checkResourceExists(LocaleSE locale) throws ExceptionSE
AbstractUrlBasedView
AbstractUrlBasedView
の checkResourceExists
locale
- 探している希望のロケール false
、存在しないことがわかっている場合は false
ExceptionSE
- リソースは存在するが無効である場合 (たとえば解析できませんでした)protected reactor.core.publisher.Mono<VoidSE> renderInternal(MapSE<StringSE,ObjectSE> model, @Nullable MediaType contentType, ServerWebExchange exchange)
AbstractView
AbstractView
の renderInternal
model
- 静的な属性よりも動的な値が優先される、結合された出力マップ(非 null
)contentType
- レンダリングするために選択されたコンテンツ型。supported media types
のいずれかと一致する必要があります。exchange
- 現在の交換 @return Mono
は、レンダリングが成功した場合と成功した場合を表します protected StringSE getTemplate(StringSE path) throws IOExceptionSE