Simple jsf 2.1/ajax page, example code?

hi,
ive created a dynamic web project in eclipse juno, it uses mojarra and tomcat.
i just want some kind of ajax behavior to get started, this is my xhtml page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core" >
<head>
<title>Insert title here</title>
</head>
<body>
     <h:form>
          <h:inputText id="myinput" value="">
               <f:ajax render="outtext" event="keyup" listener="#{loginBean.update}"/>
          </h:inputText>
          <h:outputText id="outtext" value="#{loginBean.eventCount}"/>       
     </h:form>
</body>
</html>and this is LoginBean.java:
import javax.faces.event.AjaxBehaviorEvent;
public class LoginBean {
     private int eventCount = 0;
     private String name;
     private String password;
     public String getName ()
          return name;
     public void setName (final String name)
          this.name = name;
     public String getPassword ()
          return password;
     public void setPassword (final String password)
     this.password = password;
     public void update (AjaxBehaviorEvent event)
        this.setEventCount(this.getEventCount() + 1);
     public int getEventCount() {
          return eventCount;
     public void setEventCount(int eventCount) {
          this.eventCount = eventCount;
}the error i get is: (right after starting the application, without any input)
Feb 25, 2013 10:14:58 PM com.sun.faces.renderkit.RenderKitUtils renderUnhandledMessages
INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=null[severity=(ERROR 2), summary=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.), detail=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.)]how can i fix this?

