小编Nav*_*hra的帖子

JSF 2.0导航系统不使用.jsp扩展名

我已经将JSF2.0用于自动导航系统.我有一个简单的登录页面,当我点击登录按钮时,相应的Bean类的方法已经调用但是当我改变时它不会导航到home.jsp页面从.jsp到xhtml的扩展然后它工作..jsp扩展名有什么问题.

LoginBean.java

public class LoginBean implements Serializable {
private static final long serialVersionUID = 1L;
private String uname;
private String password;


public String getPassword() {
    return password;
}

public void setPassword(String password) {
    this.password = password;
}

public String getUname() {
    return uname;
}

public void setUname(String uname) {
    this.uname = uname;
}

public String loginProject() {
     System.out.println("hello i am called ");
     System.out.println(uname);
     System.out.println(password);
        return "home";
    }
}
Run Code Online (Sandbox Code Playgroud)

===============
login.xhtml

    <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">
<h:head>
    <title>Colonial Inn</title>
</h:head> …
Run Code Online (Sandbox Code Playgroud)

jsf jsp facelets jsf-2

3
推荐指数
1
解决办法
205
查看次数

标签 统计

facelets ×1

jsf ×1

jsf-2 ×1

jsp ×1