apatia
apatia

Reputation: 118

Importing IceFaces crashes the webapplication

I would like to work with icefaces, but as soon as I import the libraries of icefaces, my webapplication crashes after clicking a button on the form which worked properly before the import.

What could go wrong?

enter image description here

The source Java:

package test,

import javax.faces.bean.ManagedBean;

@ManagedBean
public class Student {

private String firstName;

// create no-arg constructor
public Student() {

}

// define getter/setter methods 
public String getFirstName() {
    return firstName;
}

public void setFirstName(String firstName) {
    this.firstName = firstName;
}

}

index.xhtml:

<!DOCTYPE html>
<html lang="en"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
    <title>Student Registration Form</title>
</h:head>
<h:body>
    <h:form>
        First name: <h:inputText value="#{student.firstName}" />        
        <br/><br/>
        <h:commandButton value="Submit" action="student_response" />
    </h:form>
</h:body>

student_response.xhtml

<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
    <title>Student Confirmation</title>
</h:head>

<h:body>

    The student is confirmed: #{student.firstName} 

</h:body>
</html>

The error I get: enter image description here

Upvotes: 0

Views: 46

Answers (1)

Mahendran Kandiar
Mahendran Kandiar

Reputation: 980

you have 2 javax.faces. jars in classpath according to your first screenshot.

Please remove ONE of the faces jars in your classpath.

Upvotes: 1

Related Questions