i am trying to include a java code into the value of the inputText in my jsf page but an error occur
according to tld or attribute directive in tag file attribute value
does not accept any expressions
Here is my jsf page.
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="core" %>
<%@ page language="java" %>
<core:view>
<html:form>
<html:outputLabel value="Informations " style="FONT-SIZE: xx-large;"/>
<br />
<br />
<%
final String property=System.getProperty("jboss.server.home.dir");
%>
<html:outputLabel value="Répertoire de configuration: " />
<html:inputText value='<%=property%>'/>
</html:form>
</core:view>
Doesn ‘ t work either with double quote or nothing
How to resolve this problem please ?
Thank you very much
The problem is with this line of code:
JSF uses Expression Language to populate/read values to/from a JavaBean. You will have to create a POJO action (called ManagedBean) with a variable
propertyand link it there.E.g.
Don’t forget to map the ManagedBean. In JBoss Seam, you will just add an
@Nameannotation above the class like,@Name("configurationAction").Finally, render this in JSF with Expression Language (EL)
Where
configurationActionis the name of your ManagedBean, andpropertyis the instance of the ManagedBean.