0

UrlRewriteFilter and ZK upload

asked 2012-07-21 15:04:14 +0800

RichardL gravatar image RichardL
768 4

updated 2012-07-21 15:22:50 +0800

In my ZK project, I am using UrlRewriteFilter for friendly urls. The problem is that the upload button won't work, producing an error message in a dialog: "The server is temporarily out of service."

If I take the following out of my web.xml, the upload button works as expected.

<filter>
		<filter-name>UrlRewriteFilter</filter-name>
		<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
	</filter>
 	<filter-mapping>
 		<filter-name>UrlRewriteFilter</filter-name>
 		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
 	</filter-mapping>

UrlRewriteFilter is very powerful and easy to use and I would much rather use it than reimplementing everything using Richlets (by the way, this isn't related to ZK bookmarks). For example, in my urlrewrite.xml, I can have:

<rule>
<note>connect/username/cat</note>
<from>^/connect/(*[-]*)/(+)$</from>
<to>/index.zul?bun=$1&cat=$2</to>
</rule>

Any ideas on how to use upload with UrlRewriteFilter?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-07-24 07:59:15 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

Hi Richard,

The 'upload' action will do POST repeatedly until upload finished, the POST link is ~/zkau/upload,
maybe it is match some rule and is rewritten?
You can check it by Firebug or Chrome's developer tools.

Regards,
Ben

link publish delete flag offensive edit

answered 2012-07-25 02:21:08 +0800

RichardL gravatar image RichardL
768 4

Yes, that's it. I had previously commented out the rules from urlrewrite.xml to test this, but I must have missed some. Thanks for your help.

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: 2012-07-21 15:04:14 +0800

Seen: 180 times

Last updated: Jul 25 '12

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