当前位置: 动力学知识库 > 问答 > 编程问答 >

java - JSF 1.1 and MyFaces Tomahawk 1.1.9

问题描述:

I am trying to use the calendar component from Myfaces Tomahawk. I am running JSF 1.1 with Tomahawk 1.1.9 and Websphere 6.1.

Looks like JSF1.1 and Tomahawk 1.1.9 are not compatible as the following code does not work -

<t:inputCalendar id="secondOne" monthYearRowClass="yearMonthHeader"

weekRowClass="weekHeader" popupButtonStyleClass="standard_bold"

currentDayCellClass="currentDayCell" value="#{dobBean.dateOfBirth}"

renderAsPopup="true" popupTodayString="Shamik"

popupDateFormat="MM/dd/yyyy" popupWeekString="Wk"

helpText="MM/DD/YYYY" forceId="true" />

When access this jsp page thru IE 7, it throws some javascript problem like popupcalender not defined. I found that java scripts are added in the rendered HTML page, but no idea why this problem ?

Any idea which version of Tomahawk should I use with JSF 1.1 ?

EDIT:

I already have Extension Filter configured in the web.xml file. Something like this -

<filter>

<filter-name>MyFacesExtensionsFilter</filter-name>

<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>MyFacesExtensionsFilter</filter-name>

<!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->

<servlet-name>Faces Servlet</servlet-name>

</filter-mapping>

<filter-mapping>

<filter-name>MyFacesExtensionsFilter</filter-name>

<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>

</filter-mapping>

网友答案:

I found the solution of this problem today. This is something to do with websphere 6.1. I found the following link where people faced similar problem like I am facting. As mentioned in the above link, I added a custom propery com.ibm.ws.webcontainer.invokefilterscompatibility=true in the websphere containter by following this link.

网友答案:

Tomahawk is compatible with both JSF 1.1 and 1.2 (not with JSF 2.0 yet). The problem you're describing is recognizeable as not having the ExtensionsFilter properly configured in web.xml. Although the javadocs states that this is not needed anymore since Tomahawk 1.1.7, I would give it a try. Just define the ExtensionFilter in web.xml as per this document. It's namely responsible for injecting the necessary scripts/styles in the response.

<filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
分享给朋友:
您可能感兴趣的文章:
随机阅读: