Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8227853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:16:10+00:00 2026-06-07T16:16:10+00:00

How you might be able to read from the post title my question will

  • 0

How you might be able to read from the post title my question will be pretty newbish. I try to understand how to get JSF working with Eclipse and I tried to get a nice and famous Hello world running.

As a template I used the code from the Oracle Java EE 6 Book.

I created this ManagedBean – Hello.java in package de.kuntze

package de.kuntze;

import javax.faces.bean.ManagedBean;

@ManagedBean
public class Hello {
    final String world = "Hello World!";

    public String getWorld(){
        return world;
    }

}

Can’t get any easier… I use this with the following site to pair with – beanhello.xhtml:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
    <title>Facelets Hello World</title>
</h:head>
<h:body>
    #{hello.world}
</h:body>
</html>

Also pretty easy… Here comes the code for web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>CopyCat</display-name>
  <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>

I let this run on the Tomcat 7 server I integrated with Eclipse and the output looks fine for me so far – if I can serve any logging details let me know!

The project’s name is “CopyCat” and I expected it to see the managed Bean on my

http://localhost:8080/CopyCat/hello

but it gives me an 404 error same as the URL

http://localhost:8080/CopyCat/

and

http://localhost:8080/hello.

Am I just too stupid to see where my code goes or did I miss something? I know this question is very low level but I just don’t get it and don’t want to start coding with an existing project – which was already suggested to me :-/

Greetings and thanks in advance for any answers

André

UPDATE and somehow a solution

  1. Altogether the solution for the problem was using another URL:

    http://localhost:8080/CopyCat/faces/beanhello
    
  2. Using tomcat with eclipse gave me some errors (see below) and here are two things I can suggest so far (btw: The JSTL.jar was not necessary for that):

    a) Use the Eclipse workspace by coreservlets (http://www.coreservlets.com/JSF-Tutorial/jsf2/#Getting-Started) as a starting environment.

    b) Change the URL-pattern to *.jsf

    and reach the code with the URL

    http://localhost:8080/HelloWorld/beanhello.jsf
    

Hope this helps if you are in a similar situation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:16:13+00:00Added an answer on June 7, 2026 at 4:16 pm

    try http://localhost:8080/CopyCat/faces/beanhello

    cause your page name is beanhello.xhtml

    and your servlet-mapping url-pattern is /faces/*

    regarding your exception

    read this answer by BalusC Exception java.lang.NoClassDefFoundError in Dynamic Web Application, Eclipse, JSF

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Read answer number 1 from Tim Schmelter and then use this question for
The file_get_contents function doesn't seem to be able to read PHP code from .php
I need to be able to read QR codes from PDF files. I am
I was hoping somebody might be able to give me a hand by pointing
Does anyone knows how I might be able to implement variable arity for functions
Just wondered if any LINQ guru might be able to shed light on how
I was wondering how you might be able to update a CURL (PHP) request
FYI I'm programming in objective-C but anyone might be able to help. I've been
I'm a noob at this and was wondering if someone might be able to
I'm having some strange drawing artefacts that I'm hoping someone might be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.