theres quite a lot of outdated information out there, even if you specify last year as max time search in google.
and there are even wrong ones, not just one. look at mykongs ajax example if you want to see ajax with a full page reload.
now with h:head and h:body the error is gone, but yet no ajax update when i type :(
updated login.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core" >
<h:head>
<title>Insert title here</title>
</h:head>
<h:body>
     <h:form>
          <h:inputText id="myinput" value="">
               <f:ajax render="outtext" execute="@this" event="keyup" listener="#{loginBean.update}"/>
          </h:inputText>
          <h:outputText id="outtext" value="#{loginBean.eventCount}"/>       
     </h:form>
</h:body>
</html>why is the ajax part still not working?
Edited by: 990254 on Feb 25, 2013 2:44 PM

Similar Messages

  • Steve, "Simple JSF Popup List of Values Page " does not work..

    Hi Steve,
    I read "Not Yet Documented ADF Sample Applications" #80 : "Simple JSF Popup List of Values Page " and download SimpleADFBCLOVJSF.zip, but when I try to run the sample, I get this error :
    JBO-33001: Cannot find the configuration file /xxx/common/bc4j.xcfg in the classpath
    What is wrong ?
    Thank you,
    xtanto

    Thanks for reporting this. I've uploaded a newer version of the zip file that fixes this issue.
    It was due to a last-minute refactoring of my model project from having the application module living in a package named "xxx" to another package named "example.model"

  • "Errors on page" with simple JSF page

    Hi
    I wrote a very simple JSF page as shown below. It works as is with MyFaces. Now I tried to make it work with Sun RI as well.
    Here's the problem: The page appears perfectly fine (it shows two columns of links). Only one single link works, though: the first one in the left column.
    When I click on that first link, the action handler method ("userClick") is called and executed fine.
    But when I click on any other link, the method is not called at all. All I get is an "error on page" message in the browser status bar. No log message on the command line or log file.
    Am I doing something wrong? With MyFaces it works fine.
    ===============================
    Here's the page:
    ===============================
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
         <f:loadBundle basename="ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle" var="bundle" />
         <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
         <html>
              <head>
                   <title><h:outputText value="#{bundle.menu_frame}" /></title>
                   <link rel="stylesheet" href="style.css">
              </head>     
              <body>
                   <h:panelGrid border="1" columns="2" columnClasses="td">
                        <h:dataTable value="#{MenuBackingBean.menuTabItems}" border="0" var="menuTabItem" >
                             <h:column>
                                  <h:form>
                                       <h:commandLink action="#{MenuBackingBean.userClick}" >
                                            <h:outputText value="#{menuTabItem.itemName}" />
                                            <f:param name="itemID" value="#{menuTabItem.itemID}" />
                                       </h:commandLink>
                                  </h:form>
                             </h:column>
                        </h:dataTable>
                        <h:dataTable value="#{MenuBackingBean.menuItems}" border="0" var="menuItem" >
                             <h:column>
                                  <h:form>
                                       <h:commandLink action="#{MenuBackingBean.userClick}" >
                                            <h:outputText value="#{menuItem.itemName}" />
                                            <f:param name="itemID" value="#{menuItem.itemID}" />
                                       </h:commandLink>
                                  </h:form>
                             </h:column>
                        </h:dataTable>
                   </h:panelGrid>
              </body>
         </html>
    </f:view>
    ==================================
    Here's the faces-config
    ==================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config >
         <application>
              <locale-config>
                   <default-locale>en</default-locale>
                   <supported-locale>en</supported-locale>
                   <supported-locale>de</supported-locale>
              </locale-config>
              <message-bundle>ca.gc.nrc.iit.eConservatoire.frontend.bundles.MessageBundle</message-bundle>
         </application>
         <managed-bean>
              <managed-bean-name>DetailsBackingBean</managed-bean-name>
              <managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.DetailsBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>MenuBackingBean</managed-bean-name>
              <managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.MenuBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>ContentBackingBean</managed-bean-name>
              <managed-bean-class>ca.gc.nrc.iit.eConservatoire.frontend.ContentBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/menu.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>showDetails</from-outcome>
                   <to-view-id>/details.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>menu</from-outcome>
                   <to-view-id>/menu.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/details.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>showMenu</from-outcome>
                   <to-view-id>/menu.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>showContent</from-outcome>
                   <to-view-id>/content.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/content.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>showMenu</from-outcome>
                   <to-view-id>/menu.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>
    =======================================
    I don't think I need to show the backing bean with the userClick() method since the error is that this method is not even called (I added a system.out.println() to this method - which is never executed)
    So the problem must be before
    BTW I am using Sun RI 1.1.01 as shipped with the MyEclipseIDE extensions.
    Thanks a lot for your very much appreciated help
    scrut

    The problem is that you have two forms. Put a single form.

  • [svn] 4595: Fix for - Example code in ObjectProxy ASDoc page is incorrect

    Revision: 4595
    Author: [email protected]
    Date: 2009-01-20 08:11:25 -0800 (Tue, 20 Jan 2009)
    Log Message:
    Fix for - Example code in ObjectProxy ASDoc page is incorrect
    Also modify the build.xml for "ant asdoc"
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-18335
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18335
    Modified Paths:
    flex/sdk/trunk/asdoc/build.xml
    flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectProxy.as

    >
    build url like this,
    '<a href=f?p='||NV('APP_ID')||':45:'||V('APP_SESSION')||'::NO:RP,45,CIR:ub_branch,ub_supplier,ub_customer,ub_product,ub_aging,ub_destination:'||REPLACE(branch,' ','%20')||'%2C'||REPLACE(ub_supplier,' ','%20')||'%2C'||REPLACE(ub_customer,' ','%20')||'%2C'||REPLACE(ub_product,' ','%20')||'%2C'||REPLACE(ub_aging,' ','%20')||'%2C'||REPLACE(ub_destination,' ','%20') ||'>All</a>',All of this is handled by the apex_util.url_encode API function as described above.
    However, as also mentioned above, the best approach is to only pass discrete key values in URLs.

  • Simple Server/Client Applet example code ???

    Hi to all.
    I would like to ask if possible to someone to tell me some example code to do this simple thing:
    I want an applet showing only a TextField and a button. When the user writes something on the textfield and press the button, it should send the text in the textfield to the "server", and then it should save it in a variable.
    I think there should be 2 different classes at least (server and client), but no idea in how could I make this on Java.
    So I am asking if possible for some sample code for make this.
    Thank you for the information
    John

    hello!
    Here is a console based Server which will recieve the string and disply on the DOS screen.
    /////////////////////////////////// Server /////////////////
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class ChatServer extends Thread
    ServerSocket ssSocket;
    Socket sSocket;
    public BufferedReader in;
    public PrintWriter out;
    public ChatServer()
         try
         ssSocket = new ServerSocket (4000);
         catch(IOException e)
         System.out.println (e);
    public void run()
    try
         sSocket = ssSocket.accept();
         if(sSocket != null)
              in = new BufferedReader(new InputStreamReader(sSocket.getInputStream()));
              out = new PrintWriter(sSocket.getOutputStream(), true);
    String str = in.readLine();
         System.out.println (str);
         catch(IOException e)
              System.out.println (e);
    public static void main (String []args)
              Thread th = (Thread) new ChatServer();
              th.start();     
    ///////////////////////// Client //////////////////////
    public class Client extends Applet implements ActionListener
    public Socket sClient;
    public BufferedReader in;
    public PrintWriter out ;
    String str;
    private TextField txt = new TextField();
    private Button btn = new Button ("OK");
    public void init()
         try
         sClient = new Socket ("localhost" , 4000);
         in = new BufferedReader(new InputStreamReader(sClient.getInputStream()));
         out = new PrintWriter(sClient.getOutputStream(), true);
         catch (UnknownHostException uhe)
         catch (IOException ioe)
         System.out.println (" I/O Exception : " + ioe);
         setLayout(new FlowLayout());
         txt.setColumns (20);
         add(txt);
         add(btn);
         btn.addActionListener(this);
    public void actionPerformed(ActionEvent AE)
         if(AE.getSource() == btn)
         str = txt.getText();
         out.println(str);
    now u should try it and improve it according to ur need...
    Ahmad Jamal.

  • Simple example code to connect to SQL server 2002

    Hi,
    I found a good website a while back which showed step by step how to connect to a sql server DB using JDBC, a re-install of windows means I cant find it again. I have searched the web, but to no avail. Basically I need to find a step by step guide to using java to access data within MS SQL server 2000. It needs to include details about where to download suitable drivers etc. and example code so that I can originally test my connection before diving much deeper.
    Any help much appreciated.

    Hi:
    here is the code that you can use it to test your connect if you use MS sql 2000 free driver. Others, you need to make little change on
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); and
    con = .......... parts
    goog luck !
    import java.sql.*;
    public class Connect{
    private java.sql.Connection con = null;
    private final String url = "jdbc:microsoft:sqlserver://";
    private final String serverName= "localhost";
    private final String portNumber = "1433";
    private final String databaseName= "pubs";
    private final String userName = "xxxxx";
    private final String password = "xxxxx";
    // Informs the driver to use server a side-cursor,
    // which permits more than one active statement
    // on a connection.
    private final String selectMethod = "cursor";
    // Constructor
    public Connect(){}
    private String getConnectionUrl(){
    return url+serverName+":"+portNumber+";databaseName="+databaseName+";selectMethod="+selectMethod+";";
    private java.sql.Connection getConnection(){
    try{
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con = java.sql.DriverManager.getConnection(getConnectionUrl(),userName,password);
    if(con!=null) System.out.println("Connection Successful!");
    }catch(Exception e){
    e.printStackTrace();
    System.out.println("Error Trace in getConnection() : " + e.getMessage());
    return con;
    Display the driver properties, database details
    public void displayDbProperties(){
    java.sql.DatabaseMetaData dm = null;
    java.sql.ResultSet rs = null;
    try{
    con= this.getConnection();
    if(con!=null){
    dm = con.getMetaData();
    System.out.println("Driver Information");
    System.out.println("\tDriver Name: "+ dm.getDriverName());
    System.out.println("\tDriver Version: "+ dm.getDriverVersion ());
    System.out.println("\nDatabase Information ");
    System.out.println("\tDatabase Name: "+ dm.getDatabaseProductName());
    System.out.println("\tDatabase Version: "+ dm.getDatabaseProductVersion());
    System.out.println("Avalilable Catalogs ");
    rs = dm.getCatalogs();
    while(rs.next()){
    System.out.println("\tcatalog: "+ rs.getString(1));
    rs.close();
    rs = null;
    closeConnection();
    }else System.out.println("Error: No active Connection");
    }catch(Exception e){
    e.printStackTrace();
    dm=null;
    private void closeConnection(){
    try{
    if(con!=null)
    con.close();
    con=null;
    }catch(Exception e){
    e.printStackTrace();
    public static void main(String[] args) throws Exception
    Connect myDbTest = new Connect();
    myDbTest.displayDbProperties();

  • Migrating to myfaces from simple jsf

    Hi all,
    I have been using simple Jsf API in my application until now. but i want to take advantage of myfaces... i want to migrate my current application to myfaces without much change in the code.. can anybody tell me how to do that ?
    thanx in advance

    Hey there !!!
    It's really simple. Download the latest myfaces 1.1.1 distribution & locate blank.war file in myfaces-examples zip file. Now remove all the jar files from WEB-INF/lib of your application & copy all the jar files from WEB-INF/lib of blank.war file to WEB-INF/lib of your application.
    Before removing jar files from WEB-INF/lib of your application take a backup of them. You might need them to resolve extra jar file references in your application. Now if you face any problem just post a message here.

  • Awesome Site with Example Code For All Classes

    Very cool site that has example code for all the Java classes and APIs. You can submit example code yourself too!
    http://www.kickjava.com/

    kevjava wrote: Some things that I think would be useful:
    Suggestions reordered to suit my reply..
    kevjava wrote: 2. Line numbering, and/or a line counter so you can see how much scrolling you're going to be imposing on the forum readers.
    Good idea, and since the line count is only a handful of lines of code to implement, I took that option. See the [line count|http://pscode.org/stbc/help.html#linecount] section of the (new) [STBC Help|http://pscode.org/stbc/help.html] page for more details. (Insert plaintiff whining about the arbitrary limits set - here).
    I considered adding line length checking, but the [Text Width Checker|http://pscode.org/twc/] ('sold separately') already has that covered, and I would prefer to keep this tool more specific to compilation, which leads me to..
    kevjava wrote: 1. A button to run the code, to see that it demonstrates the problem that you wish for the forum to solve...
    Interesting idea, but I think that is better suited to a more full blown (but still relatively simple) GUId compiler. I am not fully decided that running a class is unsuited to STBC, but I am more likely to implement a clickable list of compilation errors, than a 'run' button.
    On the other hand I am thinking the clickable error list is also better suited to an altogether more abled compiler, so don't hold your breath to see either in the STBC.
    You might note I have not bothered to update the screenshots to show the line count label. That is because I am still considering error lists and running code, and open to further suggestion (not because I am just slack!). If the screenshots update to include the line count but nothing else, take that as a sign. ;-)
    Thanks for your ideas. The line count alone is worth a few Dukes.

  • What's wrong about  "JSF that emits Ajax-widgets" on the server side?

    Hi,
    I just read this chat about Ajax on the server side and I wonder what this comment bellow means when we are building JSF application with Ajax:
    Another thing to consider is that in a pure Ajax application (i.e. one that's not a hybrid of a server-side technology like JSF that emits Ajax-widgets), the server can pretty much just respond to requests from the Ajax client in a stateless manner, and all of the state gets distributed to the client, greatly reducing the memory resources on the server. I'm working on an app like this for IBM Rational and we're really excited about the *decreased* load on the server by distributing state to clients.
    http://www.devwebsphere.com/devwebsphere/2006/04/ajax_and_its_im.html
    Thanks in advance.

    Just created a half an hour ago application:
    http://jsfbyexamples.com/facesTrace/
    shows that the AJAX request spends less time on the server even it walk though the whole life-cycle. This is a very small page, BTW. On the complicated page, the difference will be more significant. It is about server resources.
    About network traffic: Do you actually believe that sending the whole page produces less traffic than the portion updates? Just mathematically speaking?
    OK, I guess you mean the AJAX application requires traffic comes back and forward to produce the AJAX functionality. Non-AJAX application does not produce the traffic, but it does not produce the functionality you have in the first case.
    People who argue about it just try to compare Something to Nothing. So, where is the point?
    Sergey : http://jsfTutorials.net

  • Acrobat 7.0 ActiveX Object example code in Lookout

    Help folks!
    I'm trying to set up the Adobe Acrobat 7.0 Browser Document ActiveX Object under Lookout 6.0 but it doesn't work. My goal is to display a pdf document by lookout.
    What should I set by Property Browser...?
    What should I set by Property Pages...?
    What should I set by Value Property:?
    What means the term "Property" in this kind of objects?
    Is there an example code I can get?
    Any suggestion will be appreciated.
    Thanx.

    I don't know of a FREE ActiveX control for MS Word.  However, if you have MS Word installed on the same computer, you can use MS Internet Explorer ActiveX Control to view Word documents. 
    But before we do that, we have to make sure that MS Word is set to open documents in the "same window."  This basically opens a DOC file in Internet Explorer itself rather than launching a new MS Word window and then opening the DOC file in it.  To set this (if it isn't already):
    1. Launch Windows Explorer. 
    2. From the Tools menu, select "Folder Options"
    3. Click the "File Types" tab. 
    4. From the listing of "Registered File Types," select "Microsoft Word Document," (you can get to it fast by typing "DOC"); click Advanced. 
    5. Click the "Browse in same window" check box -- this toggles whether a Word document is launched outside of Internet Explorer. 
    6. Click OK to close the dialog boxes. 
    NOTE:  if the DOC still opens in a new MS Word window (and not IE), go back and toggle the check-box. 
    In Lookout, use the Lookout Webbrowser control (which is nothing but MS IE Control).  Specify the file path to the DOC file as the URL.  I am attaching a process file which does this using a TextEntry object. 
    Hope this helps.
    -Khalid
    PS:  not sure when this changed but we can't directly attach .L4P files to a post.. what a pain!  Please take a minute to add your weight to this request: 
    http://forums.ni.com/ni/board/message?board.id=130​&message.id=2142
    Message Edited by Khalid on 12-28-2005 02:55 PM
    Attachments:
    doc_process.zip ‏4 KB

  • Trying to add a simple applet to a web page

    Well, I was trying to add a simple applet to a web page(php nuke Home section), it didn't fin my applet, so I changed it and added it to a simple html file to make it as simple as I could get it.
    This is the code in the html file:
    <applet code="usblock.class" width="400" height="400">The browser doesn't support applets...</applet>The directory: www/usblock.html & www/usblock.java & www/usblock.class - As you can see the files are all in the same directory/folder.
    usblock.java code:
    import javax.swing.*;
    import java.awt.*;
    public class usblock extends JApplet
         public void init()
              JPanel p = new JPanel(new BorderLayout());
              p.add(new JLabel("Heisann"));
              add(p, BorderLayout.CENTER);
    }now as I open the html local on my computer, it workes. As soon as I open the usblock.html from my website, it doesn't.
    It gives me this error here:
    load: class usblock.class not found.
    java.lang.ClassNotFoundException: usblock.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 moreSo I thought it was that it couldn't find the .class file. Well, I went through the How To add applets that I found somewhere on sun.com. It had exactly the same as I had.
    Im figuring the problem is something easy and not hard to detect. But my eyes can't find it somehow. This is my second time trying applets, and I kinda forgot how I got it to work the first time.
    Im just glad for all the help I can get.
    Thanks a lot.
    LordSvae
    PS: Sry for the size of the post, but I'm not sure how much info I was supposed to put in here, so I thought the more the better, right? :S

    Hii,
    I doesn't know the solution but same kind of problem is come with me & I found that the problem is of Path i.e. you need to set a codebase attribute . For tempory solution what i do i simply copy the .class file in to html file dir.

  • JSF & JDev error: The page cannot be displayed

    I'm trying to use JSF with JDeveloper. When I make my project no errors are reported, when I run it a browser opens up with an error. I added 'faces/' to the url and refreshed but still get same error message i.e. 'The page cannot be displayed'
    Here is the url:
    http://localhost:8988/jsf_app1-jsftest2-context-root/faces/hellojsp.jsp
    Here is the web.xml code:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <!-- Faces Servlet -->
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup> 1 </load-on-startup>
    </servlet>
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <taglib>
    <taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
    <taglib-location>/WEB-INF/jsf_core.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
    <taglib-location>/WEB-INF/html_basic.tld</taglib-location>
    </taglib>
    </web-app>
    Here is the faces-config.xml code:
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
    </faces-config>
    Here is the hellojsp.jsp code:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
    </head>
    <body>
    <h:form>
    <h:outputText/>
    </h:form>
    </body>
    </html>
    </f:view>
    Please let me know what i'm missing here. Why can I not see the page?

    When I make my project no errors are reported, when I run it a browser opens up with an error. I added 'faces/' to the url and refreshed but still get same error .
    Does the url which is invoked with Run not include a /faces/ url pattern?

  • Sending email from a simple JSF Form

    Hi,
    Sorry if this is a very basic question. I have a simple JSF (with ADF BC) form that collects information and I store the submitted values in the backing bean. I am even able to display the input values in a than you page. I just want a pointer on how I can use this data in the backing bean to email that data.
    I have tried importing the JavaMail.jar and activation.jar files into my project and tried a few sample java programs I found to do this simple task. But, I am not sure I am importing the right classes to use this in a JSF program. For eg. this program right here.. not sure if the oracle.jbo.Session is the right class to import for Session.
    package view.beans;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import oracle.jbo.Session;
    public class javaMailer{
        public javaMailer() {
        public void postMail( String recipients[ ], String subject, String message , String from) throws MessagingException
            boolean debug = false;
             //Set the host smtp address
             Properties props = new Properties();
             props.put("mail.smtp.host", "smtp.jcom.net");
            // create some properties and get the default Session
            Session session = Session.getDefaultInstance(props, null);
            session.setDebug(debug);
            // create a message
            Message msg = new MimeMessage(session);
            // set the from and to address
            InternetAddress addressFrom = new InternetAddress(from);
            msg.setFrom(addressFrom);
            InternetAddress[] addressTo = new InternetAddress[recipients.length];
            for (int i = 0; i < recipients.length; i++)
                addressTo[i] = new InternetAddress(recipients);
    msg.setRecipients(Message.RecipientType.TO, addressTo);
    // Optional : You can also set your custom headers in the Email if you Want
    msg.addHeader("MyHeaderName", "myHeaderValue");
    // Setting the Subject and Content Type
    msg.setSubject(subject);
    msg.setContent(message, "text/plain");
    Transport.send(msg);
    Thanks in advance for your time.
    Edited by: Karthik on Nov 10, 2008 10:20 AM

    Thanks John. Stupid me. I added the jar files to my Web-INF folder but never added the jar files to the ViewController project through the Project Properties window. Once I did that, the errors disappeared.
    Thanks for your help! :-)

  • About creating an AJAX page with DML procedures  using dynamic actions

    About creating an AJAX page with DML procedures in APEX using dynamic actions. Help with limitations.
    I want to share my experience, creating AJAX procedures in APEX 4.0.
    LIMITATIONS
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??
    Here are the steps to create an AJAX Updatable Form using the sample table DEPTS. You can see the demo here: [http://apex.oracle.com/pls/apex/f?p=15488:1]
    1)     Create a blank page
    2)     Add a Report Region for departments (It shows the columns deptno, dname and loc).
    3)     Add an HTML Region and create the elements to edit a Department.
    a.     P1_DEPTNO (Hidden to store PK)
    b.     P1_DNAME (Text Field)
    c.     P1_LOC (Text Field)
    4)     You also have to create a hidden element called P1_ACTION. This will help to trigger dynamic actions to perform DMLs.
    5)     Open Page Attributes and in the HTML Header Section include the following code.
    <script>
         function doSelect(pId){
              $x_Value(‘P1_DEPTNO’,pId);
              $x_Value(‘P1_ACTION’,’SELECT’);
    </script>
    6)     Modify the column DEPTNO in the report, to add column link. In the link text you can use #DEPTNO# , in target you must select ‘URL ‘ and in the URL field write javascript:doSelect(#DEPTNO#);
    7)     Create the following Buttons in the Form Region.
    CANCEL     Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CANCEL’);
    NEW          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’NEW’);
    SAVE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’UPDATE’);
    CREATE          Redirects to URL: javascript:$x_Value(‘P150_ACTION’,’CREATE’);
    8)     Create the following Dynamic Action to Select a Department
    Name:     Select Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     SELECT
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    SELECT dname, loc
    INTO :P1_DNAME, :P1_LOC
    FROM dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    The first limitation, the value of page elements don’t do refresh so I added the following true actions to the dynamic action AFTER Execute PL/SQL Code.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     (none) (leave it blank)
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    9)     Create the following Dynamic Action to Update a Department
    Name:     Update Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    UPDATE dept SET
    dname = :P1_DNAME,
    loc = :P1_LOC
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    10)     Create the following Dynamic Action to Create a Department
    Name:     Create Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     CREATE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    INSERT INTO dept(deptno,dname,loc)
    VALUES (:P1_DEPTNO,:P1_DNAME,:P1_LOC);
    Page Items to Submit:     P1_DEPTNO, P1_DNAME, P1_LOC     
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions BEFORE the Execute PL/SQL Code true Action.
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Function Body
    PL/SQL Function Body:     
    DECLARE
    v_pk NUMBER;
    BEGIN
    SELECT DEPT_SEQ.nextval INTO v_pk FROM DUAL;; -- or any other existing sequence
    RETURN v_pk;
    END;
    Page Items to submit:     P1_DEPTNO
    Affected Elements: Item P1_DEPTNO
    Action:     Set Value
    Unmark *‘Fire on page load’* and *‘Stop execution on error’*
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_DNAME
    Page Items to submit:     P1_DNAME
    Affected Elements: Item P1_DNAME
    Action:     Set Value
    Unmark ‘Fire on page load’ and ‘Stop execution on error’
    Set Type:     PL/SQL Expression
    PL/SQL Expression:     :P1_LOC
    Page Items to submit:     P1_LOC
    Affected Elements: Item P1_LOC
    These actions allow refresh the items display value.
    Finally to refresh the Departments report, add the following true action at the end
    Action:     Refresh
    Affected Elements: Region Departments
    11)     Create the following Dynamic Action to delete a department
    Name:     Delete Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     DELETE
    Action:     Execute PL/SQL Code
    PL/SQL Code:     
    DELETE dept
    WHERE deptno = :P1_DEPTNO;
    Page Items to Submit:     P1_DEPTNO
    Don’t include any false action and create the Dynamic Action.
    Include the following True Actions AFTER the Execute PL/SQL Code true Action.
    Action:     Refresh
    Affected Elements: Region Departments
    Action:     Clear
    Unmark ‘Fire on page load’
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC
    12)     Finally Create the following Dynamic Action for the NEW event
    Name:     New Dept
    Event:     Change
    Selection Type:     Item(s)
    Item(s):     P1_ACTION
    Condition:     equal to
    Value:     NEW
    Action:     Clear
    Unmark *‘Fire on page load’*
    Affected Elements: Items P1_DEPTNO, P1_DNAME, P1_LOC

    I need some help to solve this issues
    •     How Can I Hide UPDATE button while I press NEW button. ??
    •     How Can I Hide CREATE button while I’m UPDATING A RECORD. ??
    •     How can I avoid multiple Inserts or Updates. ??

  • Validator isn't fired when using example code from chapter 40: Validating Data

    When following example code, mentioned in the Flex Developer
    Guide on page 1282 is copied into an mxml example application and I
    run the application, validation is never fired.
    When I have a look at other example code, which is using the
    listener- and trigger-property on the validator everything works
    fine.
    Could you explain why the example code from the Dev-guide
    doesn't work as mentioned in the guide?

    Nathalie,
    I believe you need to specify the "trigger" and "listener"
    properties as well. For more information, see the last example on
    this page:
    http://livedocs.adobe.com/flex/201/html/validators_093_04.html

