【问题标题】:How to get JSF composite components to work in WebView如何让 JSF 复合组件在 WebView 中工作
【发布时间】:2013-04-14 11:06:26
【问题描述】:

我有带有 Spring 和 Hibernate 的 JSF 2.1 Web 应用程序。 我需要创建该 Web 应用程序的 Android 版本。我在 WebView 的帮助下做到了。一切都好。启用 JavaScript 并浏览网页历史记录。但是,JSF 复合组件不起作用。它们在常规浏览器中运行良好。

如何使用 WebView 让 JSF 复合组件在 Android 应用程序中工作?

编辑:我在应用程序的许多地方都使用复合组件,例如我有一个组件用于查看更多“带有查看更多链接的列表项”

这是组件的代码

<!-- INTERFACE -->
<cc:interface>
    <cc:attribute name="from" required="true"/>
    <cc:attribute name="to" required="true" shortDescription="First time limit before clicking see more link"/>
    <cc:attribute name="moreSize" required="true"  shortDescription="Limit when clicking see more link"/>
    <cc:attribute name="totalCount" required="false" shortDescription="Total counts that helps is displaying see more link or not"/>

</cc:interface>

<!-- IMPLEMENTATION -->
<cc:implementation>
    <div class="SeeMore" from="#{cc.attrs.from}" to="#{cc.attrs.to}" moresize="#{cc.attrs.moreSize}" totalcount="#{cc.attrs.totalCount}"></div>
</cc:implementation>

我用过它

<core:seeMore moreSize="10" totalcount="20" from="0" to="10"/>

当我使用 android webView 查看任何具有 core:seeMore 的页面时,它根本没有列出任何内容。

【问题讨论】:

  • 请从开发者的角度而非最终用户的角度描述“不工作”。
  • 我希望我是从开发者的角度来描述的。

标签: java android jsf-2 composite-component


【解决方案1】:

经过漫长的 3 天后,我终于找到了答案。
问题是我有这个代码的所有复合组件

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

与 android webview 冲突并且不适用于 jquery 选择器...不知道为什么!!!

但是当我从复合组件中删除上述代码时。 android webview 中的 web 应用程序运行良好。

【讨论】:

    猜你喜欢
    • 2013-02-02
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 2016-04-18
    • 1970-01-01
    • 2012-04-24
    相关资源
    最近更新 更多