Generates the _jspInit() method for instantiating the tag handler pools. For tag file, _jspInit has to be invoked manually, and the ServletConfig object explicitly passed. In JSP 2.1, we also instantiate an ExpressionFactory
()
| 459 | * In JSP 2.1, we also instantiate an ExpressionFactory |
| 460 | */ |
| 461 | private void generateInit() { |
| 462 | |
| 463 | if (ctxt.isTagFile()) { |
| 464 | out.printil("private void _jspInit(jakarta.servlet.ServletConfig config) {"); |
| 465 | } else { |
| 466 | out.printil("public void _jspInit() {"); |
| 467 | } |
| 468 | |
| 469 | out.pushIndent(); |
| 470 | if (isPoolingEnabled) { |
| 471 | for (String tagHandlerPoolName : tagHandlerPoolNames) { |
| 472 | out.printin(tagHandlerPoolName); |
| 473 | out.print(" = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool("); |
| 474 | if (ctxt.isTagFile()) { |
| 475 | out.print("config"); |
| 476 | } else { |
| 477 | out.print("getServletConfig()"); |
| 478 | } |
| 479 | out.println(");"); |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | // Tag files can't (easily) use lazy init for these so initialise them |
| 484 | // here. |
| 485 | if (ctxt.isTagFile()) { |
| 486 | out.printin(ctxt.getOptions().getVariableForExpressionFactory()); |
| 487 | out.println(" = _jspxFactory.getJspApplicationContext(config.getServletContext()).getExpressionFactory();"); |
| 488 | out.printin(ctxt.getOptions().getVariableForInstanceManager()); |
| 489 | out.println(" = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(config);"); |
| 490 | } |
| 491 | |
| 492 | out.popIndent(); |
| 493 | out.printil("}"); |
| 494 | out.println(); |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * Generates the _jspDestroy() method which is responsible for calling the release() method on every tag handler in |
no test coverage detected