click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Schellink (JIRA)" <>
Subject [jira] Commented: (CLK-564) Add ResourceService for serving static resources
Date Thu, 16 Jul 2009 20:08:14 GMT


Bob Schellink commented on CLK-564:

The latest version of ResourceService looks good.

I'd suggest we don't support the dynamic *.js and *.css templates in the service though. What
makes this feature awkward is its only supported for packaged non-deployed *.js and *.css.
If the resource is deployed then it doesn't work anymore. I think if dynamic *.js and *.css
is needed a better place to handle them would be through a Page using JsScript and CssStyle.

Another issue is that of caching in non-production mode. I did a small test with the examples
but forgot that /click/* was mapped for static resources. Changing the control.css on the
file system didn't result in a change on the browser. Then I remembered that the resources
was cached by ResourceService and I had to restart the server to view the change. For the
examples we might want to comment out the mapping in web.xml.

Other than that I think this is good to go.

Regarding the build time tools I'm leaning towards including this in the click-dev-tools.jar
which is already included in the distribution lib folder. I'm not that keen on adding another
source tree for this feature alone. I'd rather document the tool in GAE Javadoc and FAQ/Best
Practice. If we add fancy code generation we could expose another source tree.

> Add ResourceService for serving static resources
> ------------------------------------------------
>                 Key: CLK-564
>                 URL:
>             Project: Click
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 2.0.2
>            Reporter: Malcolm Edgar
>            Assignee: Malcolm Edgar
>             Fix For:  2.1.0 RC2
>         Attachments: report_1.html, report_2.html, report_3.html
> The Click static resource deployment strategy of writing *.htm, *.css and image files
to the web application /click/ directory does not work on all application servers. In particular
WebLogic and WebSphere have security restrictions which prevent this from occuring. In these
scenarios users are have to deploy these applications to the WAR file at build time.  Google
GAE also does not support this deployment mode.
> A solution to this problem is to use the ClickServlet to serve these resources. By adding
an additional web.xml mapping:
> 	<servlet-mapping>
> 		<servlet-name>ClickServlet</servlet-name>
> 		<url-pattern>/click/*</url-pattern>
> 	</servlet-mapping>
> The ClickServlet could use a ResourceService interface obtained from the ConfigService
which returns the resource data. A default ClickResourceService would be provided which loads
all the resources at application initialization time. This service would scan all the JAR
files for resources in META-INF/web as is currently done in XmlConfigService and would cache
them in memory. The service would also scan all the resources under the WAR /click/ directory.
These resources would override any defined in the application JAR files.
> This could be a good feature for 2.1.0, we should possibly delay the 2.1.0 RC release
to include this feature.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message