0

How to use "include" instruction injsp+zk?

asked 2006-11-22 03:00:15 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4024557

By: xiancaro

Hi all,
I have integered zk component in jsp page successfully.but if I use <jsp:include page="head.jsp"/> , it shows :

org.zkoss.zk.ui.UiException: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

The same error happened to <%@include file="head.jsp"%>

How can i use "include" instruction in jsp+zk.

In my web.xml, I have added all element required.

Thankx in advance.

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2006-11-22 15:37:15 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4025368

By: tomyeh

So, you got two JSP pages, and the first page includes the second one (head.js), right? Or, you want to include a JSP page from a ZUML page?

It will be clear if you post some psuedo codes to illustrate your use.

Remember if you encountered any problem, try to disable zkFilter first, and save the generated HTML pages (from jsp). Then, rename it to whatever.zhtml and load it thru zkLoader.

link publish delete flag offensive edit

answered 2006-11-24 08:37:48 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4028217

By: xiancaro

Yes, I got two JSP pages,the first page include the second one

i soloved it by writting both two pages code in one page ,a stupid way.

Thankx

link publish delete flag offensive edit

answered 2006-11-24 10:17:15 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4028318

By: tomyeh

How did you map zkFilter (filter-mapping)? Did you map it to INCLUDE? If so, the included JSP page will be interpreted twice.

link publish delete flag offensive edit

answered 2006-12-01 16:25:28 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4039757

By: c_armeanu

Hi,

I also have issues attempting to make use of the zkFilter. Adding the filter configuration to my web.xml results in a long list of exceptions at tomcat start-up before any page requests. Any help is highly appreciated!

Chris


<filter>
<filter-name>zkFilter</filter-name>
<filter-class>org.zkoss.zk.ui.http.DHtmlLayoutFilter</filter-class>
<init-param>
<param-name>extension</param-name>
<param-value>html</param-value> <!-- Use XHTML components as default. -->
</init-param>
</filter>

<filter-mapping>
<filter-name>zkFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>

Exceptions:

INFO: Server startup in 2594 ms

Nov 30, 2006 4:18:28 PM org.zkoss.idom.input.SAXHandler fatalError:738

SEVERE: The processing instruction target matching "[xX][mM][lL]" is not allowed.[line 8 col 7]

16:18:28,092 ERROR [jsp]:253 - Servlet.service() for servlet jsp threw exception

org.zkoss.zk.ui.UiException: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.zkoss.lang.Classes.newInstance(Classes.java:79)
at org.zkoss.lang.Exceptions.wrap(Exceptions.java:162)
at org.zkoss.zk.ui.UiException$Aide.wrap(UiException.java:46)
at org.zkoss.zk.ui.metainfo.PageDefinitions.getPageDefinitionDirectly(Page
Definitions.java:94)
at org.zkoss.zk.ui.metainfo.PageDefinitions.getPageDefinitionDirectly(Page
Definitions.java:69)
at org.zkoss.zk.ui.impl.AbstractUiFactory.getPageDefinitionDirectly(Abstra
ctUiFactory.java:93)
at org.zkoss.zk.ui.http.DHtmlLayoutFilter.process(DHtmlLayoutFilter.java:8
5)
at org.zkoss.zk.ui.http.DHtmlLayoutFilter.doFilter(DHtmlLayoutFilter.java:
105)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
ationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terChain.java:173)
at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter
.java:181)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
ationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
ve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
ve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
a:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
a:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:8
69)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.pro
cessConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoin
t.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollo
werWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo
l.java:684)
at java.lang.Thread.run(Unknown Source) Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.scanPIData(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown
Source)
at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch
(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.zkoss.idom.input.SAXBuilder.build(SAXBuilder.java:338)
at org.zkoss.zk.ui.metainfo.Parser.parse(Parser.java:142)
at org.zkoss.zk.ui.metainfo.PageDefinitions.getPageDefinitionDirectly(Page
Definitions.java:90)
... 21 more
Nov 30, 2006 4:18:30 PM org.zkoss.idom.input.SAXHandler fatalError:738
SEVERE: The processing instruction target matching "[xX][mM][lL]" is not allowed.[line 8 col 7]
16:18:30,732 ERROR [jsp]:253 - Servlet.service() for servlet jsp threw exception
org.zkoss.zk.ui.UiException: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.zkoss.lang.Classes.newInstance(Classes.java:79)
at org.zkoss.lang.Exceptions.wrap(Exceptions.java:162)
at org.zkoss.zk.ui.UiException$Aide.wrap(UiException.java:46)
at org.zkoss.zk.ui.metainfo.PageDefinitions.getPageDefinitionDirectly(Page
Definitions.java:94)
at org.zkoss.zk.ui.metainfo.PageDefinitions.getPageDefinitionDirectly(Page
Definitions.java:69)
at org.zkoss.zk.ui.impl.AbstractUiFactory.getPageDefinitionDirectly(Abstra
ctUiFactory.java:93)
at org.zkoss.zk.ui.http.DHtmlLayoutFilter.process(DHtmlLayoutFilter.java:8
5)
at org.zkoss.zk.ui.http.DHtmlLayoutFilter.doFilter(DHtmlLayoutFilter.java:
105)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
ationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terChain.java:173)
at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter
.java:181)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
ationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
ve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
ve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
a:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
a:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:8
69)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.pro
cessConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoin
t.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollo
werWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo
l.java:684)
at java.lang.Thread.run(Unknown Source) Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.scanPIData(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown
Source)
at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch
(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.zkoss.idom.input.SAXBuilder.build(SAXBuilder.java:338)
at org.zkoss.zk.ui.metainfo.Parser.parse(Parser.java:142)
at org.zkoss.zk.ui.metainfo.PageDefinitions.getPageDefinitionDirectly(Page
Definitions.java:90)
... 21 more



link publish delete flag offensive edit

answered 2006-12-02 03:56:03 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4040341

By: henrichen

No blank line or space is allowed before the <?xml ....?>

It must be the first line.

/henri

link publish delete flag offensive edit

answered 2006-12-04 22:54:27 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4043508

By: c_armeanu

Never mind. I forgot to add the xml header to EVERY jsp fragment file.

But thanks!!! The only thing at this time would be a display tag / extremeTable like control, and more importantly the huge performance penalty for using the zkFilter.

Where is all this time lost? There's a minimum 2-3 second penalty per page load for using the filter. Interestingly, it is the same for every page load!?!, not just the initial load as it usually is with jsp pages.

Chris


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: 2006-11-22 03:00:15 +0800

Seen: 278 times

Last updated: Dec 04 '06

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