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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:54:31+00:00 2026-06-09T20:54:31+00:00

I have the following code and whatever I do my web browser does not

  • 0

I have the following code and whatever I do my web browser does not render any submit button.

I am using eclipse with Glassfish.

The problem is also that somehow when I try my examples fast , the server sometimes hangs around and browser is in the waiting mode for minutes without any error or anything.

Sometimes it does give the page away and it works perfect.

Why is the button not shown and my server is so unstable?

<h:head><title>JSF 2: Using @ManagedBean</title>
<link href="./css/styles.css" 
      rel="stylesheet" type="text/css"/> 
</h:head>
<h:body>
<div align="center">
<table class="title">
  <tr><th>JSF 2: Using @ManagedBean</th></tr>
</table>
<p/>
<fieldset>
<legend>Random Results Page</legend>
<h:form>
  Press button to get one of three possible results pages.
  <br/>
  <h:commandButton value="Go to Random Page" action="#{navigator.choosePage}" />
</h:form>
</fieldset>
</div>




 package coreservlets;
import javax.faces.bean.*;

@ManagedBean
@ApplicationScoped 
public class Navigator {
  private String[] resultPages =
    { "page1", "page2", "page3" };

  public String choosePage() {
    return(RandomUtils.randomElement(resultPages));
  }
}
  • 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-09T20:54:32+00:00Added an answer on June 9, 2026 at 8:54 pm

    That can happen if you either forgot to declare the h: XML namespace, causing the <h:xxx> tags being unrecognized. This can be confirmed by just looking at the JSF source code and the generated HTML output (rightclick – View Source in browser).

    <html ... xmlns:h="http://java.sun.com/jsf/html">
    

    Or the request URL as you see in browser’s address bar didn’t match the <url-pattern> of the FacesServlet as mapped in web.xml, causing the <h:xxx> tags being unparsed. This can be confirmed by just looking at the request URL, the web.xml and the generated HTML output.

    <url-pattern>*.xhtml</url-pattern>
    

    Or the CSS in styles.css has hidden it in some way. This can be confirmed by checking the CSS file, and/or using the browser’s developer toolset and/or checking the generated HTML output.

    input[type=submit] {
        display: none; 
    }
    

    See also:

    • Our JSF wiki page – contains a Hello World example and several tutorial links

    Unrelated to the concrete problem, using an application scoped bean for the particular use case is quite strange. It’s been shared among all users in all sessions. So if the action is invoked by webapp user X elsewhere in the world, all other webapp users over the world would see it being reflected. Wouldn’t you rather use a request or view scoped bean?

    See also:

    • How to choose the right bean scope?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code: def whatever(url, data=None): req = urllib2.Request(url) res = urllib2.urlopen(req, data)
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
I have following code for inserting data into database using PDO. It inserts data
I have following code using hibernate to throw a custom exception on error and
I am using ASP.NET and in my .aspx page I have the following code,
I have the following code in a .erb file: <% embed='<a href=http://someurl.com/whatever>#{@webcast.name}</a>'%> <p id=embedCode>
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have following code for loading image from url in xml parsing endElement method
I have following code. ASPX Page <a href=AnyASPXPageOfWebsite.aspx onclick=javascript:CallJQuery(); > Set Price </a> JS

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.