I read this Where to place and how to read configuration resource files in servlet based application? and more but i dont have a java class, i only have xhtml page to get messages from property. I put properties fcile into webcontent, src, package in src, meta inf but none of them worked.
the xhtml page:
<?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">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>#{msgs.windowTitle}</title>
</head>
<body>
<h:form>
<h:panelGrid columns="2" columnsClasses="evenColumns, oddColumns">
#{msgs.namePrompt}
<h:inputText/>
#{msgs.PasswordPrompt}
<h:inputSecret id="password" />
#{msgs.ConfirmPasswordPrompt}
<h:inputSecret id="passwordConfirm"/>
</h:panelGrid>
<h:commandButton type="button" value="Submit" onclick="checkPassword(this.form)" />
</h:form>
</body>
</html>
facesconfig:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<application>
<message-bundle>messages</message-bundle>
</application>
</faces-config>
checkPassword.js (i put in webcontent, i couldnot have time for to find where to put js, i first want to find out properties)
/**
*
*/
function checkPassword(form){
var password = form[form.id+":passwordConfirm"].value;
var passwordConfirm = form[form.id+":password"].value;
if(password==passwordConfirm){
form.submit();
}
else{
alert("Wrong");
}
}
I use eclipse kepler jsf 2.2. Apache tomcat 7.0.54
When i run, it only shows input texts, not title or other texts. What can be the reason?
I changed also a lot of times name of file. Messages, msgs, messages and declaration but still did not work.