You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Wolf Benz <eu...@gmail.com> on 2006/07/18 20:45:09 UTC

add resource woes (list is growing)

Hi List,

Am I the only one having trouble with the add resource stuff?
I literally followed the advice given here:

http://myfaces.apache.org/tomahawk/extensionsFilter.html, and here:   
http://wiki.apache.org/myfaces/StreamingAddResource

Unfortunately, after doing so,
1/ My navigation went broke: instead of going to another page, it  
merely adds a "#" to the URL address.
2/ components like t:inputHTML (that explicitely need this  
apparently) stopped working (e.g. t:inputHTML just passes null  
values...)
3/ my JSF beans, previously correctly injected with Spring beans, are  
not injected anymore, and just stay "null"
4/ I get @lastmodified@ errors

(I paste my web.xml below.)

Some sidenotes:
1/ Whiel testing, I noticed: ff I remove the context param  
(ADD_RESOURCE_CLASS), I get my navgation back. The other problems  
remain.
2/ I added streaming resources as t:inputHTML stoppd working (never  
worked in Safari either), so I wanted to try tinyMCE/Dojo. Both of  
them need streaming resources.
3/ For the JSF-Spring integration, I followed the first approach  
mentioned here: http://www.jroller.com/page/cagataycivici? 
entry=integrating_jsf_and_spring (also, why does this affect the IoC  
behavior?!)
4/ Donno whether the @lastmodified@ errors are important...

Help! Fire! :-)
- Wolf


Ps My web.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
		xmlns="http://java.sun.com/xml/ns/j2ee"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http:// 
java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	     	
    <!--  First the Spring-Integration context parameters: -->
    <context-param>
       <description>  Deze context parameter is nodig opdat de Spring  
config file ingeladen zou worden.
                      Deze wordt ook effectief ingeladen doordat we  
een servlet declareren dat dat servlet container boottime
                      mee wordt opgestart, cf verder: SpringContext  
servlet - Hier kan je meerdere zaken ts kommas zetten.
       </description>
       <param-name>contextConfigLocation</param-name>
       <param-value>/META-INF/applicationContext.xml</param-value>
    </context-param>

    <context-param>
       <description>Geeft aan waar Spring de Log4J file moet gaan  
halen.</description>
       <param-name>log4jConfigLocation</param-name>
       <param-value>/META-INF/log4j.properties</param-value>
    </context-param>

	<context-param>
		<description>Comma separated list of URIs of (additional) faces  
config files.</description>
		<param-name>javax.faces.CONFIG_FILES</param-name>
         <param-value>/META-INF/faces-config.xml</param-value>
     </context-param>
	
	<context-param>
         <description>State saving method: "client" or "server" (=  
default)</description>
         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
         <param-value>client</param-value>
     </context-param>

     <context-param>
         <description>
             This parameter tells MyFaces if javascript code should  
be allowed in the rendered HTML output.
             If javascript is allowed, command_link anchors will have  
javascript code that submits the corresponding form.
             If javascript is not allowed, the state saving info and  
nested parameters will be added as url parameters.
             Defaults to "true"
         </description>
         <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
         <param-value>true</param-value>
     </context-param>

     <context-param>
     		<description>

         	</description>
         <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
         <param-value>false</param-value>
     </context-param>

     <context-param>
         <description>If true, rendered HTML code will be formatted,  
so that it is "human readable" i.e. additional line separators
         and whitespace will be written, that do not influence the  
HTML code.
         Defaults to "true"
         </description>
         <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
         <param-value>true</param-value>
     </context-param>

     <context-param>
         <description>
             If true, a javascript function will be rendered that is  
able to restore the former vertical scroll on every request.
             Convenient feature if you have pages with long lists and  
you do not want the browser page to always jump to the top
             if you trigger a link or button action that stays on the  
same page.
             Defaults to "false".
         </description>
         <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
                 <param-value>true</param-value>
     </context-param>
	
    <context-param>
    <description>Context parameter necessary for the  
StreamAddResource (i.e. to add streaming external resources)</ 
description>
     <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
     <param- 
value>org.apache.myfaces.component.html.util.StreamingAddResource</ 
param-value>
   </context-param>

     <!-- Extensions Filter -->
     <filter>
         <filter-name>JSFExtraResourcesExtensionsFilter</filter-name>
         <filter- 
