-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3910125
By: cpwrsilver
I'm trying to integrate ZK into my existing JSPs, but am having some problems.
One major problem I'm having is with the jstl/core taglib as shown in the following example.
I'd really appreciate any suggestions. I'm sure this is a user error on my part, but I'm not able to find it.
Thanks!
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<c:choose>
<c:when test="${empty _message}">
</c:when>
</c:choose>
</html>
The error is:
org.apache.jasper.JasperException: /zkWeb/alturaTemplate.jsp(5,0) According to TLD or attribute directive in tag file, attribute test does not accept any expressions org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper
.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.potix.zk.ui.http.DHtmlLayoutFilter.doFilter(DHtmlLayoutFilter.java:109)
root cause
org.apache.jasper.JasperException: /zkWeb/alturaTemplate.jsp(5,0) According to TLD or attribute directive in tag file, attribute test does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validato
r.java:955)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:730)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.potix.zk.ui.http.DHtmlLayoutFilter.doFilter(DHtmlLayoutFilter.java:109)
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3910227
By: henrichen
The error is because of this line. It says test attribute does not accept expression (the ${}).
<c:when test="${empty _message}">
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3914536
By: cpwrsilver
I'm very confused, since the jstl I have is working on thousands of pages in hundreds of applications. The error only comes up with I'm trying to link in ZK.
Another common use that is getting the same error is:
<c:forEach var="opportunityAt" items="${opportunityBeanCollection}">
I'm anxious to hear if anyone has any suggestions for me on how to resolve this issue.
Thanks.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3924422
By: nobody
just a wild guess. Can the system get confused of the jsp core.tld and the ZK core.tld?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3925348
By: henrichen
I have post this to bug list so we can track it. Please follow this link:
https://sourceforge.net/tracker/index.php?func=detail&aid=1562585&group_id=15276
2&atid=785191
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3925417
By: tomyeh
Hi Graig,
I tested your codes but it works fine. I wonder how you configure it?
zkFilter postprocessed whatever generated by JSP. In other words, you can try (if encounter similar error):
1. Remove filter-mapping from web.xml and see whether your JSP works correctly.
2. If it works correctly, save the output (with browser's View Source) as, say, test.zhtml.
3. Then, copy test.zhtml to web server and browse to the page. You will see the result rendered by ZK.
zkFilter just do the above steps automatically. So you might notice all your c:xxx will be tranlated in step 1. In other words, they are invisible to ZK.
tom / zk
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3926060
By: cpwrsilver
Tom,
I did as you suggested - removed the zkFilter so the JSP rendered without an error, but the window displayed as HTML instead of as a window (as expected without the filter).
I saved that page, naming it test.zhtml, and pointed IE to that page, and the window displayed as expected.
Is it possible that the zkFilter is running before the JSP finished rendering?
My web.xml looks like this:
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>corp.cpwr.zk.application.presentation.filters.SetCharacterEnco
dingFilterZkWeb</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Additional filters and filter-mappings here --> <listener>
<description>Used to cleanup when a session is destroyed</description>
<display-name>ZK Session Cleaner</display-name>
<listener-class>com.potix.zk.ui.http.HttpSessionListener</listener-class>
</listener>
<filter>
<filter-name>zkFilter</filter-name>
<filter-class>com.potix.zk.ui.http.DHtmlLayoutFilter</filter-class>
<init-param>
<param-name>extension</param-name>
<param-value>html</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>zkFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3926502
By: nobody
have you considered using Tiles to assemble a page where most of the tiles in the page are JSP but one of them is a .zul file? If you go to http://www.zkoss.org/
> Documentation > How-Tos > 3.2 Struts + Tiles + JSP (+Spring)
which is the new url for zk1.sourceforge.net then it gives an different approach where you dont have to run zkFilter. instead you zkLoader to render the zul and let Tiles drop the resulting code into your containing jsp page.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3927398
By: cpwrsilver
Unfortunitly I can't change the layout of the pages. Plus I'm trying to replace individual HTML objects (text fields, etc.) with ZK objects. Thanks for the suggestion.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3933302
By: cpwrsilver
I'm trying to come at this from another direction.
Comparing the web/core.dsp.tld file supplied with ZK to the standard c.tld, I see that many options are missing, such as the variable definitions. Just adding them doesn't seem to work.
For testing purposes, I'm workign with just the ZKDEMO environment, I'd like to modify the test/test.jsp file to use some very basic test jstl. I can't get that to work. Can someone tell me the steps necessary to modify the test.jsp file to include this jstl:
<c:forEach var="i" begin="5" end="15" step="1">
<c:out value="${i}" />
<br />
</c:forEach>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3933335
By: cpwrsilver
Figures - right after my last post I thought of something else to try, and it worked. So I'm now able to get a simple jstl working in the ZKDemo environment.
Now to test in a production system...
Asked: 2006-09-12 04:03:57 +0800
Seen: 289 times
Last updated: Sep 28 '06