Re: Pretty faces don`t work for me

Splash Forums PrettyFaces Users Pretty faces don`t work for me Re: Pretty faces don`t work for me

#23291

i am posting my file

web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

xmlns="http://java.sun.com/xml/ns/javaee&quot;

xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot;

id="WebApp_ID" version="3.0">

<display-name>SalarySlipApp</display-name>

<welcome-file-list>

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

</welcome-file-list>

<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>*.xhtml</url-pattern>

</servlet-mapping>

<context-param>

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

<param-value>.xhtml</param-value>

</context-param>

<context-param>

<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>

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

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

</context-param>

<context-param>

<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>

<param-value>resources.application</param-value>

</context-param>

<listener>

<listener-class>com.sun.faces.config.ConfigureListener</listener-class>

</listener>

<!– JasperReports Servlet –>

<servlet>

<servlet-name>PdfServlet</servlet-name>

<servlet-class>net.sf.jasperreports.j2ee.servlets.PdfServlet</servlet-class>

</servlet>

<servlet>

<servlet-name>JExcelApiServlet</servlet-name>

<servlet-class>net.sf.jasperreports.j2ee.servlets.JExcelApiServlet</servlet-class>

</servlet>

<servlet>

<servlet-name>RtfServlet</servlet-name>

<servlet-class>net.sf.jasperreports.j2ee.servlets.RtfServlet</servlet-class>

</servlet>

<!– JasperReports Servlet Mapping –>

<servlet-mapping>

<servlet-name>PdfServlet</servlet-name>

<url-pattern>/servlets/report/PDF</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>JExcelApiServlet</servlet-name>

<url-pattern>/servlets/report/EXCEL</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>RtfServlet</servlet-name>

<url-pattern>/servlets/report/RTF</url-pattern>

</servlet-mapping>

</web-app>

pretty-faces.xml

<?xml version="1.0" encoding="UTF-8"?>

<pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.2&quot;

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.2

http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.2.xsd ">

</pretty-config>

faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>

<faces-config

xmlns="http://java.sun.com/xml/ns/javaee&quot;

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd&quot;

version="2.0">

</faces-config>

login.xhtml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml&quot;

xmlns:h="http://java.sun.com/jsf/html&quot;

xmlns:f="http://java.sun.com/jsf/core&quot;

xmlns:ui="http://java.sun.com/jsf/facelets&quot;

xmlns:c="http://java.sun.com/jsp/jstl/core&quot;

xmlns:fn="http://java.sun.com/jsp/jstl/functions&quot;

xmlns:x= "http://java.sun.com/jstl/xml&quot;

xmlns:pretty ="http://ocpsoft.com/prettyfaces&quot;

>

<form>

<!–an other code –>

<h:commandButton action="pretty:login" styleClass="ok" value="Login" onclick="return login_submit();"/>

</form>

LoginAction.java

package com.ss.action;

import java.util.ArrayList;

import javax.faces.bean.ManagedBean;

import javax.faces.bean.ManagedProperty;

import javax.faces.bean.RequestScoped;

import javax.faces.bean.SessionScoped;

import javax.faces.event.NamedEvent;

import com.ocpsoft.pretty.PrettyContext;

import com.ocpsoft.pretty.faces.annotation.URLAction;

import com.ocpsoft.pretty.faces.annotation.URLMapping;

import com.ss.managedbeans.LoginBeans;

import com.ss.managedbeans.MenusBeans;

import com.ss.managedbeans.SubMenusBeans;

import com.ss.delegate.LoginDelegate;

@ManagedBean

@RequestScoped

@URLMapping(id="login", pattern="/login", viewId="xhtmls/success.xhtml")

public class LoginAction {

@ManagedProperty(value="#{loginBeans}")

private LoginBeans loginBeans;

@URLAction

public String action(){

/// some different code

if(success) {

return "pretty:login";

} else

return null;

}}

success.xhtml

executing some data in it..

using Eclipse

project name MyApp—>>> WebContent—> xhtmls


> login.xhtml , success.xhtml (these files are here)

now problem is that when i am submitting form from login.xhtml if(true) then it will return pretty:login

i am getting this output uploaded image

please HELP ME!!

[attachment=5287,80]