class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
         		<init-param>
             		<description>Set the size limit for uploaded files.
                 		Format: 10 - 10 bytes
                         		10k - 10 KB
                         		10m - 10 MB
                         		1g - 1 GB
             		</description>
             		<param-name>uploadMaxFileSize</param-name>
             		<param-value>6m</param-value>
         		</init-param>

         		<init-param>
             		<description>Set the threshold size - files below this  
limit are stored in memory, files above this limit are stored on disk.
                 		Format:  10 - 10 bytes
                         		10k - 10 KB
                         		10m - 10 MB
                         		1g - 1 GB
             		</description>
             		<param-name>uploadThresholdSize</param-name>
             		<param-value>10k</param-value>
	        </init-param>

		<init-param>
             <description>Set the path where the intermediary files  
will be stored. </description>
             <param-name>uploadRepositoryPath</param-name>
             <param-value>/temp</param-value>
         </init-param>
     </filter>

     <filter-mapping>
         <filter-name>JSFExtraResourcesExtensionsFilter</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>JSFExtraResourcesExtensionsFilter</filter-name>
	    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
	</filter-mapping>
	
       <listener>
          <description>Loads the Spring Context (using the Ctx-par  
from above!)</description>
          <listener- 
class>org.springframework.web.context.ContextLoaderListener</listener- 
class>
       </listener>

      <listener>
          <description>Listener voor Log4J (gaat de requests dus af  
gaan @runtime)</description>
          <listener- 
