Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » Why is index.faces requested?
Why is index.faces requested? [message #473984] Sat, 24 March 2007 18:27 Go to next message
Eclipse UserFriend
Originally posted by: magnus.nospam.com

Hi,

I'm trying to create a JSF application and I've added an index.jsp file to
the WebContent directory containing one row:
<jsp:forward page="/login.faces" />

To start the web app in Eclipse using Apache Tomcat/5.5.23 I right click the
index.jsp file and select Run As->Run on Server. Then I get an error page
(HTTP Status 404) saying:
"The requested resource (/MyWebApp/index.faces) is not available."

Why is the non-existing page "index.faces" requested instead of
"login.faces"?

Thanks,
Magnus
Re: Why is index.faces requested? [message #473986 is a reply to message #473984] Mon, 26 March 2007 18:19 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
What does your web.xml file look like?
Re: Why is index.faces requested? [message #473988 is a reply to message #473986] Tue, 27 March 2007 04:59 Go to previous messageGo to next message
Magnus is currently offline MagnusFriend
Messages: 6
Registered: July 2009
Junior Member
Like this:
<?xml version="1.0" encoding="UTF-8"?>


<web-app xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


<display-name>MyWebApp</display-name>

<description>MyWebApp</description>


<context-param>

<param-name>javax.faces.DEFAULT_SUFFIX</param-name>

<param-value>.jspx</param-value>

</context-param>




<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>


<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>


</web-app>


"Cameron Bateman" <cameron.bateman@oracle.com> skrev i meddelandet
news:7e30a75c229460542549653c2e0c295c$1@www.eclipse.org...
> What does your web.xml file look like?
>
Re: Why is index.faces requested? [message #474009 is a reply to message #473988] Wed, 28 March 2007 07:57 Go to previous messageGo to next message
epson wang is currently offline epson wangFriend
Messages: 32
Registered: July 2009
Member
when you choose run on the server.
the wtp think the file that you select is a jsf file. so it search the
suffix difined in your web.xml. but in your condition, it is just a
normal jsp file.
When the server is running,you can just type the normal url
just like the /index.jsp it will work good.



On Tue, 27 Mar 2007 06:59:16 +0200, "Magnus" <magnus@nospam.com>
wrote:

>Like this:
><?xml version="1.0" encoding="UTF-8"?>
>
>
><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
>
>xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
>
><display-name>MyWebApp</display-name>
>
><description>MyWebApp</description>
>
>
><context-param>
>
><param-name>javax.faces.DEFAULT_SUFFIX</param-name>
>
><param-value>.jspx</param-value>
>
></context-param>
>
>
>
>
><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>
>
>
><welcome-file-list>
>
><welcome-file>index.jsp</welcome-file>
>
></welcome-file-list>
>
>
></web-app>
>
>
>"Cameron Bateman" <cameron.bateman@oracle.com> skrev i meddelandet
>news:7e30a75c229460542549653c2e0c295c$1@www.eclipse.org...
>> What does your web.xml file look like?
>>
>
Re: Why is index.faces requested? [message #474011 is a reply to message #473984] Wed, 28 March 2007 08:05 Go to previous messageGo to next message
epson wang is currently offline epson wangFriend
Messages: 32
Registered: July 2009
Member
for exampe,
you must select the index.jsp file in your project,then choose run on
the server.
the wtp think the index.jsp is a jsf file, so depend on your web.xml
it use the index.faces to talk the servlet to visit the index.jsp file
on the server.
if you hope run the login.jsp file .you should select the login.jsp .
Re: Why is index.faces requested? [message #474080 is a reply to message #473988] Wed, 28 March 2007 23:22 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
The JSF servlet is handling your request and it doesn't always do a URL
redirect. I am able to get this case working though... My guess would be
that there's something in your login.jsp that it's not happy about.
What's your login.jsp look like?


--Cam
Re: Why is index.faces requested? [message #608445 is a reply to message #473984] Mon, 26 March 2007 18:19 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
What does your web.xml file look like?
Re: Why is index.faces requested? [message #608446 is a reply to message #473986] Tue, 27 March 2007 04:59 Go to previous message
Magnus is currently offline MagnusFriend
Messages: 6
Registered: July 2009
Junior Member
Like this:
<?xml version="1.0" encoding="UTF-8"?>


<web-app xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


<display-name>MyWebApp</display-name>

<description>MyWebApp</description>


<context-param>

<param-name>javax.faces.DEFAULT_SUFFIX</param-name>

<param-value>.jspx</param-value>

</context-param>




<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>


<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>


</web-app>


"Cameron Bateman" <cameron.bateman@oracle.com> skrev i meddelandet
news:7e30a75c229460542549653c2e0c295c$1@www.eclipse.org...
> What does your web.xml file look like?
>
Re: Why is index.faces requested? [message #608455 is a reply to message #473988] Wed, 28 March 2007 07:57 Go to previous message
epson wang is currently offline epson wangFriend
Messages: 32
Registered: July 2009
Member
when you choose run on the server.
the wtp think the file that you select is a jsf file. so it search the
suffix difined in your web.xml. but in your condition, it is just a
normal jsp file.
When the server is running,you can just type the normal url
just like the /index.jsp it will work good.



On Tue, 27 Mar 2007 06:59:16 +0200, "Magnus" <magnus@nospam.com>
wrote:

>Like this:
><?xml version="1.0" encoding="UTF-8"?>
>
>
><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
>
>xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
>
><display-name>MyWebApp</display-name>
>
><description>MyWebApp</description>
>
>
><context-param>
>
><param-name>javax.faces.DEFAULT_SUFFIX</param-name>
>
><param-value>.jspx</param-value>
>
></context-param>
>
>
>
>
><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>
>
>
><welcome-file-list>
>
><welcome-file>index.jsp</welcome-file>
>
></welcome-file-list>
>
>
></web-app>
>
>
>"Cameron Bateman" <cameron.bateman@oracle.com> skrev i meddelandet
>news:7e30a75c229460542549653c2e0c295c$1@www.eclipse.org...
>> What does your web.xml file look like?
>>
>
Re: Why is index.faces requested? [message #608456 is a reply to message #473984] Wed, 28 March 2007 08:05 Go to previous message
epson wang is currently offline epson wangFriend
Messages: 32
Registered: July 2009
Member
for exampe,
you must select the index.jsp file in your project,then choose run on
the server.
the wtp think the index.jsp is a jsf file, so depend on your web.xml
it use the index.faces to talk the servlet to visit the index.jsp file
on the server.
if you hope run the login.jsp file .you should select the login.jsp .
Re: Why is index.faces requested? [message #608871 is a reply to message #473988] Wed, 28 March 2007 23:22 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
The JSF servlet is handling your request and it doesn't always do a URL
redirect. I am able to get this case working though... My guess would be
that there's something in your login.jsp that it's not happy about.
What's your login.jsp look like?


--Cam
Previous Topic:content assist/validation for custom variableResolver and propertyResolver
Next Topic:Metadata
Goto Forum:
  


Current Time: Thu Apr 25 15:37:26 GMT 2024

Powered by FUDForum. Page generated in 0.04177 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top