为什么不能覆盖jspService()? [英] Why can't jspService() be overridden?

查看:386
本文介绍了为什么不能覆盖jspService()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不能覆盖 jspService()方法,其中 jspInit() jspDestroy()可以被覆盖吗?

Why can't the jspService() method be overridden, where as jspInit() and jspDestroy() can be overridden?

推荐答案

这个论坛帖子解释了为什么你不能覆盖jspService()。

This forum post explains why you cannot override jspService().

基本上,如果你试图覆盖jspService方法,那么JSP编译器生成的代码最终会得到两个方法副本:你编写的那个副本和编译器创建的副本。这将导致Java编译错误。

Basically, if you tried to override the jspService method, the code generated by the JSP compiler would end up with two copies of the method: the one you wrote and the one created by the compiler. This would result in a Java compilation error.

这篇关于为什么不能覆盖jspService()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