0

How to include a jsp, jsf,.. compenent using Executions.creatCompenent

asked 2009-03-30 18:41:07 +0800

zker gravatar image zker
39

i tried to use Executions.creatCompenent to include a jsp compenent that containt some taglib but dont work.

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2009-03-31 00:38:10 +0800

PeterKuo gravatar image PeterKuo
481 2

Please post your sample code.

Also, please refer to:
Use of ZK JSP Tags
http://docs.zkoss.org/wiki/Integrate_with_JSF%2C_JSP_and_Others

link publish delete flag offensive edit

answered 2009-03-31 10:15:10 +0800

zker gravatar image zker
39

updated 2009-03-31 10:15:38 +0800

1st page:

<zscript>
Executions.createComponents("test.jsp", null, null)
</zscript>
2nd page test.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Absences</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</head>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://www.zkoss.org/jsf/zul" prefix="z"%>

<body>
<f:view>
<z:page>
<h:outputText value="test"/>

</z:page>
</f:view>
</body>
</html>

link publish delete flag offensive edit

answered 2009-04-01 11:22:24 +0800

PeterKuo gravatar image PeterKuo
481 2

Please refer to
http://www.zkoss.org/javadoc/3.6.0/zk/org/zkoss/zk/ui/Executions.html
http://www.zkoss.org/javadoc/3.6.0/zk/org/zkoss/zk/ui/metainfo/PageDefinition.html

A page definition. It represents a ZUL page.

You may post feature request.

link publish delete flag offensive edit

answered 2009-04-01 21:30:34 +0800

zker gravatar image zker
39

public static final Component createComponents(java.lang.String uri,
Component parent,
java.util.Map arg)
it doesnt specify a language, so how i cant use jsp page ?

link publish delete flag offensive edit

answered 2009-04-02 01:00:58 +0800

PeterKuo gravatar image PeterKuo
481 2

You can't use Executions.creatCompenent to include a jsp,
but you can use <include>
Please refer to:

http://docs.zkoss.org/wiki/Developer_reference_The_XUL_Components_Components_Include

link publish delete flag offensive edit

answered 2009-04-02 09:44:10 +0800

zker gravatar image zker
39

i know this, but not working in jsf page
code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Absences</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</head>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://www.zkoss.org/jsf/zul" prefix="z"%>
<body>
<f:view>
<z:page>
<z:window id="win">
</z:window>
<z:zscript>
Include i = new Include();
i.setSrc("test.jsf");
i.setParent(win);

</z:zscript>

</z:page>
</f:view>

</body>
</html>

link publish delete flag offensive edit

answered 2009-04-02 09:55:12 +0800

zker gravatar image zker
39

updated 2009-04-02 09:59:49 +0800

i can use it work good
<z:zscript>

Executions.createComponentsDirectly("<include src=\"test.zul\"/>", "zul", null, null);
</z:zscript>

but
<z:zscript>

Executions.createComponentsDirectly("<include src=\"test.jsf\"/>", "zul", null, null);
</z:zscript>

does not work java.lang.NullPointerException

link publish delete flag offensive edit

answered 2009-04-03 01:25:19 +0800

PeterKuo gravatar image PeterKuo
481 2

Sorry, but it's about tangling lifecycle of zk and jsf.
You may post it a feature request.

Executions.createComponentsDirectly("<include src=\"test.zul\"/>", "zul", null, null); should work,

Executions.createComponentsDirectly("<include src=\"test.jsp\"/>", "zul", null, null); may work,

Executions.createComponentsDirectly("<include src=\"test.jsf\"/>", "zul", null, null); may not work,

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-03-30 18:41:07 +0800

Seen: 886 times

Last updated: Apr 03 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More