0

jstl core question

asked 2006-09-12 04:03:57 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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)



delete flag offensive retag edit

13 Replies

Sort by ยป oldest newest

answered 2006-09-12 06:56:17 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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}">




link publish delete flag offensive edit

answered 2006-09-14 19:38:20 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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.

link publish delete flag offensive edit

answered 2006-09-20 13:57:00 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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?

link publish delete flag offensive edit

answered 2006-09-21 01:32:36 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

link publish delete flag offensive edit

answered 2006-09-21 02:56:16 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

link publish delete flag offensive edit

answered 2006-09-21 12:54:51 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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>


link publish delete flag offensive edit

answered 2006-09-21 17:24:19 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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.

link publish delete flag offensive edit

answered 2006-09-22 03:18:05 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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.

link publish delete flag offensive edit

answered 2006-09-26 20:47:18 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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>

link publish delete flag offensive edit

answered 2006-09-26 21:14:58 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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...

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-09-12 04:03:57 +0800

Seen: 289 times

Last updated: Sep 28 '06

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