myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Patrick" <Todd.Patr...@dtn.com>
Subject RE: How do I properly use jsp:forward in MyFaces?
Date Fri, 05 May 2006 17:43:01 GMT
David: Thank you, yes I missed that completely.
 
I greatly appreciate everyone's help...
 
Thanks,
 
--Todd

________________________________

From: David G. Friedman [mailto:humble@ix.netcom.com] 
Sent: Friday, May 05, 2006 12:00 PM
To: MyFaces Discussion
Subject: RE: How do I properly use jsp:forward in MyFaces?


Todd,
 
You need to get rid of the Tomahawk references, which is the only reason
you would have the extensions filter. This note was on the front page of
the myfaces.apache.org site:
 
Please pay attention to the fact that you cannot use this release of
MyFaces Core with the MyFaces Tomahawk library in version 1.1.1 - it
will only work with the Tomahawk library in version 1.1.2 and onward.
(The 1.1.2 release is currently only available as a nightly. The
official release is expected in a few days.)
 
Where "This release" is myfaces v 1.1.2 as you mentioned below. Getting
rid of the extensions filter should clear some things up as long as you
do not, for right now, plan on using the Tomahawk "t" taglib.  For
learning purposes, I recommend staying away from that taglib.
 
Regards,
David

	-----Original Message-----
	From: Todd Patrick [mailto:Todd.Patrick@dtn.com]
	Sent: Friday, May 05, 2006 12:29 PM
	To: MyFaces Discussion
	Subject: RE: How do I properly use jsp:forward in MyFaces?
	
	
	No errors in the log file.
	 
	I changed my web.xml file to:
	 
	<?xml version="1.0" encoding="UTF-8"?>
	<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee
<http://java.sun.com/xml/ns/j2ee> "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance> "
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
<http://java.sun.com/xml/ns/j2ee>
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
<http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd> ">
	    <context-param>
	        <param-name>com.sun.faces.verifyObjects</param-name>
	        <param-value>true</param-value>
	    </context-param>
	    <context-param>
	        <param-name>com.sun.faces.validateXml</param-name>
	        <param-value>true</param-value>
	    </context-param>
	    <context-param>
	        <param-name>javax.faces.CONFIG_FILES</param-name>
	        <param-value>/WEB-INF/faces-config.xml</param-value>
	    </context-param>
	    <context-param>
	        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
	        <param-value>client</param-value>
	    </context-param>
	    <context-param>
	
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
	        <param-value>true</param-value>
	    </context-param>
	    <context-param>
	
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
	        <param-value>false</param-value>
	    </context-param>
	    <context-param>
	        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
	        <param-value>true</param-value>
	    </context-param>
	    <context-param>
	        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
	        <param-value>true</param-value>
	    </context-param>
	    <context-param>
	
<param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
	        <param-value>true</param-value>
	    </context-param>
	 
	    <filter>
	        <filter-name>MyFacesExtensionsFilter</filter-name>
	
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-
class>
	        <init-param>
	            <param-name>maxFileSize</param-name>
	            <param-value>20m</param-value>
	        </init-param>
	    </filter>
	 
	    <filter-mapping>
	        <filter-name>MyFacesExtensionsFilter</filter-name>
	        <servlet-name>Faces Servlet</servlet-name>
	    </filter-mapping>
	 
	    <filter-mapping>
	        <filter-name>MyFacesExtensionsFilter</filter-name>
	        <url-pattern>*.jsf</url-pattern>
	    </filter-mapping>
	 
	    <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>*.jsf</url-pattern> 
	    </servlet-mapping>
	 
	    <session-config>
	        <session-timeout>
	            30
	        </session-timeout>
	    </session-config>
	    <welcome-file-list>
	        <welcome-file>index.jsp</welcome-file>
	        <welcome-file>index.html</welcome-file>
	    </welcome-file-list>
	</web-app>
	 
	 
	Plus, I changed the jsp-forward tag to:
	 
	<jsp:forward page="tbrowser.jsf"/>
	 
	Now I get the same ole' error:
	javax.servlet.ServletException: ExtensionsFilter not correctly
configured. JSF mapping missing. JSF pages not covered.
	 
	What's interesting is when I look in the myfaces-impl-1.1.2.jar,
the following package isn't there:
	 
	org.apache.myfaces.webapp.filter
	 
	Only:
	 
	org.apache.myfaces.webapp
	 
	 
	What is going on? Geez... I did get the simple.war to work,
blank.war had a JavaScript error.
	 
	Thanks,
	 
	--Todd

________________________________

	From: David G. Friedman [mailto:humble@ix.netcom.com] 
	Sent: Friday, May 05, 2006 10:22 AM
	To: MyFaces Discussion
	Subject: RE: How do I properly use jsp:forward in MyFaces?
	
	
	Todd,
	 
	Does your web server have any startup errors in the log files
for the /transactionbrowser web application?  Also, have you put a
simple/basic JSF page in /tbrowser.jsp and can you post it so we can
check the syntax?
	 
	Regards,
	David

		-----Original Message-----
		From: Cagatay Civici [mailto:cagatay.civici@gmail.com]
		Sent: Friday, May 05, 2006 9:33 AM
		To: MyFaces Discussion
		Subject: Re: How do I properly use jsp:forward in
MyFaces?
		
		
		Hi,
		
		Removing the "/" at the beginning may work,
		
		<jsp:forward page="faces/tbrowser"/>
		
		Cagatay
		
		
		On 5/5/06, Todd Patrick <Todd.Patrick@dtn.com
<mailto:Todd.Patrick@dtn.com> > wrote: 

			OK, this is making sense;
			 
			I downloaded the blank.war file and I am
