Solved

JSF example errors

Posted on 2010-09-19
2
785 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now