Can't get JSF to access managed bean methods from web page

I'm using NetBeans 6.7.1 and Glassfish v2.1
Having problems here can somebody please help? It is really
frustrating because I have written apps like this before in fact I
used one as a model to create an even simpler app and still can't get
it to work. I ran it through the debugger and it stops in the
constructor so it looks like the bean object is being created, but the
setUid method and the testit method are not being entered when I click
on the enter commandbutton. Can somebody PLEASE give me an idea as to
what might be going on? I am totally stumped and this is holding up
some important work I need to get done. Any help would be greatly
appreciated:
web.xml:
- Show quoted text -
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<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>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/welcomeJSF.jsp</welcome-file>
</welcome-file-list>
</web-app>
faces-config.xml:
<?xml version='1.0' encoding='UTF-8'?>
<!-- =========== FULL CONFIGURATION FILE ================================== -->
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<managed-bean>
<managed-bean-name>testbean</managed-bean-name>
<managed-bean-class>com.lingosys.quoteest.testbean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/go.jsp</from-view-id>
<navigation-case>
<from-outcome>correct</from-outcome>
<to-view-id>/ok.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
</faces-config>
go.jsp:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%--
This file is an entry point for JavaServer Faces application.
--%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>JSP Page</title>
</head>
<body>
<f:view>
<h1>JAS Generator</h1>
<p/>
<h:form id="testForm" enctype="multipart/form-data" >
<p/>Both fields are required.
<p/>Enter Test ID: <h:inputText id="pid"
value="#{testbean.uid}" required="true"/>
<p/><h:commandButton value="Enter"
action="#{testbean.testit}"/>
</h:form>
</f:view>
</body>
</html>
testbean.java:
* To change this template, choose Tools | Templates
* and open the template in the editor.
package com.lingosys.quoteest;
* @author mphoenix
public class testbean {
private String uid;
public testbean() {
int x=0;
public String getUid() {
return uid;
public void setUid(String uid) {
this.uid = uid;
public String testit() {
return "correct";
}

MikePhoenix wrote:
enctype="multipart/form-data"
Why?
Oh, in the future please post code in code blocks. Use the CODE button to get them. Use the Preview tab to see if anything went right.

Similar Messages

  • How can I get a song to play automatically on a web page ?     iWeb 1.1.2

    Can I get a song to play automatically when my web page opens? iWeb 1.1.2

    As long as you don't mind doing a little post publish editing of your .js files, it's fairly easy to do. You will find them in this path on your iDisk, using the Go menu in Finder:
    Go/iDisk/MyiDisk/Sites/iWeb/Nameofsitefolder/Page_filesFolder/Page.js
    Open the .js files for that particular page on your iDisk with any text editor (I like Taco, and it's free) and make the following changes to the script code that controls your movie: (you will find the movie code near the top of the page in the .js file)
    Change autoplay="false" to autoplay="true"
    Change loop="false" to loop="true"
    Changing controller value="true" to controller value="false" will remove the controller from the page entirely. Make these changes in both sets of tags, (object and embed).
    Make the changes and just "Save". Clear your browser cache and you should see the changes take effect immediately. Bear in mind you will have to make this modification each time you republish your site. You can also save this modified .js file and replace the republished file with it, as long as no other changes were made to the page in iWeb.
    -Mark

  • How to call different managed bean methods on a page template button

    Dear All,
    Use Case:
    I have a Page Template and inside this page template is a popup screen which is common to all my
    pages. My popup has OK and Cancel button only.
    My question is this, there are lots of pages that uses this template.
    How is it possible to invoke a managed bean methods dialoglistener when say for example the user clicks the OK button?
    One thing common among the pages is that they are included in some kind of a taskflow and I have configured
    a managedbean in a pageflowscope variable in each taskflow and I just wanted to pass the
    My Template
         - TaskFlow 1 (ManagedBean1.dialogListener)
         - TaskFlow 2 (ManagedBean2.dialogListener)
         - TaskFlow 3 (ManagedBean3.dialogListener)
    Each dialog listener does different things.     
    How to do this?
    JDEV 11G PS3
    Thanks

    Found my answer here... http://www.oracle.com/technetwork/developer-tools/adf/learnmore/79-global-template-button-strategy-360139.pdf
    Thanks!

  • Is it possible to call any Managed Bean method from af:goLink

    Hi,
    I am using RichGoLink component.
    Is it possible to call a managed bean method on click of the af:goLink? I want to provide some validations when user clicks on the goLink.
    There is no any actionListener provided.
    Thanks in advance.

    Hi,
    I am able to resolve my second problem also.
    i wanted to set the "destination" of the goLink on the fly. To do this I created a custom componnt by extending the RichGoLink and I override the encodeBegin method in that class. In this method i check my condition and then set the "destination" property.
    I am still using the clientListener and the serverListerner to do some further testing that i wanted to. Here one thing you have to keep in mind that. In the javascript function that we are calling in the clientListener should not do the "cancel" on the event object, if you do so it will not navigate to the required position.
    Thanks for the way you showed to resolve my problem. Hope you understand the way i worked for this solution.

  • Accessing managed-beans property from simple java class

    I have managed bean that is registered in faces-config.xml:
    <managed-bean>
    <managed-bean-name>documentReportsBean</managed-bean-name>
    <managed-bean-class>[myApp].beans.DocumentReportsBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    I want to access property of documentReportsBean from other java class without registering managed-property in faces-config. How can I do that?

    Thank you, what I needed was someone saying the right word. "ValueBinding" in this case.. :)
    Two lines:
    ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{documentReportsBean}");
    DocumentReportsBean pbean = (DocumentReportsBean) vb.getValue(FacesContext.getCurrentInstance());
    gives my full control. Nice

  • HT2573 I can't get safari to load the apple express lane web page post mountain lion upgrade ? Other pages now also will not load

    Post the lion upgrade safari will now not load some pages....apple express lane start page for one....other secure sites such as web payments sites too.  Also I can not get AirPlay mirroring on safari.....which works fine on the ipad.
    I have tried downloading and installing the update twice....no change.
    Any ideas !
    Thanks
    Ep

    Followed a thread on one of the other message boards and fixed it....by reinstalling Rapport. now seems to work fine.
    ep

  • I can't get rid of ads when I open a web page. (power by ads)

    every time I click on something a pop up come ups. Not sure how I got it but can't make it stop.

    Do a malware check with several malware scanning programs on the Windows computer.
    Please scan with all programs because each program detects different malware.
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender:<br>http://windows.microsoft.com/en-us/windows/using-defender
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    *https://support.mozilla.org/kb/troubleshoot-firefox-issues-caused-malware

  • How can I get Firefox to display 'preview in browser' Dreamweaver Web-page files?

    I chose Firefox as the primary browser for Adobe Dreamweaver's 'Preview in Browser' to display Web pages as I develop them. '''Firefox used to work just fine'''. Recently, however, when choosing Firefox to Preview in DW, FF merely opens to my home page. Once opened, FF will not accept/preview any files from Dreamweaver, regardless of how many times I choose to Preview. Safari and others - when selected as the preview browser - display them perfectly.
    PPC Mac, OS X 10.4.11, Firefox v. 3.6.21

    Have you tried the update to Fast Dial, version 4.2.1 or later? It should override the built-in new tab page: https://addons.mozilla.org/en-US/firefox/addon/fast-dial-5721/ ''(Note: I haven't tested it myself)''
    If you are using a similar add-on that isn't the same "Fast Dial", which one is it?

  • When i try to access iwork on iCloud on my mac, i get an ipage logo with 2 options learn/get image. I already have ipage on my mac. How can i get to the file  management page?

    When i try to access iwork on iCloud on my mac, i get an ipage logo with 2 options learn/get image. I already have ipage on my mac. How can i get to the file  management page?

    Lion will only let you add documents to iCloud through iCloud.com, iCloud.com requires the iOS apps before you can use it.
    Mountain Lion will let you add documents to iCloud from the iWork apps themselves, you don't then need the iOS apps before they can be opened on another Mac.

  • Accessing managed-bean in a JSP (portal theme).

    I have a tricky situation where I need to access a managed-bean outside a JSF jsr 168 api portlet. Now I need to reference the bean in the themes jsp (just fyi themes loosely relate to JSP's which control the look and feel, navigation within portal page). I was thinking of a way to set a managed-bean variable in the jsp before the portlet where the managed-bean is declared. Is this possible ? Any ideas ?

    You can just access managed beans using JSTL EL.${myBean}or if you strictly want to specify the scope, e.g. session scope${sessionScope.myBean}where "myBean" is the managed bean name. Keep in mind that you cannot use this in input elements, but only in output elements. If you want to use this in input elements, then you should be using JSF components with deferred EL #{myBean.input} and so on.

  • Accessing Managed Beans from Code

    Hi,
    How can I access managed beans from my code? I am too new to JSF to know if what I am doing is right from a design perspective. But what I am trying to do is to use Actions as sort of a Web Facade that aggregates state from other beans (all of them Managed beans right now) to build up state that is necessary for displaying pages.
    Thanks for you help
    Suhail

    Just answering my own question. The answer was given in a different thread (http://forum.java.sun.com/thread.jsp?forum=427&thread=427057&message=1901909#1901909) . JSF has provided various Factories (look at the FactoryFinder API) that allow one I presume to access the internal state of a FacesContext. One of the factory is ApplicationFactory. This factory from what I can make out essentially gives you access to everything (actionlisteners, navigationhanlder,components etc) in you application. My original question was about accessing something (for some reason) named ValueBinding. I can access the managed beans declared in my faces-config.xml by invoking getValue(facesContext). I can naturally also set the value of a bean by invoking setValue(...). I just needed the getValue and it seems to work.
    Ofcourse keep in mind that the underlying managed bean will not necessarily be initialized when you access it so test for nullness. As a general rule I think its best not to create the beans but access them using this facility. After all its not for nothing these are called Managed Beans.
    Now if only the faces implementation would persist the changes to Navigation hanlders that one makes in the code ;-)

  • Accessing Managed Bean Variables in Entity Impl Class

    How can I access managed bean variables in the entity Impl class .
    While inserting a new record in DB , i want to set few entity properties values . The values of those properties are available in the managed bean .
    How can i access those values from Managed Bean and set them the entity Impl class to override the create method.
    Or is there any better recommended approaches ?
    Jdev - 11.1.1.5

    >
    While inserting a new record in DB , i want to set few entity properties values .
    >
    you can user CreateWithparams
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    http://andrejusb.blogspot.com/2011/02/createwithparams-operation-for-oracle.html

  • TS1363 I have windows 8  and itunes 11.1 ... it identifies my iphone 4 but insists that I either update my phone to OS 7 or restore to by basic 6.1.3 OS  I don't want to do either.  How can I get  itunes to access my iphone ?

    I have windows 8  and itunes 11.1 ... my laptop identifies my iphone 4 but  itunes insists that I either update my phone to OS 7 or restore to by basic 6.1.3 OS  I don't want to do either.  How can I get  itunes to access my iphone ?

    RealPlayer can cause conflicts with Flash Player because it tries to assign EVERY TYPE of video or audio file to itself by default. I haven't used RealPlayer in years for that reason. It's an unnecessary program anymore. There are apps loike VLC media player that cna do EVERYTHING it does without conflicting with other apps like Flash Player.
    With WIndows 8, Microsoft began embedding FlashPlayer themselves into Internet Explorer. Because of that, you cannot download and install it from here. You cannot uninstall it from Internet Explorer without removing a specific Windows Update first. And you cannot update it via this website. ONLY through Windows Update can Flash Player for Internet Explorer be updated.
    That said, you probably DON'T have a virus that's causing the problems with Flash Player and Internet Explorer. Many, many websites are not "recognizing" the browser.
    This is a known problem with Internet Explorer 11, which Microsoft has been aware of since October 18 when they released IE11 The pages can't recognize the browser, so they don't recognize any of the plugins, like Flash Player.
    So far, Microsoft has made NO indication that they have any plan to fix it soon.
    Microsoft's recommendation is to use Compatibility View for affected pages, and "pretend" you're using an different browser. Trouble with that is it has seen limited success at best, and you have to individually enable it for EVERY page that has problems.
    I'm not big on "pretending" so I recommend actually using another browser.
    Firefox (from Mozilla)
    Opera (from Opera)
    Safari (from Apple)
    Chrome (from Google)
    ANY of those will work where IE11 won't, with the Flash Player Plug-in (For all other browsers), and Chrome doesn't even need that because it has its own Flash Player plugin built in.

  • How to call Backing Bean method from href tag in JSF. -- URGENT

    Hi guys,
    i am new to JSF. i want one option. how to call a backing bean method from href.
    I searched a lot. i found one component <commandLink>, but i cann't use <commandLink> i have to use only href which is client instructions.
    If anyone knows pls help me. Its Urgent. If u can, give me the code also.
    Suggestions will be appreciated.
    Thanks
    Rajesh

    You can make use of the constructor of the backing bean or the @PostConstruct annotation if you want to use managed properties.
    You may get some ideas out of this: [http://balusc.blogspot.com/2006/06/communication-in-jsf.html].

  • Two managed beans in same jsp page

    Hello
    First this could be a stupid question, but i just can't find a solutions on this problem.
    I wondering that could it be a two managed beans in same jsp page, here is a example:
    index.jsp
    <t:commandLink disabled="#{listBean.currentPage == 1}" id="previous2" type="button" immediate="true" style="font-size:small" action="#{listBean.previousPage}">
    <h:outputText value="Edellinen" id="prev"/>
    </t:commandLink>
    <t:commandLink disabled="#{listBean.currentPage == listBean.totalPages}" id="next2" type="button" immediate="true" style="font-size:small;" action="#{listBean.nextPage}">
    <h:outputText value="Seuraava" id="next"/>
    </t:commandLink>
    then i have a dataTable like this:
    <t:dataTable value="#{customerListBean.customerBeans}"
    binding="#{customerListBean.dataTable}" preserveDataModel="true" style="text-align:left">
    My problem is that when i push a commandLink it doesn't refresh a dataTable. Does anyone know a solution here or is this just a impossible way to do it?
    Thanks for help.

    when i push nextPage (commandLink) it's call action
    and count a new range of dataset and after that it's
    calls a method which is declared on subClass and that
    method get a new data of database on given params.
    and put it on DataTable.
    So listBean is upper class and customerListBean
    extends on ListBeanNo, it doesn't work that way as you expected. You have created two independent instances. They doesn't communicate automatically with each other or so. Just use one CustomerListBean instance and call the inherited methods of ListBean on the #{customerListBean} managed bean instance.

Maybe you are looking for

  • Dynamic Tray creation at runtime

    hi experts, we have a requirement where we are showing employee details in the tray UI element. we have 1 tray at design time showing employee details obtained from a Bapi. Now we need to display spouse details(if available) and children details(thei

  • CUCM 8.6 Manager Assistant Console

    I am currently setting up a test setup of the Manager Assistant Console in proxy mode and have a few questions about the proxy lines and the intercom lines. In the setup guide, Manager and Assistant Phone Configurations tell you to configure the phon

  • Second Ati 3870 and STILL noisy!

    Hi, I just got a replacement Ati radeon 3870 because the first cards fans didn't run at all for a minute or so and would then spin up full for 30 seconds or so and so forth, regardless of what i was doing. My replacement card came today but this card

  • How to Install EU Firmware version on my E52

    Hi there. I just got a Nokia E52, with firmware version: 022.009.C00.01, Type RM - 469. I cant read Vietnamese font, and my friends said i have to install EU versions of firmware. How could i do that? When i use Ovi suit, it updated automatically, no

  • Folder Retrieval in Win 7

    By Mistake I have deleted a folder thru Shift+del option. I want the recovery of this folder......tell me how to retrieve this folder.