开发者

about BEAN LAW in jsp

I wanna know What is Bean law in JSP part as bean can not have constructor with arguments.When declaring bean object in java no-arg cons开发者_如何学Ctructor of the bean will run.


The JavaBeans specification is at (PDF) this location.

The mechanisms for instantiating JavaBeans from JSP don't have any provision for creating beans other than by instantiating using the default constructor. The idea is for these beans to be essentially data transfer objects or containers; any information they contain needs to be put into them using the beans' setters.

You may want to look at JSP Expression language, which allows you to do some "cool" things in your Web page using embedded variables. It's neater and more functional than scriptlets used to be.

Complete specs for JSP and EL are here: http://jcp.org/aboutJava/communityprocess/mrel/jsr245/index.html


This is not true - a Java Bean is required to have a no-argument constructor, but it's allowed to have constructors with arguments as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