Hi,
 
Create a mapping for your servlet and try accessing in this way.
 Can you try once accessing your form as
project/faces/test.jsf.
 
I'm attaching my web.xml havea reference to it and the problem can  be solved.
 
 

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

<!--Configuring facesConfig.xml -->

<context-param>

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

<param-value>/WEB-INF/faces-config.xml</param-value>

</context-param>

<!-- State Saving Method for Client and Server -->

<context-param>

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

<param-value>client</param-value>

</context-param>

<!-- This is the Tag which allows _javascript_ into your JSF Application .Default is true -->

<context-param>

<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>

<param-value>true</param-value>

</context-param>

<!-- This is the tag for AutoScroll of your JSF page default is true -->

<context-param>

<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>

<param-value>true</param-value>

</context-param>

<!-- Tag for Checking your HTML along with your rendererd JSF Components as HTML -->

<context-param>

<param-name>org.apache.myfaces.PRETTY_HTML</param-name>

<param-value>true</param-value>

</context-param>

<!-- Tag for the Faces Context Listener -->

<listener>

<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>

</listener>

<!-- Initialization of the Faces Servlet -->

<servlet>

<servlet-name>FacesServlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>0</load-on-startup>

</servlet>

<!-- Faces Servlet PATH mapping with the referred URL Pattern -->

<servlet-mapping>

<servlet-name>FacesServlet</servlet-name>

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

</servlet-mapping>

<!-- Faces Servlet EXTENSION mapping with the referred URL Pattern -->

<servlet-mapping>

<servlet-name>FacesServlet</servlet-name>

<url-pattern>*.jsf</url-pattern>

</servlet-mapping>

</web-app>

 

 
 
 
Chandru.
----- Original Message -----
Sent: Saturday, August 05, 2006 6:02 AM
Subject: Re: SUNs studio enterprise 8 and web.xml config problem

this link works absoluely fine.. we had faced same issues n this is where it got solved.. :-)

On 8/4/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
There may be something that can help you here.
If not, please update it when you do solve your issues.

http://wiki.apache.org/myfaces/Installation_and_Configuration


On 8/4/06, Sköldheimer Fredrik < [EMAIL PROTECTED]> wrote:
>
>
> Hello all!
>
> This is my first post so please be gentle ;-)
> I´m keen on trying the MyFaces taglib in my application but I´m having
> problems getting it to work properly. I´m using SUNs Java studio enterprise
> 8 and deploy to localhost running SUNs web/app server that comes with
> enterprise.
> OK then, Here is what I have done so far.
>
> First attempt:
> =======================
> I just included the
>
> <% @taglib uri="http://myfaces.apache.org/tomahawk"
> prefix="t"%>
>
> on my jsp page and tried to add a component like this:
> <t:inputCalendar popupDateFormat="yyyy-MM-dd" popupWeekString="v"
> popupTodayString="Idag är" renderPopupButtonAsImage="true"
> addResources="true" styleClass="inputfieldsText" style="width:73"
> id="eventdate" renderAsPopup="true" tabindex="1" maxlength="10"
> forceId="true">
> </t:inputCalendar>
>
> Well, It worked, kind of. I´m getting a _javascript_ error on the page so I
> googled it and found out that I had to do some editing in my web.xml file
> that, at first looked like this:
>
> ------------- 8< -------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app 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 ">
>     <servlet>
>         <servlet-name>FacesServlet</servlet-name>
>         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>FacesServlet</servlet-name>
>         <url-pattern>*.jsf</url-pattern>
>     </servlet-mapping>
>     <session-config>
>         <session-timeout>30</session-timeout>
>     </session-config>
>     <welcome-file-list>
>         <welcome-file>survey.jsf </welcome-file>
>     </welcome-file-list>
> </web-app>
> -----------------------------
>
>
> Second atempt:
> =================
> So I modified the web.xml to look like this:
>
> ----------- 8< --------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app 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">
>     <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>
>
> <!-- extension mapping for adding <script/>, <link/>, and other resource
> tags to JSF-pages  -->
> <filter-mapping>
>     <filter-name>MyFacesExtensionsFilter</filter-name>
>     <!-- servlet-name must match the name of your
> javax.faces.webapp.FacesServlet entry -->
>     <servlet-name>FacesServlet</servlet-name>
> </filter-mapping>
>
> <!-- extension mapping for serving page-independent resources (_javascript_,
> stylesheets, images, etc.)  -->
> <filter-mapping>
>     <filter-name>MyFacesExtensionsFilter</filter-name>
>
> <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
> </filter-mapping>
>
>
>     <servlet>
>         <servlet-name>FacesServlet</servlet-name>
>         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>FacesServlet</servlet-name>
>         <url-pattern>*.jsf</url-pattern>
>     </servlet-mapping>
>     <session-config>
>         <session-timeout>30</session-timeout>
>     </session-config>
> </web-app>
> ----------------------------------
>
>
> But ups, Now I can't access my pages anymore. I get an 404 error from the
> webserver /app server like this:
> ------------- 8< --------------
>
>
> type Status report
>
> message /project/test.jsf
>
> description The requested resource (/project/test.jsf) is not available.
> ------------- 8< --------------
>
> And the same problem if I try to change .jsf to .jsp or anything else for
> that matter. So, something seems to be wrong with the filter thing in
> web.xml but I can't figure out what.
>
> Thank you
> Fredrik
>
>
>

Reply via email to