Maybe you are looking for

  • Ipod nano 6th gen not recognized in itunes

    I recently purchased a used "AS IS" ipod nano 6th gen. The only problem with it is that it's not recognized by iTunes. I was fairly sure on purchasing it that solving this would be as simple as resetting it, or, at worst, figure it out by googling th

  • Calendar Sync Taking Forever (iCal)

    I'm trying to sync my iCal calendars and its taking forever to sync. I left it running for several hours and it did not stop. I fear burning the green battery in on my new iPhone's screen so I've stopped the sync several times. I tried it on my other

  • Order QTY should not exceed than reference document

    Dear Gurus, I am creating a Release order with reference to Contract. Ex. order qty is 100 in Contract, while doing sale order it should not allow to change the order qty more than 100 [not more than Ref. document qty]. I have tried in VTAA, completi

  • XML Parser & UTF-8

    1. OracleXML Parser for PL/SQL can not parse XML docs encoded in UTF-8 format containing swedish E, D, V. 2. I can save XML(UTF-8) docs as CLOBs but E, D, V are not searchable with intermedia. Using: DB: 8.1.6 Oracle XML Parser for PL/SQl 1.0.2 DB ch

  • HP 7520 - Printer in Use - won't print from MAC

    I have installed the the HP7520 on my MAC computer.  I am connected wirelessly.  When I attempt to print I get the message that the 'printer is in use'.  I can access the printer from other computers in the house (non-Mac) and I can also print a test