You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "Andrey Rybin (JIRA)" <ji...@apache.org> on 2010/02/05 16:39:28 UTC

[jira] Commented: (CLK-622) Spring support is incomplete: Page mapping and auto mapping works not as expected

    [ https://issues.apache.org/jira/browse/CLK-622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830139#action_12830139 ] 

Andrey Rybin commented on CLK-622:
----------------------------------

All information, that I used, is here:
http://click.apache.org/docs/extras-api/org/apache/click/extras/spring/SpringClickServlet.html

Hard to translate...
If to speak formally - It is new feature.
If from the point of view of right Spring usage is an error.

Spring is used to decouple interface, implementation and usage.
Spring beans can be written in script languages without Java classes at all. 

So requirement to have them (classes) is wrong.


> Spring support is incomplete: Page mapping and auto mapping works not as expected
> ---------------------------------------------------------------------------------
>
>                 Key: CLK-622
>                 URL: https://issues.apache.org/jira/browse/CLK-622
>             Project: Click
>          Issue Type: Bug
>            Reporter: Andrey Rybin
>
> Example:
> webroot:
>   /my-page.htm or /MyPage.htm, etc
> click.xml
>   <pages package="some.path"  autobinding="annotation" />
> spring.xml
> <bean id="myPage" class="other.package.CoolPage" name="MyPage, some.path.MyPage, please.be.happy" />
> This should work, generally speaking. 
> Because Click actually has all parts it needs: htm and code.
> But, It doesn't work!
> XmlConfigService knows nothing about Spring, so it want some.path.MyPage.class!
> If we put this fake "public class MyPage extends Page {}" in "some.path" package - it will work as expected.
> Click will map MyPage.htm to some.pathMyPage.class , then it will load myPage or some.pathMyPage bean and "other.package.CoolPage" class will be used!
> Actually I can write Spring bean in scripting language and not to have classes at all!
> My suggestion: SpringClickServlet should try not only class name received from ConfigService, but also htm-to-correct bean-name (myPage) and webpath-to-correct bean-name (for page /foo_a/bar/my-page.htm it can be fooA_bar_MyPage -- note _ vs . because . can't be used in bean id).
> PS: because . can't be used in Spring bean (any XML tag?) id,
> may be you should change class-to-bean name conversion in SpringClickServlet too.

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