Solved

JSF example errors

Posted on 2010-09-19
2
790 Views
Last Modified: 2013-11-24

hi,
I am trying to run chapter 4 related example from link

http://jsfcompref.com/code_download.html

I got this kind of error

<Sep 19, 2010 3:29:14 PM EDT> <Error> <HTTP> <BEA-101017> <[ServletContext@21864173[app:_auto_generated_ear_ module:CR_CH04 path:/CR_CH04 spec-version:2.5], request: weblogic.servlet.internal.ServletRequestImpl@83ba01[
POST /CR_CH04/faces/register.jsp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://localhost:7001/CR_CH04/faces/register.jsp
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Content-Length: 334
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=wsGGMWjPHQ7NJKJVrz12hNMmdQxx6v6pxfm1cWhvqPywcD6j1hSz!-1918873751

]] Root cause of ServletException.
javax.faces.el.EvaluationException: Exception while invoking expression #{userBean.validateEmail}
      at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:168)
      at javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.java:181)
      at javax.faces.component.UIInput.validateValue(UIInput.java:313)
      at javax.faces.component.UIInput.validate(UIInput.java:354)
      at javax.faces.component.UIInput.processValidators(UIInput.java:184)
      Truncated. see log file for complete stacktrace

Caused By: java.lang.NoSuchMethodException: com.jsfcompref.register.UserBean.validateEmail(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
      at java.lang.Class.getMethod(Class.java:1605)
      at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:121)
      at javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.java:181)
      at javax.faces.component.UIInput.validateValue(UIInput.java:313)
      at javax.faces.component.UIInput.validate(UIInput.java:354)
      Truncated. see log file for complete stacktrace

 after click in register button whch appeared after clicking first link as in screenshot.

(Chapter 4 Examples
Non functional Register.jsp to show managed properties, Pages 55-56

Sports_Interests.jsp page showing further managed bean and property examples, Pages 57-74

--------------------------------------------------------------------------------


when i click link (at url http://localhost:7001/CR_CH04/)

Non functional Register.jsp to show managed properties, Pages 55-56)

Please advise how can i fix it. Any links ideas sample code, resources etc highly appreciated. Thanks in advance



jsf-ch4.JPG
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 250 total points
ID: 33714210
Can you post your JSP ?
0
 
LVL 6

Assisted Solution

by:__geof__
__geof__ earned 250 total points
ID: 33714269
Exactly as the error says. The method validateEmail doesn't exist. You need to create it. To do so, you need a class that implements Validator and register it in your faces-config.

See http://blogs.sun.com/johnc/entry/validating_an_email_address_in and/or http://www.roseindia.net/jsf/validator.shtml for examples.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question