class>org.springframework.web.util.Log4jConfigListener</listener-class>
       </listener>
     	
     <!-- Faces Servlet -->
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>
         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
     </servlet>

     <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>/Mnemonica/*</url-pattern>
    </servlet-mapping>


    <jsp-config>

       <taglib>
          <taglib-uri>/spring</taglib-uri>
          <taglib-location>/resources/tlds/spring.tld</taglib-location>
       </taglib>
       <!--  taglib>
          <taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
          <taglib-location>/resources/tlds/myfaces_core.tld</taglib- 
location>
       </taglib>
       <taglib>
          <taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
          <taglib-location>/resources/tlds/myfaces_html.tld</taglib- 
location>
       </taglib>
       <taglib>
          <taglib-uri>http://myfaces.apache.org/tomahawk</taglib-uri>
          <taglib-location>/resources/tlds/tomahawk.tld</taglib- 
location>
       </taglib>
       <taglib>
         <taglib-uri>http://myfaces.apache.org/sandbox</taglib-uri>
         <taglib-location>/resources/tlds/myfaces_sandbox.tld</taglib- 
location>
     	  </taglib -->
       <taglib>
         <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
         <taglib-location>/resources/tlds/c.tld</taglib-location>
     	  </taglib>
     	

</web-app>


RE: add resource woes (list is growing)

Posted by Julian Ray <ju...@yahoo.com>.
An update on this. After doing a comparison of changes between the dev with
the just-compiled myfaces 1.1.5 and my last working version (8 days ago) I
found that I have somehow missed copying the new build for myfaces.impl
snapshot.

When I copied the impl everything started to work fine.
-- 
View this message in context: http://www.nabble.com/add-resource-woes-%28list-is-growing%29-tf1962327.html#a5398794
Sent from the MyFaces - Users forum at Nabble.com.


RE: add resource woes (list is growing)

Posted by Julian Ray <ju...@yahoo.com>.
Hmmm, I just got the last weeks worth of changes from SVN and built the
latest 1.1.5 and my links are no longer working. Strange as they were on my
previous 1.1.5 build of last week.
 
What gives?
 
 
 
 

  _____  

From: Wolf Benz [mailto:eurojava@gmail.com] 
Sent: Tuesday, July 18, 2006 2:45 PM
To: MyFaces Discussion
Subject: add resource woes (list is growing)


Hi List, 

Am I the only one having trouble with the add resource stuff?
I literally followed the advice given here: 

http://myfaces.apache.org/tomahawk/extensionsFilter.html, and here:
http://wiki.apache.org/myfaces/StreamingAddResource

Unfortunately, after doing so, 
1/ My navigation went broke: instead of going to another page, it merely
adds a "#" to the URL address.
2/ components like t:inputHTML (that explicitely need this apparently)
stopped working (e.g. t:inputHTML just passes null values...)
3/ my JSF beans, previously correctly injected with Spring beans, are not
injected anymore, and just stay "null"
4/ I get @lastmodified@ errors

(I paste my web.xml below.) 

Some sidenotes:
1/ Whiel testing, I noticed: ff I remove the context param
(ADD_RESOURCE_CLASS), I get my navgation back. The other problems remain.
2/ I added streaming resources as t:inputHTML stoppd working (never worked
in Safari either), so I wanted to try tinyMCE/Dojo. Both of them need
streaming resources.
3/ For the JSF-Spring integration, I followed the first approach mentioned
here:
http://www.jroller.com/page/cagataycivici?entry=integrating_jsf_and_spring
(also, why does this affect the IoC behavior?!)
4/ Donno whether the @lastmodified@ errors are important...

Help! Fire! :-)
- Wolf


Ps My web.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- First the Spring-Integration context parameters: -->
<context-param>
<description> Deze context parameter is nodig opdat de Spring config file
ingeladen zou worden. 
Deze wordt ook effectief ingeladen doordat we een servlet declareren dat dat
servlet container boottime
mee wordt opgestart, cf verder: SpringContext servlet - Hier kan je meerdere
zaken ts kommas zetten. 
</description>
<param-name>contextConfigLocation</param-name>
<param-value>/META-INF/applicationContext.xml</param-value>
</context-param>




<context-param>
<description>Geeft aan waar Spring de Log4J file moet gaan
halen.</description>
<param-name>log4jConfigLocation</param-name>
<param-value>/META-INF/log4j.properties</param-value>
</context-param>


<context-param>
<description>Comma separated list of URIs of (additional) faces config
files.</description>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/META-INF/faces-config.xml</param-value>
</context-param>


<context-param>
<description>State saving method: "client" or "server" (=
default)</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>

<context-param>
<description>
This parameter tells MyFaces if javascript code should be allowed in the
rendered HTML output.
If javascript is allowed, command_link anchors will have javascript code
that submits the corresponding form.
If javascript is not allowed, the state saving info and nested parameters
will be added as url parameters.
Defaults to "true" 
</description>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>

<context-param>
<description>


</description>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>

<context-param>
<description>If true, rendered HTML code will be formatted, so that it is
"human readable" i.e. additional line separators 
and whitespace will be written, that do not influence the HTML code.
Defaults to "true" 
</description>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>

<context-param>
<description>
If true, a javascript function will be rendered that is able to restore the
former vertical scroll on every request. 
Convenient feature if you have pages with long lists and you do not want the
browser page to always jump to the top
if you trigger a link or button action that stays on the same page.
Defaults to "false".
</description>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>


<context-param>
<description>Context parameter necessary for the StreamAddResource (i.e. to
add streaming external resources)</description>
<param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
<param-value>org.apache.myfaces.component.html.util.StreamingAddResource</pa
ram-value>
</context-param>


<!-- Extensions Filter -->
<filter>
<filter-name>JSFExtraResourcesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-clas
s>
<init-param>
<description>Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
<param-name>uploadMaxFileSize</param-name>
<param-value>6m</param-value>
</init-param>

<init-param>
<description>Set the threshold size - files below this limit are stored in
memory, files above this limit are stored on disk.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
<param-name>uploadThresholdSize</param-name>
<param-value>10k</param-value>
</init-param>

<init-param>
<description>Set the path where the intermediary files will be stored.
</description>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
</init-param>
</filter>




<filter-mapping>
<filter-name>JSFExtraResourcesExtensionsFilter</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>JSFExtraResourcesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>


<listener>
<description>Loads the Spring Context (using the Ctx-par from
above!)</description>
<listener-class>org.springframework.web.context.ContextLoaderListener</liste
ner-class>
</listener>


<listener>
<description>Listener voor Log4J (gaat de requests dus af gaan
@runtime)</description>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-c
lass>
</listener>


<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/Mnemonica/*</url-pattern>
</servlet-mapping>


<jsp-config>


<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/resources/tlds/spring.tld</taglib-location>
</taglib>
<!-- taglib>
<taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
<taglib-location>/resources/tlds/myfaces_core.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
<taglib-location>/resources/tlds/myfaces_html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://myfaces.apache.org/tomahawk</taglib-uri>
<taglib-location>/resources/tlds/tomahawk.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://myfaces.apache.org/sandbox</taglib-uri>
<taglib-location>/resources/tlds/myfaces_sandbox.tld</taglib-location>
</taglib -->
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/resources/tlds/c.tld</taglib-location>
</taglib>






</web-app>