myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Kramer" <alfo...@gmx.li>
Subject AW: Unable to convert String (Faces 1.2)
Date Tue, 16 Oct 2007 16:25:59 GMT
Hello Bryan

 

Thanks for your tip.

 

"value" should handle Strings also, anyway I tried to acces a bean property
but the error is still the same.

 

      <h:outputText value="#{testBean.test}"/>

 

Think it's another problem, any further ideas?

 

Regards

 

Andreas

 

  _____  

Von: Bryan Basham [mailto:bbasham@stillsecure.com] 
Gesendet: Dienstag, 16. Oktober 2007 18:26
An: MyFaces Discussion
Betreff: Re: Unable to convert String (Faces 1.2)

 

Hello Andreas,

The value tag attribute expects a JSF value binding of the form
#{bean.property}.
However if you want to test a static value try this:
<h:outputText value="#{'test'}"/>

Cheers,
Bryan

Andreas Kramer wrote: 

Hi

 

I got the following problem:

 

When opening a very simple jsp page just containing an <h:outputText
value="test"/>.

I receive the following error:

 

exception 

javax.servlet.ServletException: Unable to convert string "test" to class
"javax.el.ValueExpression" for attribute "value": Property Editor not
registered with the PropertyEditorManager
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)

root cause 

javax.faces.FacesException: Unable to convert string "test" to class
"javax.el.ValueExpression" for attribute "value": Property Editor not
registered with the PropertyEditorManager
 
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(Servl
etExternalContextImpl.java:340)
 
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHand
lerImpl.java:254)
 
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseEx
ecutor.java:41)
 
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)

 

 

My setup:

 

Myfaces 1.2.0

Tomahawk 6.014

Eclipse WTP 3.3

JDK 6

 

Page: 

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

    pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<http://www.w3.org/TR/html4/loose.dtd>
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<%@ taglib uri= <http://java.sun.com/jsf/html>
"http://java.sun.com/jsf/html" prefix="h"%>

<%@ taglib uri= <http://java.sun.com/jsf/core>
"http://java.sun.com/jsf/core" prefix="f"%>

 

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Insert title here</title>

</head>

<body>

      <h:outputText value="test"/>

 

</body>

</html>

 

Web.xml:

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

<web-app xmlns:xsi= <http://www.w3.org/2001/XMLSchema-instance>
"http://www.w3.org/2001/XMLSchema-instance" xmlns=
<http://java.sun.com/xml/ns/javaee> "http://java.sun.com/xml/ns/javaee"
xmlns:web= <http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd>
"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation=
<http://java.sun.com/xml/ns/javaeehttp:/java.sun.com/xml/ns/javaee/web-app_2
_5.xsd> "http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">

  <display-name>JSF2</display-name>

  <welcome-file-list>

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

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

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

    <welcome-file>default.html</welcome-file>

    <welcome-file>default.htm</welcome-file>

    <welcome-file>default.jsp</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>/faces/*</url-pattern>

  </servlet-mapping>

</web-app>

 

Faces-config.xml

 

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

 

<faces-config

    xmlns= <http://java.sun.com/xml/ns/javaee>
"http://java.sun.com/xml/ns/javaee"

    xmlns:xsi= <http://www.w3.org/2001/XMLSchema-instance>
"http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation=
<http://java.sun.com/xml/ns/javaeehttp:/java.sun.com/xml/ns/javaee/web-faces
config_1_2.xsd> "http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"

    version="1.2">

 

</faces-config>

 

WEB-INF/lib:

 

commons-beanutils-1.7.0.jar

commons-codec-1.3.jar

commons-collections-3.2.jar

commons-digester-1.8.jar

commons-discovery-0.4.jar

commons-logging-1.1.jar

jstl-1.2.jar

myfaces-api-1.2.0.jar

myfaces-impl-1.2.0.jar

standard-1.1.2.jar

 


Mime
View raw message