0

Cannot specify a url pattern for zkLoader servlet

asked 2010-04-06 03:35:41 +0800

phaneesh gravatar image phaneesh
9 1

I am trying to specify a new url pattern for the zkLoader servlet in web.xml. The new extension I am specifying is *.sml. When i access the file I am getting a org.zkoss.zk.ui.metainfo.DefinitionNotFoundException: Language not found for extension sml exception. I tried a couple of more extensions but the I got the same error. I tried this in ZK Project (ZK Studio). I have a grails project with zkgrails plugin installed and when I specify a different url patern other than zul I get a unsupported compression method in browser. Please let me know how to specify a different url pattern other than zul.

Here is my url pattern matching in web.xml

<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.sml</url-pattern>
</servlet-mapping>

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2010-04-06 13:20:06 +0800

phaneesh gravatar image phaneesh
9 1

I give up. I cannot find any solution to this problem. I even tried the default .zhtml extension in the grails project and get the same dreadful content encoding error because of invalid/unknown compression. Tried disabling the compression, but keep getting the same error. I am using grails 1.2.0 and zkgrails 1.0-M2. I have spent close to 3 days trying to figure it out and I am beating round the bush. Looks like I am the only one facing this issue. I have tried creating a simple project and and put in a index.zhtml file. I get the same content encoding error on firefox (3.6.3) and a blank page in IE. Please tell me what I am doing wrong here and why I am getting this issue. This is very important for me as I am evaluating the feasibility of using ZK with grails.

link publish delete flag offensive edit

answered 2010-04-06 20:03:28 +0800

samchuang gravatar image samchuang
4084 4

updated 2010-04-06 20:03:51 +0800

Hi

could you post all your web.xml and zk.xml code ?? and which zk version do you use ??

do you face this problem with ZK and grails integration ? how about only zk ? do you still have this problem ?

link publish delete flag offensive edit

answered 2010-04-06 20:48:52 +0800

phaneesh gravatar image phaneesh
9 1

I am facing this issue with both zk grails integration and with just zk. I am using ZK 5.0.1.
Here is my zk.xml:

<?xml version="1.0" encoding="UTF-8"?>
<zk>
    <listener>
        <description>ThreadLocal Synchronization Listener</description>
        <listener-class>org.zkoss.zkplus.util.ThreadLocalListener</listener-class>
    </listener>
    <zscript-config>
        <language-name>GroovyGrails</language-name>
        <interpreter-class>
            org.zkoss.zkgrails.scripting.GroovyGrailsInterpreter
        </interpreter-class>
    </zscript-config>
    <preference>
            <name>ThreadLocal</name>
            <value>
                org.springframework.transaction.support.TransactionSynchronizationManager=resources,
                synchronizations,currentTransactionName,currentTransactionReadOnly,actualTransactionActive;
                org.springframework.orm.hibernate3.SessionFactoryUtils=deferredCloseHolder;
                org.springframework.transaction.interceptor.TransactionAspectSupport=transactionInfoHolder;
                org.springframework.web.context.request.RequestContextHolder=requestAttributesHolder,inheritableRequestAttributesHolder;
            </value>
    </preference>
</zk>

Here is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
         xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>/test-app</display-name>


    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>

    <context-param>
        <param-name>webAppRootKey</param-name>
        <param-value>banner-development-0.1</param-value>
    </context-param>

    <filter>
        <filter-name>sitemesh</filter-name>
        <filter-class>org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter</filter-class>
    </filter>

    <filter>
        <filter-name>charEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetBeanName</param-name>
            <param-value>characterEncodingFilter</param-value>
        </init-param>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>charEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>sitemesh</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.codehaus.groovy.grails.web.util.Log4jConfigListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
    </listener>

    <!-- Grails dispatcher servlet -->
    <servlet>
        <servlet-name>grails</servlet-name>
        <servlet-class>org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- The Groovy Server Pages servlet -->
    <servlet>
        <servlet-name>gsp</servlet-name>
        <servlet-class>org.codehaus.groovy.grails.web.pages.GroovyPagesServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>gsp</servlet-name>
        <url-pattern>*.gsp</url-pattern>
    </servlet-mapping>


    <servlet-mapping>
        <servlet-name>zkLoader</servlet-name>
        <url-pattern>*.sml</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <!--
        The order of the welcome pages is important.  JBoss deployment will
        break if index.gsp is first in the list.
        -->
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.gsp</welcome-file>
		<welcome-file>index.sml</welcome-file>
    </welcome-file-list>

    <jsp-config>
        <taglib>
            <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
            <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
            <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://www.springframework.org/tags</taglib-uri>
            <taglib-location>/WEB-INF/tld/spring.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://grails.codehaus.org/tags</taglib-uri>
            <taglib-location>/WEB-INF/tld/grails.tld</taglib-location>
        </taglib>
    </jsp-config>

</web-app>

link publish delete flag offensive edit

answered 2010-04-11 19:56:24 +0800

samchuang gravatar image samchuang
4084 4

Hi

from your description, you need to dispatch the url pattern (*.sml) , right ? maybe you need to setting the richlet, not servlet-mapping, refer to here

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: 2010-04-06 03:35:41 +0800

Seen: 1,104 times

Last updated: Apr 11 '10

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