2023年7月29日发(作者:)
javael表达式原理_el表达式实现原理学步园jstl标签中的el在路径t下,有个叫 te 的⽅法,当el表达式作为⼊参时,调⽤这个⽅法,在tag内即可⾃动把el表达式转化。te有四个参数。第⼀个表⽰tag的名字,在取el表达式出错时使⽤。⼀般和属性名字相同。第⼆个要求字符串,通常简单调⽤输⼊对象的toString⽅法。第三个是类,通常⽤。第四个⽤this即可,第五个是pageContext变量。页⾯中的el在e包中,有⼀个类⽤来实现PageContext并且解析 class PageContextImplextends PageContextproprietaryEvaluatepublic static proprietaryEvaluate( expression, expectedType,PageContext pageContext,ProtectedFunctionMapper functionMap,boolean escape)throws ELExceptionProprietary method to evaluate EL expressions. XXX - This method should go away once the EL interpreter moves out ofJSTL and into its own project. For now, this is necessary because the standard machinery is too slow.参数:expression - The expression to be evaluatedexpectedType - The expected resulting typepageContext - The page contextfunctionMap - Maps prefix and name to Method返回:The result of the evaluation抛出:ELException例如:()etaryEvaluate("${param[/"usern/"] }",,(PageContext)_jspx_page_context, null, false)
发布者:admin,转转请注明出处:http://www.yc00.com/news/1690580344a372707.html
评论列表(0条)