JSF 1.2 + myFaces Tomahawk

Hi,
I'm trying to use tomahawk component (t:inputFileUpload) in JSF 1.2 application.
When I'm runing the app this kind of warrning apperas
2007-04-23 15:39:41 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer getForComponent
WARNING: Unable to find component with ID cover in view.
2007-04-23 15:39:41 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer getForComponent
WARNING: Unable to find component with ID cover in view.cover is an ID of tomahawk component.
Can somebody help?
Thx in advance

Amittev,
Thank you. I really appreciate your help. Now the examples are working just fine in my computer.
By the way, I have another question for you considering your kindness taken your time to share your expertise.
I'm facing a Tiles and Facelets dilema. Which framework do you recomend me to invest my time learning it??.
Thanks again for your time and consideration.

Similar Messages

  • JSF: Using of MyFaces Tomahawk UI Components

    Hello,
    is it possible to use MyFaces Tomahawk UI Components or other MyFaces UI Components with the SAP NetWeaver CE 7.1 Application Server?
    Regards,
    Armin

    MyFaces Tomahawk works!
    workaround:
    1. Copy commons-el-1.0.jar, commons-fileupload-1.0.jar, commons-lang-2.1.jar, commons-logging-1.1.1.jar and tomahawk-1.1.6.jar into the lib folder.
    2. Add the following lines to your web.xml file:
    <!-- Extensions Filter -->
    <filter>
            <filter-name>extensionsFilter</filter-name>
            <filter-class>
                    org.apache.myfaces.component.html.util.ExtensionsFilter
            </filter-class>
            <init-param>
                    <description>
                            Set the size limit for uploaded files. Format: 10 - 10
                            bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
                    </description>
                    <param-name>uploadMaxFileSize</param-name>
                    <param-value>100m</param-value>
            </init-param>
            <init-param>
                    <description>
                            Set the threshold size - files below this limit are
                            stored in memory, files above this limit are stored on
                            disk.
                            Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
                    </description>
                    <param-name>uploadThresholdSize</param-name>
                    <param-value>100k</param-value>
            </init-param>
            <!--
            <init-param>
                    <param-name>uploadRepositoryPath</param-name>
                    <param-value>/temp</param-value>
                    <description>Set the path where the intermediary files will be stored.
                    </description>
            </init-param>
            -->
    </filter>
    <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <url-pattern>*.faces</url-pattern>
    </filter-mapping>
    <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <url-pattern>/faces/*</url-pattern>
    </filter-mapping>

  • Myfaces, tomahawk, jsf sun

    Hello,
    what is the relationship between myfaces and tomahawk. And if i want to develop a myfaces app do i have to use jsf sun components?
    thanks

    Hello,
    what is the relationship between myfaces and
    tomahawk. And if i want to develop a myfaces app do i
    have to use jsf sun components?
    thanksFrom http://myfaces.apache.org/tomahawk/
    In addition to custom components not found in the JSF specification, the MyFaces components bundle also includes an "extended" version of some of the default components. These are basically components that exist in either the core or html tag libraries but additional functionality has been addded that goes beyond the specification.
    Summarized: MyFaces implements JSF spec and Tomahawk goes beyond JSF spec.

  • Using myfaces tomahawk inputFileUpload componet

    I am using myfaces tomahawk inputFileUpload componet for the following requirement
    1. I need to upload images to my user profile page.
    2. Resize the image to fit my desired image size to be shown on the page
    Promblems
    1. The file i upload is done fine and images also show but
    the image is stored or refrenced to the local machine , so if i delete or change file location the image dosent show.
    what i need is to store the images in a seperate folder on the server or any other place and image should point to that location.
    2. Now the image uploaded displayed using jsf's
    <h:graphicImage url="fileupload_showimg.faces"/>component where "fileupload_showimg.faces"
    is a jsp page containing the following code
    which is a scriplet
    <%@ page import="java.io.File,
                     java.io.InputStream,
                     java.io.FileInputStream,
                     java.io.OutputStream"%><%@ page session="false" %><%
        String contentType = (String)application.getAttribute("fileType");
        String fileName = (String)application.getAttribute("fileName");
        String allowCache = request.getParameter("allowCache");
        String openDirectly = request.getParameter("openDirectly");
        if(allowCache == null || allowCache.equalsIgnoreCase("false"))
            response.setHeader("pragma", "no-cache");
            response.setHeader("Cache-control", "no-cache, no-store, must-revalidate");
            response.setHeader("Expires", "01 Apr 1995 01:10:10 GMT");
        if(contentType!=null)
            response.setContentType(contentType);
        if(fileName != null)
            fileName = fileName.substring(fileName.lastIndexOf('\\')+1);
            fileName = fileName.substring(fileName.lastIndexOf('/')+1);
            StringBuffer contentDisposition = new StringBuffer();
            if(openDirectly==null || openDirectly.equalsIgnoreCase("false"))
                contentDisposition.append("attachment;");
            contentDisposition.append("filename=\"");
            contentDisposition.append(fileName);
            contentDisposition.append("\"");
            response.setHeader ("Content-Disposition", contentDisposition.toString());
        byte[] bytes = (byte[])application.getAttribute("fileSizeBytes");
        if (bytes != null)
             response.getOutputStream().write(bytes);
    %>works fine but the image shown in its original size most of the time very large.
    I tried to fix the image size by changing the code to
    <h:graphicImage url="fileupload_showimg.faces" width="300" height="500"/>But now the image is shown is deformed
    i need it to be fixed in size and not deformed

    me again I think the first part of the problem is been solved now
    the 2nd problem is still there hope i can fix that also

  • MyFaces Tomahawk more than one tree2

    Hi everybody, I'm new with JSP and I'll appreciate some help with this:
    I have a JSP app implementing MyFaces Tomahawk tree2 with TreeBacker class modified, the component renders pretty well, but I need to show another tree completely different, I made a new class almost equal than TreeBacker but the name and the new tree structure, but at runtime the tree doesn't renders.
    In the running tree2:
    <t:tree2 id="clientTree" value="#{treeBacker.treeData}" var="node" varNodeToggler="t" clientSideToggle="true">Additionaly, why if I change treeBacker.treeData to TreeBacker.treeData the tree2 doesn't renders ??
    In the rebel tree2:
    <t:tree2 id="clientTree" value="#{treeBacker2.treeData}" var="node" varNodeToggler="t" clientSideToggle="true">this tree2 doesn't work....
    What I'm doing wrong ?

    I don't understand very good who works the repeater that you put there. And in the dataprovider I have to know how many trees I will have? Because I don't know how many trees I will have(in one moment 1, later 4, later 2... I could put a variable but I don't understand very good how can I do the repeater and..).
    I get create a dinamic Vbox with X tress, but putting all the xml in one, something like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Cuentas>
        <Cuenta id="cuenta1" label="cuenta1">
        <node label="INBOX">
            <node label="Nombre">
        </node>
        </node>
        </Cuenta>
        <Cuenta id="cuenta2" label="cuenta2">
        <node label="INBOX">
            <node label="Apellido">
        </node>
        </node>
        </Cuenta>
    </Cuentas>
    With my treeLoad code I create 2 tress in one Vbox, if the xml document have 3 diferents Cuenta I will create 3 trees. But now I have different xml and I don't how can I do the same.

  • BUG: JSP disappears from design view with MyFaces / Tomahawk

    Hi,
    When I try to create a JSF JSP in design view (as opposed to code view) using MyFaces and Tomahawk 1.1.3, the design view will blank and display "Type, paste or drag and drop content onto this blank....". This usually happens after I've dragged half a dozen JSF outputlabels and inputtext boxes. The code still exists in code view, and will even compile and deploy ok, it's just the design view that stops working. The design view usually blanks while I'm switching between the code tabs at the top of the screen, although I'm fairly sure it blanked as I dropped a textbox onto the form once.
    I've restarted JDev, tried to create a second page, clicked refresh etc but I can't get it back. This has happened starting from scratch 3 times now.
    I've switched back to the builtin reference implementation JSF (and no Tomahawk), and JDeveloper works fine, so it seems to be a problem using MyFaces. I've added MyFaces and Tomahawk via Manage Libraries.
    This Oracle article - http://www.oracle.com/technology/products/jdev/101/howtos/myfaces/index.html
    states that the RI version can't be swapped out in JDev Developer Preview version but I understand that's not true now?
    I'm using :-
    JDeveloper SU4
    java 1.5
    Windows XP SP1
    Thanks for any help.

    I found the answer. I went to View, Style Rendering and clicked several of the boxes  Display Media was one.

  • What's the relationship between JSF api, JSFRI, Myfaces API, Myfaces impl

    JSF RI is an implementation of JSF reference, so is Myfaces impl, right?
    i just confused about the two APIs, could anyone explain it for me.
    thanks!

    JSF is a specification.
    Sun Mojarra is an implementation of the JSF specification.
    Sun JSF RI (Reference Implementation) is an old name of Mojarra, used up to 1.2_07.
    Apache MyFaces is another implementation of the JSF specification.
    You cannot mix multiple implementations with each other. You can however add any component library to your taste on top of a JSF implementation, e.g. Apache Tomahawk, JBoss RichFaces, IceFaces, etcetera.

  • MyFaces Tomahawk in GlassFish

    Hi,
    Can somebody help me? I'm using Tomahawk 1.1.9 and myfaces-api.1.1.7 and myfaces-impl.1.1.7 in my JSF application. When I deploy my app. to GlassFish I got a SEVERE error "*Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-imple...*"
    The problem still happens after I added
    *<class-loader delegate="false"/>*
    *<property name="useMyFaces" value="true"/>*
    into the sun-web.xml
    Any advices are really appreciated.
    Thanks!

    Finally I figured out the problem and fixed it.<!--Session data-->

  • Sun RI 1.2  MyFaces Tomahawk 1.1.6 Tomcat 6

    Hello,
    I have got a running little example with the Sun RI 1.2.
    Now I wanted to use the tomahawk implementation from myfaces, too.
    In the lib folder in the webapp direction from Tomcat
    C:\Programme\Apache Software Foundation\Tomcat 6.0\wtpwebapps\PlaygroundTomahawk\WEB-INF\lib
    there are the files:
    jsf-api.jar
    jsf-impl.jar
    tomahawk-1.6.6.jar
    But I get an exception when starting Tomcat 6:
    SCHWERWIEGEND: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
    com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
      Source Document: jar:file:/C:/Programme/Apache%20Software%20Foundation/Tomcat%206.0/wtpwebapps/PlaygroundTomahawk/WEB-INF/lib/tomahawk-1.1.6.jar!/META-INF/faces-config.xml
      Cause: Class 'org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener' is missing a runtime dependency: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
         at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:212)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:174)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:516)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: com.sun.faces.config.ConfigurationException:
      Source Document: jar:file:/C:/Programme/Apache%20Software%20Foundation/Tomcat%206.0/wtpwebapps/PlaygroundTomahawk/WEB-INF/lib/tomahawk-1.1.6.jar!/META-INF/faces-config.xml
      Cause: Class 'org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener' is missing a runtime dependency: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
         at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:222)
         at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:141)
         at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:114)
         at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:94)
         at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)
         at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:202)
         ... 16 moreHere ist my 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_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>PlaygroundTomahawk</display-name>
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      <filter>
         <filter-name>MyFacesExtensionsFilter</filter-name>
         <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <param-name>maxFileSize</param-name>
            <param-value>20m</param-value>
             </init-param>
    </filter>
    <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.)  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    </filter-mapping>
      <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>*.jsf</url-pattern>
      </servlet-mapping>
    </web-app>Here is my faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config
        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"
        version="1.2">
         <managed-bean>
              <managed-bean-name>
              myBean</managed-bean-name>
              <managed-bean-class>
              mypackage.MyBean</managed-bean-class>
              <managed-bean-scope>
              request</managed-bean-scope>
         </managed-bean>
    </faces-config>I hope anyone can help me.
    I don�t know if it is generally possible to work with Sun Ri and Tomahawk 1.1.6?
    Thank you very much for your answer.
    NickiS

    Thank you.
    Oh, yes I remember there where some jars I need too... but there is no hint on the myfaces site that I need something else than the tomahawk.jar file.
    I looked at an old myfaces project and found those jars:
    commons-beanutils-1.7.0.jar
    commons-codec-1.3.jar
    commons-collections-3.1.jar
    commons-digester-1.6.jar
    Can you tell me if I need them too? That would be great.
    Thank you for your great tutorial "JSF tutorial with Eclipse and Tomcat" (I think you recognized your example ;-) )
    NickiS

  • Replacing Sun�s JSF implementation for MyFaces in Creator

    Hi. Does anyone know if I can replace the JSF implementation Creator uses for another, like MyFaces?
    Thanks

    OK. I looked at ourfaces_release_0_1.zip & ourfaces_20040622_1208.zip to see why latter worked. The reason is in the latter one, the faces-config.xml file is kept inside the META_INF directory of the jar file as expected by Creator.
    Regarding, "Component Runtime Jar", this will be automatically created for you if you don't provide one. If you look at <creator-user-dir>/components/jars you would find the created jar file (Note - the design time jar file mostly contains beaninfo classes of the component beans) .
    Also, you can provide your own design time jar file, if you don't wan't creator to create one automatically for you. As a starting point, you could use the script <creator-install-dir>/startup/bin/create-dt-jar.bat or sh and the corresponding "ant" script create-dt-jar.xml, to create your own design time jar file for more control over design time experience.
    > I am able to drag them onto the visual editor but nothing shows up ..
    Reason is the design time specifics are not included in the design time jar file. To include it in the automatically created design time jar file, you need to add an additional XML file called "sun-faces-config.xml" file in the META_INF directory along with the faces-config.xml. Unfortunately we don't yet have published documentation on how to create this XML file. But we are working on this.
    Alternateively, you could include these info in to the "beaninfo" classes directly after they are generated using the tools I mentioned above, before they are jar-ed to create the design time jar file . Again the documentations are not yet published.
    To specify the default Tag Lib URI look at the ourfaces.tld file. It is
    <uri>http://ourfaces.dev.sun.net/components</uri>
    - Winston

  • Help needed with Myfaces - tomahawk t:panelTabbedPane form tag iserted wh

    when i Use tomahawk <t:panelTabbedPane> component, during rendering stage. its atomatically inserts <form> tag around it.
    Is there any way to avoid this <form tag. because, I am using 3 tab column, and each tab has got its own form tag.
    so in that case. there is <form> inside <form>, thats giving errors when using some javascript function with this..
    is there any solution for this

    Hi,
    Could you please tell us if you are using Sun Java Studio Creator for building your web application.
    RK

  • Can I use Ajax with jsf

    Hi All,
    Is JSF 1.1 supports AJAX or not???
    Please tell me..

    JSF RI 1.1 = Java Server Faces Reference Implementation 1.1.
    It is the Sun reference implementation of JSF. There are also 3rd party implementations of JSF available, like MyFaces, Tomahawk, IceFaces, ADF, etcetera.
    If you aren't limited to JSF RI version 1.1, I recommend you to use version 1.2. It provides more features and benefits.
    Here are some links:
    https://javaserverfaces.dev.java.net
    http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/
    http://jsftutorials.net
    http://java.sun.com/javaee/5/docs/tutorial/doc/ (starting at chapter 9)
    http://jboss.org/projects/jbossAjax4jsf (most widely used AJAX library for JSF)

  • Sun JSF 1.2 (RI) + MyFaces  project Tomahawk 1.1.3

    Hi Guys,
    I wondering if someone can help me out. I'm so lost...
    In general, I'm working in a new project using Tomcat 5.5.17 as Servlet container, NetBeans as IDE and Sun JSF 1.2 (RI) Framework. The combination of Tomcat and JFS 1.2 already is an issue that I believe can be solved using Servlets framework ( I hope so). For now I just crossing my fingers believing Apache Tomcat soon will be using JSP 2.1
    Like most projects always start simple and then grows bigger and complicated. Now I just so confusing when I trying to use custom components not found in the JSF 1.2 specification. I really like MyFaces Tomahawk and would like to use in my project as well, specially a few components: Calendar, Schedule and so on.
    Making the long history short, there you are my questions:
    1 - ) Is it possible to work with Sun JSF 1.2 (RI) + Tomahawk 1.1.3 project?. Using anly a few components of Tomahawk and not the entire MyFaces specificacion.
    2 - ) Where can I donwload MyFaces examples spefically using those Tomahawk components mentioned before ? I would like to deploy the examples application myself. In the web site (http://www.myfaces.org) mention two files in Installing and Running the examples:
    " Unpack the MyFaces examples archive myfaces-X.X.X-examples.zip (or myfaces-X.X.X-examples.tgz) to a directory of your choice. "......
    I have no clue where to find those two files. All I get is a link to and external site that show me the examples and offering services, but I have no option to download any examples file.
    Thanks in advance.

    Amittev,
    Thank you. I really appreciate your help. Now the examples are working just fine in my computer.
    By the way, I have another question for you considering your kindness taken your time to share your expertise.
    I'm facing a Tiles and Facelets dilema. Which framework do you recomend me to invest my time learning it??.
    Thanks again for your time and consideration.

  • JSF + Tomahawk component NullPointerException

    Hi All,
    I made a sun JSF portlet by using the tomahawk 1.1.3 file upload component. The bean "UploadedFile myFile" is not getting set in the "MyBean.java" file. I get a java.lang.NullPointerException when I am trying to myFile.getName() or myFile.getInputStream().
    The inputFileUpload method should set the myFile Bean but it seems like its not getting set
    1
    2 <t:inputFileUpload id="myFileId"
    3            value="#{myBean.myFile}"
    4 storage="file"
    5 required="true"/>
    6 <h:message for="myFileId"/>
    I am attaching the whole code below
    Can somebody please help me. I have tried various versions of tomahawk and still not able to figure out the problem.
    I am using JSF 1.1.0 and tomahawk 1.1.3
    Please let me know if you need some more information from me
    1
      2======== index.jsp ==============
      3
      4<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      5<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      6<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
      7
      8<f:view>
      9
    10<h:form id="MyForm" enctype="multipart/form-data" >
    11
    12    <h:messages globalOnly="true" styleClass="message"/>
    13
    14    <h:panelGrid columns="3" border="0" cellspacing="5">
    15
    16        <h:outputLabel for="myFileId" value="File: "/>
    17        <t:inputFileUpload id="myFileId"
    18            value="#{myBean.myFile}"
    19            storage="file"
    20            required="true"/>
    21        <h:message for="myFileId"/>
    22
    23        <h:outputLabel for="myParamId" value="Param: "/>
    24        <h:selectOneMenu id="myParamId"
    25                value="#{myBean.myParam}"
    26                required="true">
    27            <f:selectItem itemLabel="" itemValue=""/>
    28            <f:selectItem itemLabel="MD5" itemValue="MD5"/>
    29            <f:selectItem itemLabel="SHA-1" itemValue="SHA-1"/>
    30            <f:selectItem itemLabel="SHA-256" itemValue="SHA-256"/>
    31            <f:selectItem itemLabel="SHA-384" itemValue="SHA-384"/>
    32            <f:selectItem itemLabel="SHA-512" itemValue="SHA-512"/>
    33        </h:selectOneMenu>
    34        <h:message for="myParamId"/>
    35
    36        <h:outputText value=" "/>
    37        <h:commandButton value="Submit"
    38            action="#{myBean.processMyFile}"/>
    39        <h:outputText value=" "/>
    40
    41    </h:panelGrid>
    42
    43</h:form>
    44
    45</f:view>
    46
    47
    48==========  MyBean.java ==============
    49
    50<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    51<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    52<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
    53
    54<f:view>
    55
    56<h:form id="MyForm" enctype="multipart/form-data" >
    57
    58    <h:messages globalOnly="true" styleClass="message"/>
    59
    60    <h:panelGrid columns="3" border="0" cellspacing="5">
    61
    62        <h:outputLabel for="myFileId" value="File: "/>
    63        <t:inputFileUpload id="myFileId"
    64            value="#{myBean.myFile}"
    65            storage="file"
    66            required="true"/>
    67        <h:message for="myFileId"/>
    68
    69        <h:outputLabel for="myParamId" value="Param: "/>
    70        <h:selectOneMenu id="myParamId"
    71                value="#{myBean.myParam}"
    72                required="true">
    73            <f:selectItem itemLabel="" itemValue=""/>
    74            <f:selectItem itemLabel="MD5" itemValue="MD5"/>
    75            <f:selectItem itemLabel="SHA-1" itemValue="SHA-1"/>
    76            <f:selectItem itemLabel="SHA-256" itemValue="SHA-256"/>
    77            <f:selectItem itemLabel="SHA-384" itemValue="SHA-384"/>
    78            <f:selectItem itemLabel="SHA-512" itemValue="SHA-512"/>
    79        </h:selectOneMenu>
    80        <h:message for="myParamId"/>
    81
    82        <h:outputText value=" "/>
    83        <h:commandButton value="Submit"
    84            action="#{myBean.processMyFile}"/>
    85        <h:outputText value=" "/>
    86
    87    </h:panelGrid>
    88
    89</h:form>
    90
    91</f:view>
    92
    93
    94=========== faces-config.xml ==========
    95
    96<?xml version="1.0"?>
    97<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    98
    99<faces-config xmlns="http://java.sun.com/JSF/Configuration">
    100    <managed-bean>
    101        <managed-bean-name>user</managed-bean-name>
    102        <managed-bean-class>com.sample.jsfsun.bean.UserBean</managed-bean-class>
    103        <managed-bean-scope>session</managed-bean-scope>
    104    </managed-bean>
    105    <managed-bean>
    106        <managed-bean-name>myBean</managed-bean-name>
    107        <managed-bean-class>com.sample.jsfsun.bean.MyBean</managed-bean-class>
    108        <managed-bean-scope>request</managed-bean-scope>
    109    </managed-bean>
    110    <navigation-rule>
    111        <from-view-id>/index.jsp</from-view-id>
    112        <navigation-case>
    113            <from-outcome>submit</from-outcome>
    114            <to-view-id>/welcome.jsp</to-view-id>
    115        </navigation-case>
    116    </navigation-rule>
    117    <navigation-rule>
    118        <from-view-id>/welcome.jsp</from-view-id>
    119        <navigation-case>
    120            <from-outcome>back</from-outcome>
    121            <to-view-id>/index.jsp</to-view-id>
    122        </navigation-case>
    123    </navigation-rule>
    124</faces-config>
    125
    126============= web.xml =============
    127
    128
    129<?xml version="1.0"?>
    130<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    131
    132<web-app>
    133    <display-name>friend_info_portlet</display-name>
    134    <context-param>
    135        <param-name>company_id</param-name>
    136        <param-value>liferay.com</param-value>
    137    </context-param>
    138    <context-param>
    139        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    140        <param-value>client</param-value>
    141    </context-param>
    142    <context-param>
    143        <param-name>javax.faces.application.CONFIG_FILES</param-name>
    144        <param-value>/WEB-INF/faces-config.xml</param-value>
    145    </context-param>
    146    <context-param>
    147        <param-name>com.sun.faces.validateXml</param-name>
    148        <param-value>false</param-value>
    149    </context-param>
    150    <filter>
    151        <filter-name>ExtensionsFilter</filter-name>
    152        <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    153        <init-param>
    154            <param-name>uploadMaxFileSize</param-name>
    155            <param-value>10m</param-value>
    156        </init-param>
    157        <init-param>
    158            <param-name>uploadThresholdSize</param-name>
    159            <param-value>100k</param-value>
    160        </init-param>
    161    </filter>
    162    <filter-mapping>
    163        <filter-name>ExtensionsFilter</filter-name>
    164        <servlet-name>Faces Servlet</servlet-name>
    165    </filter-mapping>
    166    <filter-mapping>
    167        <filter-name>ExtensionsFilter</filter-name>
    168        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    169    </filter-mapping>
    170    <filter-mapping>
    171        <filter-name>ExtensionsFilter</filter-name>
    172        <url-pattern>*.jsf</url-pattern>
    173    </filter-mapping>
    174    <listener>
    175        <listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
    176    </listener>
    177    <listener>
    178        <listener-class>com.liferay.util.jsf.sun.faces.config.LiferayConfigureListener</listener-class>
    179    </listener>
    180    <servlet>
    181        <servlet-name>friend_info_portlet</servlet-name>
    182        <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
    183        <init-param>
    184            <param-name>portlet-class</param-name>
    185            <param-value>com.sun.faces.portlet.FacesPortlet</param-value>
    186        </init-param>
    187        <load-on-startup>0</load-on-startup>
    188    </servlet>
    189    <servlet>
    190        <servlet-name>Faces Servlet</servlet-name>
    191        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    192        <load-on-startup>1</load-on-startup>
    193    </servlet>
    194    <servlet-mapping>
    195        <servlet-name>friend_info_portlet</servlet-name>
    196        <url-pattern>/friend_info_portlet/*</url-pattern>
    197    </servlet-mapping>
    198    <servlet-mapping>
    199        <servlet-name>Faces Servlet</servlet-name>
    200        <url-pattern>/faces/*</url-pattern>
    201    </servlet-mapping>
    202    <servlet-mapping>
    203        <servlet-name>Faces Servlet</servlet-name>
    204        <url-pattern>*.faces</url-pattern>
    205    </servlet-mapping>
    206    <welcome-file-list>
    207        <welcome-file>index.jsp</welcome-file>
    208    </welcome-file-list>
    209    <taglib>
    210        <taglib-uri>http://java.sun.com/portlet</taglib-uri>
    211        <taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
    212    </taglib>
    213</web-app>

    jabalsad wrote:
    contents of /WEB-INF/lib
    jsf-api.jar
    jsf-impl.jar
    myfaces-api-1.2.7.jar
    myfaces-impl-1.2.7.jar
    You cannot mix differnet JSF implementations. Use the one or the other.
    As you stated that you're "using" Mojarra, get rid of those myfaces jars.

  • Navigation issue using jsf, tiles, tomahawk  :loosing faces context

    Hi all,
    I enhanced my webapp using tomahawks jscookmenu.
    Triggering 1 menuItem the wanted pages displays correctly but the next click anywhere in the application shows this error:
    org.apache.jasper.JasperException: javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to  *.jsf (with the <servlet-mapping>-element), you need to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp', you'd get this error-message.The web config is like that:
    <?xml version="1.0"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
         <context-param>
              <description>Tiles MyFaces Config</description>
              <param-name>tiles-definitions</param-name>
              <param-value>/WEB-INF/tiles.xml</param-value>
         </context-param>
         <context-param> 
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name> 
              <param-value>.jsp</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
              <param-value>off</param-value>
         </context-param>
         <!-- context-params mafaces -->
         <context-param>
              <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.STRICT_XHTML_LINKS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CONFIG_REFRESH_PERIOD</param-name>
              <param-value>this is a bug in myfaces</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
              <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
              <param-value>/faces/myFacesExtensionResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
              <param-value>false</param-value>
         </context-param>
         <!-- StartupServletContextListener -->
         <listener>
              <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener
              </listener-class>
         </listener>
         <!-- Faces MyFacesExtensionsFilter -->
         <filter>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <filter-class>
                   org.apache.myfaces.webapp.filter.ExtensionsFilter
              </filter-class>
              <init-param>
                   <param-name>uploadMaxFileSize</param-name>
                   <param-value>1m</param-value>
              </init-param>
         </filter>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>/faces/*</url-pattern>
         </filter-mapping>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>*.jsf</url-pattern>
         </filter-mapping>
         <!-- 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>*.jsf</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
         <servlet>
              <servlet-name>imageServlet</servlet-name>
              <servlet-class>my.com.xplorer.gui.v.ImageServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>imageServlet</servlet-name>
              <url-pattern>/image/*</url-pattern>
         </servlet-mapping>
    </web-app>So I lost the faces context using the jscookmenu, I believe.
    My webapp uses tiles, and there is 2 navigation possibilities: tomahawaks jscookmenu and tomahawaks commandNavigation.
    Latter one runs ok, I do use
    <t:panelNavigation id="nav" styleClass="navigation"
         itemClass="navitem" separatorClass="navseparator" 
         activeItemClass="navitem_active" openItemClass="navitem_open">
         <t:commandNavigation action="#{newsHandler.userRequest}" value="#{newsHandler.rss_source_name[0]}">
              <f:param name="navigator"  value="/jsf/news.jsp" />
         </t:commandNavigation>
    </t:panelNavigation>for this kind of navigation I do not use any navigation rules in faces config. To dynamically include the desired faces page I do that:
    <%
         String s = (String)request.getParameter("navigator");
         if (s == null || s.length() == 0 ) {
              s =  "/jsf/explorer.jsp";
    %>
    <jsp:include page="<%=s %>" />That does work.
    Now like I said I did enhance the app by adding tomahawks jscookmenu.
    Therefore I use the following in another tile:
    <t:jscookMenu layout="hbr" theme="ThemeOffice" styleLocation="resources/css">
              <%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
                 Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
                 respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
            */%>
      <t:navigationMenuItem id="nav_0" itemLabel="#{localz.Xplorer}" action="Xplorer" />
    </t:jscookMenu>For this kind of navigation I tried to use navigation rules and the following show the config:
         <navigation-rule>
           <from-view-id>/jsf/*</from-view-id>
            <navigation-case>
                <from-outcome>Xplorer</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/explorer.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>Tabs</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/tab.jsp</to-view-id>
            </navigation-case>
         </navigation-rule>That works for the first click. The desired page is shown. The nect click anywhere in the app then show the mentioned error.
    Using tiles I use this view-handler
    <view-handler>org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl</view-handler>One question is: can I use another view-handler on top of the above one? So I could extend com.sun.facelets.FaceletViewHandler and try my luck with this? Or is the solution pointed out just a millisecond from being ok, I just don�t see it?
    Maybe you need to know a bit more on how I use tiles:
    That is the page I start with. It inserts the tile shown underneath.
    <f:view locale="#{userLocale}">
         <f:loadBundle var="localz" basename="my.com.xplorer.gui.v.Lokalization" />
         <f:loadBundle var="bundle" basename="my.com.xplorer.gui.v.messages" />
         <f:subview id="tileMain">
              <h:form id="myJsfForm" styleClass="standard">
                        <tiles:insert definition="template" flush="false" />
              </h:form>
         </f:subview>
         <h:messages />
    </f:view>
    </html>The foolowing is the tile structure.
    The bodi tile is the dynamic part. Above you see that I dynamically load the pages into it.
    <t:htmlTag value="div" styleClass="pageLayout">
         <h:panelGrid columns="2" align="center" styleClass="pageContent">
              <f:facet name="header">
                   <f:subview id="header">
                        <tiles:insert attribute="header" flush="false" />
                   </f:subview>
              </f:facet>
              <t:htmlTag value="div" styleClass="pageMenu">
                   <f:subview id="menu">
                        <tiles:insert attribute="menu" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <t:htmlTag value="div" styleClass="pageContentWoMenu">
                   <f:subview id="bodi">
                        <tiles:insert attribute="bodi" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <f:facet name="footer">
                   <f:subview id="footer">
                        <tiles:insert attribute="footer" flush="false" />
                   </f:subview>
              </f:facet>
         </h:panelGrid>
    </t:htmlTag>Maybe you also need to know the tiles config?
    <tiles-definitions>
       <definition name="template" path="/jsf/tileTemplate.jsp">
              <put name="header"  value="/jsf/header.jsp"/>
          <put name="menu"    value="/jsf/menu.jsp"/>
          <put name="bodi"    value="/jsf/bodi.jsp"/>
          <put name="footer"    value="/jsf/footer.jsp"/>
       </definition>
       <definition name="/jsf/news.tiles" extends="template">
              <put name="bodi"  value="/jsf/news.jsp"/>
       </definition>
       <definition name="/jsf/explorer.tiles" extends="template">
              <put name="bodi"  value="/jsf/explorer.jsp"/>
       </definition>
       <definition name="/jsf/tab.tiles" extends="template">
              <put name="bodi"  value="/jsf/tab.jsp"/>
       </definition>If you have read until here: thanks very much.
    There seems to be a sort of gap regarding jsf navigation documentation.
    I mean the ordinary way is covered everywhere (the book I have covers that too), but jscookmenu seems not to fit in too good. I also tried it with an actionslistener in the jscookmenu but that failed, too. So a link to documents telling the truth on jsf navigation I would appreciate very much.
    Kind regards
    Belle Ile En Mer

    This is the error i am getting into now..
    exception
    org.apache.jasper.JasperException: An exception occurred processing JSP page /welcomeJSF.jsp at line 19
    16: This file is an entry point for JavaServer Faces application.
    17: --%>
    18: <body>
    19: <f:view>
    20: <h3><h:outputText value="CHOULTRY'S IN BANGALORE" /></h3>
    21: <h:form>
    22: <table border="0">
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    root cause
    java.lang.RuntimeException: Cannot find FacesContext
         javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
         javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
         org.apache.jsp.welcomeJSF_jsp._jspx_meth_f_005fview_005f0(welcomeJSF_jsp.java:112)
         org.apache.jsp.welcomeJSF_jsp._jspService(welcomeJSF_jsp.java:86)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Maybe you are looking for

  • A text with strings from query - how???

    There is on-demand process, that return text to text-area element. DECLARE LIST_OF_APP varchar2(32000) := ''; BEGIN BEGIN FOR i IN (SELECT TITLE, TIMEOFCHECK FROM ACTIVEWINDOWSOFUSERS WHERE NUMBEROFPROCCESS=:STATE_SR AND MYUSER=:USERID_SR ) loop LIST

  • Batch Capturing with gap in recording

    So I just spent a lot of time labeling and describing clips. They are all offline. So I go to Batch Capture them and I'm getting the beginning of the tape rather than what I wanted which was in the middle. I discovered that there is some blank space

  • Problem with sleep mode-T400

    Hey Guys, I have a lenovo T-400, Windows Vista Home Basic 32Bit. When I put my computer to sleep and try to wake it up within 5 minutes, it wakes up but it doesn't wake up when the sleep time goes beyond 5 mins. Here are the "few" things that I have

  • How can i save an article to read later?

    I have seen a tip that to save an article for reading later, a book icon which appears on the title bar should be long pressed, but the icon does not appear in my title bar at all, for me to be able to save. Please guide me. Thanks.

  • External Processing

    Dear all, I've created a control key for external processing and assigned it to a work center. Now, I've used this work center in my routing and put the following Material Group Purchasing Group Planned Delv. Time Price Unit Net Price Cost Element Pu