installing it now - in the meantime, I went back and changed 
			
			 
			<jsp:forward page="/faces/tbrowser.jsp"/>
			 
			to:
			 
			<jsp:forward page="/faces/tbrowser"/>
			 
			Now, I receive:
			

			HTTP Status 404 - /transactionbrowser/tbrowser
			type Status report
			message /transactionbrowser/tbrowser
			description The requested resource
(/transactionbrowser/tbrowser) is not available.

			My servlet-mapping is still:
			
			 
			<filter>
	
<filter-name>MyFacesExtensionsFilter</filter-name>
	
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-
class>
			    <init-param>
			        <param-name>maxFileSize</param-name>
			        <param-value>20m</param-value>
			    </init-param>
			</filter>
			<filter-mapping>
	
<filter-name>MyFacesExtensionsFilter</filter-name>
			    <servlet-name>Faces Servlet</servlet-name>
			</filter-mapping>
			<filter-mapping>
	
<filter-name>MyFacesExtensionsFilter</filter-name>
	
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
			</filter-mapping>
			 
			<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>/faces/*</url-pattern>
			</servlet-mapping>
			 
			 
			Thanks,
			 
			--Todd

________________________________

			From: David G. Friedman
[mailto:humble@ix.netcom.com <mailto:humble@ix.netcom.com> ] 
			Sent: Friday, May 05, 2006 12:49 AM
			To: MyFaces Discussion
			Subject: RE: How do I properly use jsp:forward
in MyFaces?
			
			
			Todd,
			 
			From your various posts tonight, you seem to
have a number of JSF concepts mixed.  Is this your first Faces Webapp?
(That is not meant to be an insult but a simple question) 
			 
			If your project folder looks like this as you
indicated:
			 
			
			/transactionbrowser/
			- WEB-INF
			- resources
			-index.jsp
			-tbrowser.jsp
			 
			Then the various mappings you have posted over
the past 24 hours have often been incorrect.  With this webapp, your
main url would likely be:
			http://127.0.0.1/transactionbrowser
<http://127.0.0.1/transactionbrowser> and you would expect it to invoke
the welcome page /index.jsp.  Your example index.jsp was listed as:
			 
			
			<jsp:forward page="/faces/tbrowser.jsp"/>
			 
			THAT is where your first make came from: your
mappings.  JSF is often taught using SUFFIX mapping so the urls such as
/index.jsf are understood to be imaginary (no such file exists) allowing
the servlet to map /index.jsf to compile the view from the jsp file
/index.jsp.  With prefix mapping the url "/index.jsf" would be
equivalent to "/faces/index" see? When you switch to PREFIX mapping like
having mappings start "/faces/whatever", you must skip the .jsp
extension so your index.jsp file should contain:
			 
			
			<jsp:forward page="/faces/tbrowser"/>
			 
			Adding the .jsp suffix while using prefix
mapping is causing your problem (that plus how your web.xml Servlet and
Filter mappings are setup). I strongly recommend you to back to the
myfaces blank.war and example war files to see how standard *.jsf suffix
mapping works and begin your application with that style until you are
positive you can make a working JSF application.  It will save you time
and effort since searching (the web or this lists's archives) on the
*.jsf SUFFIX extension will result in a much greater number of relevant
posts than if you use PREFIX "/faces/*" mapping.
			 
			Regards,
			David Friedman / humble@ix.netcom.com
<mailto:humble@ix.netcom.com> 

				-----Original Message-----
				From: Todd Patrick
[mailto:Todd.Patrick@dtn.com <mailto:Todd.Patrick@dtn.com> ]
				Sent: Friday, May 05, 2006 1:15 AM
				To: MyFaces Discussion
				Subject: How do I properly use
jsp:forward in MyFaces?
				
				
				I have a project folder that looks like:
				 
				/transactionbrowser/
				- WEB-INF
				- resources
				-index.jsp
				-tbrowser.jsp
				 
				 
				With the servlet-mapping of:
				 
				<filter>
	
<filter-name>MyFacesExtensionsFilter</filter-name>
	
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-
class>
				    <init-param>
	
<param-name>maxFileSize</param-name>
				        <param-value>20m</param-value>
				    </init-param>
				</filter>
				<filter-mapping>
	
<filter-name>MyFacesExtensionsFilter</filter-name>
				    <servlet-name>Faces
Servlet</servlet-name>
				</filter-mapping>
				<filter-mapping>
	
<filter-name>MyFacesExtensionsFilter</filter-name>
	
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
				</filter-mapping>
				 
				<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>/faces/*</url-pattern>
				</servlet-mapping>
				 
				 
				The only URLs that work are:
				 
	
http://127.0.0.1:8080/transactionbrowser/faces/tbrowser.jsp 
	
http://127.0.0.1:8080/transactionbrowser/faces/
<http://127.0.0.1:8080/transactionbrowser/faces/>  
				 
				 
				On my index.jsp I have:
				 
				<jsp:forward
page="/faces/tbrowser.jsp"/>
				 
				 
				So, when I go to:
				 
	
http://127.0.0.1:8080/transactionbrowser/ 
				 
				I see the page, but not with the MyFaces
rendering, I still plain control GUI components with none of the add
MyFaces filter files. How do I use jsp:forward properly to get to:
				 
	
http://127.0.0.1:8080/transactionbrowser/faces/ 
				 
				or
				 
	
http://127.0.0.1:8080/transactionbrowser/faces/tbrowser.jsp 
				 
				 
				I can't use the following since that
doesn't run the MyFaces servlet:
				 
				<jsp:forward
page="/transactionbrowser/faces/tbrowser.jsp"/>
				 
				 
				Thoughts or examples are appreciated.
				 
				Thanks,
				 
				--Todd
				 
				 



Mime
View raw message