You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by AMIR-TAHMASSEB Marc Kamran <ma...@ombudsman.europa.eu> on 2011/03/01 13:35:11 UTC

RE: Tomahawk components' javascript are undefined

Dear Richard and Omid,

Finaly the only (an easiest) solution I found to my problem, was : NOT using those tomahawk component.
I replaced them by some jquery component and it works well now.

Thanks for your help
Marc

>-----Original Message-----
>From: Richard Yee [mailto:richard.k.yee@gmail.com] 
>Sent: 13 February 2011 15:38
>To: MyFaces Discussion
>Subject: Re: Tomahawk components' javascript are undefined
>
>See http://www.oracle.com/technetwork/java/filters-137243.html
>
>You should do a chain.doFilter instead of a forward at the end 
>of your method. Your filter isn't letting the other filters 
>process the request.
>
>Richard
>
>Sent from my iPhone
>
>On Feb 12, 2011, at 11:34 PM, omid p <ve...@gmail.com> wrote:
>
>> Hi,
>> Can you not use
>> <url-pattern>/faces/*</url-pattern>
>> instead of
>> <url-pattern>*.faces</url-pattern>
>> maybe you corrupt tomahawk filter servlet by changing URL, just a 
>> guess do you use any other javascript library like jQuery or 
>sth else ?
>> 
>> On Thu, Feb 10, 2011 at 7:02 PM, AMIR-TAHMASSEB Marc Kamran < 
>> marc.amir-tahmasseb@ombudsman.europa.eu> wrote:
>> 
>>> Dear all,
>>> 
>>> I have some of my Tomahawk component encounter problems to 
>be displayed.
>>> 
>>> More specificaly, components such as
>>> - t:inputFileUpload,
>>> - t:swapImage
>>> - t:popup
>>> - t:inputDate
>>> generate the following javascript error :
>>> Error: xxx_3AtoolsPopupPopup is undefined
>>> Error: SI_MM_swapImage is not defined
>>> Error: SI_MM_swapImgRestore is not defined
>>> Error: orgApacheMyfacesPopup is not defined and so on....
>>> 
>>> Everything worked well until I added a new filter to my 
>application :
>>> 
>>> My web.xml :
>>> <filter>
>>>  <filter-name>localLanguageFilter</filter-name>
>>>  
>>> 
><filter-class>ec.ep.eo.eoweb.filter.LocalLanguageFilter</filter-class
>>> >
>>> </filter>
>>> 
>>> <filter-mapping>
>>>  <filter-name>localLanguageFilter</filter-name>
>>>  <url-pattern>*.faces</url-pattern>
>>> </filter-mapping>
>>> 
>>> 
>>> This filter, parse the url and try to localize the language code at 
>>> the begining of it. Then it set the application local 
>languge to this 
>>> lanaguage and finaly redirect to the appropriate âge.
>>> Here is the code :
>>> public void doFilter(ServletRequest servletRequest, ServletResponse 
>>> servletResponse, FilterChain filterChain) throws IOException, 
>>> ServletException {  HttpServletRequest request = 
>(HttpServletRequest) 
>>> servletRequest;  HttpServletResponse response = 
>(HttpServletResponse) 
>>> servletResponse;  boolean redirect = false;  String currentURL = 
>>> formatURL(request.getServletPath());
>>>  String originalUri = request.getRequestURI();  String uri = 
>>> originalUri;  String contextPath = request.getContextPath();  if 
>>> (uri.startsWith(contextPath)) {
>>>   uri = uri.substring(contextPath.length());
>>>  }
>>>  String[] parts = uri.split(Constants.PATTERN_SLASH);
>>> 
>>>  if (parts.length>0 && parts[1].length()==2) {
>>>   String languageCode=parts[1];
>>>   uri = uri.substring(3);
>>> 
>>>   ILanguage language =
>>> getServices().findLanguageByBusinessKey(languageCode);
>>> 
>>>   if (language==null) {
>>>    language=Constants.ENGLISH;
>>>   }
>>> 
>>>   request.getSession().setAttribute(Constants.SYSTEM_LANGUAGE, 
>>> language);
>>> 
>>>  }
>>>  RequestDispatcher requestDispatcher = 
>>> request.getRequestDispatcher(uri);
>>>  requestDispatcher.forward(request, response); } As i 
>specified, if I 
>>> remove the filter, everything goes well. But as soon as the 
>filter is 
>>> active, the tomahawk components are altered :-(
>>> 
>>> Do someone have an idea ?
>>> 
>>> Thank in advance,
>>> 
>>> Marc
>>> 
>>> 
>>> 
>>> 
>>> *Médiateur européen*
>>> 
>>> *Marc Kamran Amir-Tahmasseb*
>>> 
>>> Unité Communication - Développeur web
>>> 
>>> T. +33 (0)3 88 17 44 10
>>> 
>>> marc.amir-tahmasseb@ombudsman.europa.eu
>>> 
>>> 1 avenue du Président Robert Schuman
>>> 
>>> CS 30403
>>> 
>>> F - 67001 Strasbourg Cedex
>>> 
>>> T. + 33 (0)3 88 17 23 13
>>> 
>>> F. + 33 (0)3 88 17 90 62
>>> 
>>> www.ombudsman.europa.eu
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>

Re: Tomahawk components' javascript are undefined

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

If you receive those errors, it is probably your filter blocks
tomahawk one, so the resource requested is not served. In normal
conditions the components should work, inclusive if that so, probably
other libraries using similar hacks will fail too.

regards,

Leonardo

2011/3/1 Richard Yee <ri...@gmail.com>:
> Did you ever change the way you implemented your filter? I am pretty sure it is incorrect.
>
>
> Richard
>
> Sent from my iPhone
>
> On Mar 1, 2011, at 4:35 AM, "AMIR-TAHMASSEB Marc Kamran" <ma...@ombudsman.europa.eu> wrote:
>
>> Dear Richard and Omid,
>>
>> Finaly the only (an easiest) solution I found to my problem, was : NOT using those tomahawk component.
>> I replaced them by some jquery component and it works well now.
>>
>> Thanks for your help
>> Marc
>>
>>> -----Original Message-----
>>> From: Richard Yee [mailto:richard.k.yee@gmail.com]
>>> Sent: 13 February 2011 15:38
>>> To: MyFaces Discussion
>>> Subject: Re: Tomahawk components' javascript are undefined
>>>
>>> See http://www.oracle.com/technetwork/java/filters-137243.html
>>>
>>> You should do a chain.doFilter instead of a forward at the end
>>> of your method. Your filter isn't letting the other filters
>>> process the request.
>>>
>>> Richard
>>>
>>> Sent from my iPhone
>>>
>>> On Feb 12, 2011, at 11:34 PM, omid p <ve...@gmail.com> wrote:
>>>
>>>> Hi,
>>>> Can you not use
>>>> <url-pattern>/faces/*</url-pattern>
>>>> instead of
>>>> <url-pattern>*.faces</url-pattern>
>>>> maybe you corrupt tomahawk filter servlet by changing URL, just a
>>>> guess do you use any other javascript library like jQuery or
>>> sth else ?
>>>>
>>>> On Thu, Feb 10, 2011 at 7:02 PM, AMIR-TAHMASSEB Marc Kamran <
>>>> marc.amir-tahmasseb@ombudsman.europa.eu> wrote:
>>>>
>>>>> Dear all,
>>>>>
>>>>> I have some of my Tomahawk component encounter problems to
>>> be displayed.
>>>>>
>>>>> More specificaly, components such as
>>>>> - t:inputFileUpload,
>>>>> - t:swapImage
>>>>> - t:popup
>>>>> - t:inputDate
>>>>> generate the following javascript error :
>>>>> Error: xxx_3AtoolsPopupPopup is undefined
>>>>> Error: SI_MM_swapImage is not defined
>>>>> Error: SI_MM_swapImgRestore is not defined
>>>>> Error: orgApacheMyfacesPopup is not defined and so on....
>>>>>
>>>>> Everything worked well until I added a new filter to my
>>> application :
>>>>>
>>>>> My web.xml :
>>>>> <filter>
>>>>> <filter-name>localLanguageFilter</filter-name>
>>>>>
>>>>>
>>> <filter-class>ec.ep.eo.eoweb.filter.LocalLanguageFilter</filter-class
>>>>>>
>>>>> </filter>
>>>>>
>>>>> <filter-mapping>
>>>>> <filter-name>localLanguageFilter</filter-name>
>>>>> <url-pattern>*.faces</url-pattern>
>>>>> </filter-mapping>
>>>>>
>>>>>
>>>>> This filter, parse the url and try to localize the language code at
>>>>> the begining of it. Then it set the application local
>>> languge to this
>>>>> lanaguage and finaly redirect to the appropriate âge.
>>>>> Here is the code :
>>>>> public void doFilter(ServletRequest servletRequest, ServletResponse
>>>>> servletResponse, FilterChain filterChain) throws IOException,
>>>>> ServletException {  HttpServletRequest request =
>>> (HttpServletRequest)
>>>>> servletRequest;  HttpServletResponse response =
>>> (HttpServletResponse)
>>>>> servletResponse;  boolean redirect = false;  String currentURL =
>>>>> formatURL(request.getServletPath());
>>>>> String originalUri = request.getRequestURI();  String uri =
>>>>> originalUri;  String contextPath = request.getContextPath();  if
>>>>> (uri.startsWith(contextPath)) {
>>>>>  uri = uri.substring(contextPath.length());
>>>>> }
>>>>> String[] parts = uri.split(Constants.PATTERN_SLASH);
>>>>>
>>>>> if (parts.length>0 && parts[1].length()==2) {
>>>>>  String languageCode=parts[1];
>>>>>  uri = uri.substring(3);
>>>>>
>>>>>  ILanguage language =
>>>>> getServices().findLanguageByBusinessKey(languageCode);
>>>>>
>>>>>  if (language==null) {
>>>>>   language=Constants.ENGLISH;
>>>>>  }
>>>>>
>>>>>  request.getSession().setAttribute(Constants.SYSTEM_LANGUAGE,
>>>>> language);
>>>>>
>>>>> }
>>>>> RequestDispatcher requestDispatcher =
>>>>> request.getRequestDispatcher(uri);
>>>>> requestDispatcher.forward(request, response); } As i
>>> specified, if I
>>>>> remove the filter, everything goes well. But as soon as the
>>> filter is
>>>>> active, the tomahawk components are altered :-(
>>>>>
>>>>> Do someone have an idea ?
>>>>>
>>>>> Thank in advance,
>>>>>
>>>>> Marc
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *Médiateur européen*
>>>>>
>>>>> *Marc Kamran Amir-Tahmasseb*
>>>>>
>>>>> Unité Communication - Développeur web
>>>>>
>>>>> T. +33 (0)3 88 17 44 10
>>>>>
>>>>> marc.amir-tahmasseb@ombudsman.europa.eu
>>>>>
>>>>> 1 avenue du Président Robert Schuman
>>>>>
>>>>> CS 30403
>>>>>
>>>>> F - 67001 Strasbourg Cedex
>>>>>
>>>>> T. + 33 (0)3 88 17 23 13
>>>>>
>>>>> F. + 33 (0)3 88 17 90 62
>>>>>
>>>>> www.ombudsman.europa.eu
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>

Re: Tomahawk components' javascript are undefined

Posted by Richard Yee <ri...@gmail.com>.
Did you ever change the way you implemented your filter? I am pretty sure it is incorrect.


Richard

Sent from my iPhone

On Mar 1, 2011, at 4:35 AM, "AMIR-TAHMASSEB Marc Kamran" <ma...@ombudsman.europa.eu> wrote:

> Dear Richard and Omid,
> 
> Finaly the only (an easiest) solution I found to my problem, was : NOT using those tomahawk component.
> I replaced them by some jquery component and it works well now.
> 
> Thanks for your help
> Marc
> 
>> -----Original Message-----
>> From: Richard Yee [mailto:richard.k.yee@gmail.com] 
>> Sent: 13 February 2011 15:38
>> To: MyFaces Discussion
>> Subject: Re: Tomahawk components' javascript are undefined
>> 
>> See http://www.oracle.com/technetwork/java/filters-137243.html
>> 
>> You should do a chain.doFilter instead of a forward at the end 
>> of your method. Your filter isn't letting the other filters 
>> process the request.
>> 
>> Richard
>> 
>> Sent from my iPhone
>> 
>> On Feb 12, 2011, at 11:34 PM, omid p <ve...@gmail.com> wrote:
>> 
>>> Hi,
>>> Can you not use
>>> <url-pattern>/faces/*</url-pattern>
>>> instead of
>>> <url-pattern>*.faces</url-pattern>
>>> maybe you corrupt tomahawk filter servlet by changing URL, just a 
>>> guess do you use any other javascript library like jQuery or 
>> sth else ?
>>> 
>>> On Thu, Feb 10, 2011 at 7:02 PM, AMIR-TAHMASSEB Marc Kamran < 
>>> marc.amir-tahmasseb@ombudsman.europa.eu> wrote:
>>> 
>>>> Dear all,
>>>> 
>>>> I have some of my Tomahawk component encounter problems to 
>> be displayed.
>>>> 
>>>> More specificaly, components such as
>>>> - t:inputFileUpload,
>>>> - t:swapImage
>>>> - t:popup
>>>> - t:inputDate
>>>> generate the following javascript error :
>>>> Error: xxx_3AtoolsPopupPopup is undefined
>>>> Error: SI_MM_swapImage is not defined
>>>> Error: SI_MM_swapImgRestore is not defined
>>>> Error: orgApacheMyfacesPopup is not defined and so on....
>>>> 
>>>> Everything worked well until I added a new filter to my 
>> application :
>>>> 
>>>> My web.xml :
>>>> <filter>
>>>> <filter-name>localLanguageFilter</filter-name>
>>>> 
>>>> 
>> <filter-class>ec.ep.eo.eoweb.filter.LocalLanguageFilter</filter-class
>>>>> 
>>>> </filter>
>>>> 
>>>> <filter-mapping>
>>>> <filter-name>localLanguageFilter</filter-name>
>>>> <url-pattern>*.faces</url-pattern>
>>>> </filter-mapping>
>>>> 
>>>> 
>>>> This filter, parse the url and try to localize the language code at 
>>>> the begining of it. Then it set the application local 
>> languge to this 
>>>> lanaguage and finaly redirect to the appropriate âge.
>>>> Here is the code :
>>>> public void doFilter(ServletRequest servletRequest, ServletResponse 
>>>> servletResponse, FilterChain filterChain) throws IOException, 
>>>> ServletException {  HttpServletRequest request = 
>> (HttpServletRequest) 
>>>> servletRequest;  HttpServletResponse response = 
>> (HttpServletResponse) 
>>>> servletResponse;  boolean redirect = false;  String currentURL = 
>>>> formatURL(request.getServletPath());
>>>> String originalUri = request.getRequestURI();  String uri = 
>>>> originalUri;  String contextPath = request.getContextPath();  if 
>>>> (uri.startsWith(contextPath)) {
>>>>  uri = uri.substring(contextPath.length());
>>>> }
>>>> String[] parts = uri.split(Constants.PATTERN_SLASH);
>>>> 
>>>> if (parts.length>0 && parts[1].length()==2) {
>>>>  String languageCode=parts[1];
>>>>  uri = uri.substring(3);
>>>> 
>>>>  ILanguage language =
>>>> getServices().findLanguageByBusinessKey(languageCode);
>>>> 
>>>>  if (language==null) {
>>>>   language=Constants.ENGLISH;
>>>>  }
>>>> 
>>>>  request.getSession().setAttribute(Constants.SYSTEM_LANGUAGE,
>>>> language);
>>>> 
>>>> }
>>>> RequestDispatcher requestDispatcher = 
>>>> request.getRequestDispatcher(uri);
>>>> requestDispatcher.forward(request, response); } As i 
>> specified, if I 
>>>> remove the filter, everything goes well. But as soon as the 
>> filter is 
>>>> active, the tomahawk components are altered :-(
>>>> 
>>>> Do someone have an idea ?
>>>> 
>>>> Thank in advance,
>>>> 
>>>> Marc
>>>> 
>>>> 
>>>> 
>>>> 
>>>> *Médiateur européen*
>>>> 
>>>> *Marc Kamran Amir-Tahmasseb*
>>>> 
>>>> Unité Communication - Développeur web
>>>> 
>>>> T. +33 (0)3 88 17 44 10
>>>> 
>>>> marc.amir-tahmasseb@ombudsman.europa.eu
>>>> 
>>>> 1 avenue du Président Robert Schuman
>>>> 
>>>> CS 30403
>>>> 
>>>> F - 67001 Strasbourg Cedex
>>>> 
>>>> T. + 33 (0)3 88 17 23 13
>>>> 
>>>> F. + 33 (0)3 88 17 90 62
>>>> 
>>>> www.ombudsman.europa.eu
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>