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 9157383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:00:06+00:00 2026-06-17T13:00:06+00:00

I have a page called index.xhtml , in which I use variables from a

  • 0

I have a page called index.xhtml, in which I use variables from a bean class to fill the page with information. But when I start the file, it looks like it’s not using the bean.

My index.xhtml:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <script language="JavaScript" type="text/javascript" src="resources/tab-panel.js"></script>
        <link rel="stylesheet" href="resources/style.css" type="text/css" />
        <title>Tweetpage of #{userBean.name}</title>
    </h:head>

    <f:metadata>
        <f:viewParam name="user" value="#{userBean.name}" />
        <f:event type="preRenderView" listener="#{userBean.init()}" />
    </f:metadata>

    <h:body onload="bodyOnLoad()" onResize="raisePanel(currentMenuIndex)">
        <div class="loginbox">
            <h:link value="Login" outcome="user.xhtml" />
        </div>
        <div class="namebox">
            <h:outputLabel>User: #{userBean.name} </h:outputLabel>
        </div>
        <div class="detailsbox"> 
            <h:outputText>Name: #{userBean.getName()} </h:outputText>
            <h:outputText>Web: #{userBean.getWeb()} </h:outputText>
            <h:outputText>Bio: #{userBean.getBio()} </h:outputText>
        </div>

My UserBean.java:

@ManagedBean
@SessionScoped
public class UserBean implements Serializable {

    @Inject @Named(value = "userService")
    private UserService service;

    private String name;

    private User user;

    public UserBean() {

    }

My webpage looks like this:

User: #{userBean.name} 
Name: #{userBean.getName()}  

As you can see, it doesn’t say null or Dude, but I get the code in the page instead.
I navigate to the site using this URL: http://localhost:8080/Kwetter/index.xhtml?user=Dude

  • 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-17T13:00:09+00:00Added an answer on June 17, 2026 at 1:00 pm

    That will happen when the FacesServlet is not invoked. It’s the one responsible for performing all the JSF and EL works. You need to make sure that the request URL as you see in browser’s address bar matches the URL pattern of the FacesServlet as definied in web.xml. If you took the effort to view the HTML source code by rightclick, View Source in browser, then you should have noticed that all JSF tags are still unparsed instead of that their HTML representation is generated.

    So, if you’ve mapped it on *.jsf, then you should open it by http://localhost:8080/Kwetter/index.jsf?user=Dude instead.

    An alternative is to just remap the FacesServlet on an URL pattern of *.xhtml.
    This way you never need to worry about virtual URLs.

    See also:

    • JSF Facelets: Sometimes I see the URL is .jsf and sometimes .xhtml. Why?

    Unrelated to the concrete problem, the way how you’re using <h:outputText> is not right. Just get rid of them. You should also preferably not use the method expression syntax but just the value expression syntax.

    <div class="namebox">
        <h:outputLabel value="User: #{userBean.name}" />
    </div>
    <div class="detailsbox"> 
        Name: #{userBean.name}
        Web: #{userBean.web}
        Bio: #{userBean.bio}
    </div>
    

    See also:

    • Is it suggested to use h:outputText for everything?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic JSF page called Index.xhtml and a backing bean called TestBean.java.
I have a page called index.html which takes in a few variable from the
I have a page called index.php which is calling a function writelog in includes/Logger.php
I have a page called index.php which includes a page new_display.php which again includes
I have a page index.php where i have a link called add_users.php. In add_users.php,
I have a page called Error.php. Variables are usually passed to it using the
I have a page called send.email.php which sends an email - pretty simple stuff
I have a page called send.email.php which sends an email - pretty simple stuff
I have an html page called search.html which contains sliders, they work perfectly in
Actually im doing a home page that only have an action called Index() that

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.