开发者

JSF/HTML - Add a Java applet to web page programmatically

开发者 https://www.devze.com 2022-12-29 00:04 出处:网络
Theres a web page I\'m making which content is very dynamic and so I\'m building it from inside the backing bean.

Theres a web page I'm making which content is very dynamic and so I'm building it from inside the backing bean.

I would like to add a Java applet to the web page but I could not find the JSF component type to correspond to the <applet> tag.

So My questions are -

  1. What is the JSF com开发者_JAVA百科ponent type for an applet?
  2. How did you find it? (For similar future searches)

Thanks!

P.S - Just to be clear. An example: <h:PanelGroup> would be HtmlPanelGroup as a java object.


Couple of things to start with; The <applet> tag is deprecated in favour of <object>, and JSF doesn't really provide a tag to render <object>. That said you can use f:verbatim if you're at tag level, which I believe corresponds to UIOutput.

JSF doesn't guarantee a Java object representation of all client side tags (nor should it). What you're trying to do is move all markup knowledge into the backing bean, and truthfully, that way lies madness.

I'd suggest that you take a look at Facelets, a compositing technology that sites on top of JSF. It lends itself very well to flexible page production and keeps markup and page composition out of your backing beans and in X/HTML files. Facelet's has also been embraced for JSF 2.0.


There appears to be a ready-to-use component for that.

Alternatively, you can write your custom component that will output the <object> tag. It's relatively easy.

0

精彩评论

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