JSF -Tomahawk Tabs

I'm using JSF Tomahawk tabbedPane... to get the tabs... I have the commandbutton inside each t:panelTab whwn i click dat commandbutton, the action it is supposed to perform is done but it shows the first tab contents..
for ex if i have commandbutton in second tab wen i click it performs correctly but first tab becomes active... i want dat particular tab to be active in which user has clicked commandbutton hw shall i do it...
<t:panelTabbedPane id="editorPanel" >
<t:panelTab id="tab11" label="Tab1" >
<h:commandbutton action="" />
</t:panelTab>
<t:panelTab id="tab22" label="Tab2" >
<h:commandbutton action="" />
</t:panelTab>
</t:paneltabbedPane>

Thanks BalusC . Let me re iterate my question. I am new to JSF to pardon me if my terminology is not correct.
I have a list which contains object .I have to generate tabs based on contents on list. So if list contain 3 objects I have to generate 3 tabs . Each page inside tab will have same layout but will be populated with different content.
With that said. I used jsf pane_tab and I tried different ways to iterate over the list and include the jsp which will contain the layout. More specifically I tried something like below with different variations .
<%
     for (int i = 0 ; i< list.size() ; i++)
          String abc = "name"+ i;
          %>
<d:pane_tab id="<%= abc %>" >
<f:facet name="label">
<d:pane_tablabel label="test" commandName="third"/>
</f:facet>
<jsp:include page="addMaintenence.jsp"/>
</d:pane_tab>
          <%
%>
It gives duplicate id error. Now I am not sure if my approach is right or not. Also if it not correct what should I try ??
Any pointers would be helpful.
Thanks in advance.
Priyanka

Similar Messages

  • Tomahawk Tabbed Panes

    Has anybody tried to use the Tomahawk tabbed panes from the Myfaces project? Can these be used with jsf components. I want to use tabbed panes in my project and I want to avoid IBm components for licensing issues.
    A working example would be of help!. I have tried to use the Tomahawk tabbed panes, however, i dont seem to get help for the errors that i am encountering. Especially the jar files, that r required in the lib folder.

    buddy u need to have a complete set of all the jar files . .only then will it work.
    especially for tabbed panes you need tomahawk.jar

  • 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.

  • JSF Tomahawk Dynamic Menu jsCookMenu Param Passing Question .. Help Please!

    Hello everyone,
    Thank you again for your help. Let me explain what my issue is.
    I am currently developing a JSF 1.2 application using WDSC 7 (RAD 7). I am trying to
    develop a shopping cart application. The part I am stuck on is the menu.
    I need to draw a menu with drop downs with multiple levels. The first level is the category
    and the second level is the item name. The menu must be dynamically built from a Database table.
    After searching high and low I came across jsCookMenu component which requires Tomahawk to be installed.
    I installed this ontop of my IBM JSF implementation and it seems to be working fine.
    I currently have a MenuBean which calls a database and populates a NavigationMenuItems array and passes
    that to the jsCookMenu component which then renders that to the client.
    This works fine.
    Here is my question. When the user selects the first level of the menu, I want to call a page called
    GetCategory.jsp?catID=num num being the category id selected. When they select the second level of the
    menu, I want it to then call GetItem.jsp?itemID=num. I know I can use the action attribute of the menu
    item or a direct URL (which pops it up in a new window).
    Basically, I need to pass a parameter to an action (again I am somewhat new to JSF) or I need
    to call the page directly passing the request parameter.
    Am I going about this the wrong way, and if so, what way should I be going?
    Secondly, is there a better, cleaner implementation or component I can use instead.
    I'm using Tomahawk just for the one component.. That's it.
    Any help anyone can provide I would greatly appreciate it.
    Thanks so much!
    Matt

    That is correct.
    I have the menu populating dynamically built from a JavaBean.
    It works beautifully.
    Level 1 is the Category - the action is DisplayCategory
    Level 2 is the Item - the action is DisplayItem
    Level 3 is the Style - the action is DisplayStyle
    My problem is, on each page, DisplayCategory/DisplayItem/etc how do I know which menu item was clicked?
    Anyone have any idea?
    Thanks,
    Matt

  • JSF Dynamic Tabs

    Hello ,
    I am working on a project where I want to generate tabs based on contents of a list. So if my class contain 3 objects the UI should contain 3 tabs if it contains 5 objects it should display 5 tabs in UI.
    I tried jsf forEach, jsp for loop one way or other it gives duplicate id error.
    I am lost now. If any one has encountered/solved similar problem above please help me.
    Thanks in advance.
    Priyanka

    Thanks BalusC . Let me re iterate my question. I am new to JSF to pardon me if my terminology is not correct.
    I have a list which contains object .I have to generate tabs based on contents on list. So if list contain 3 objects I have to generate 3 tabs . Each page inside tab will have same layout but will be populated with different content.
    With that said. I used jsf pane_tab and I tried different ways to iterate over the list and include the jsp which will contain the layout. More specifically I tried something like below with different variations .
    <%
         for (int i = 0 ; i< list.size() ; i++)
              String abc = "name"+ i;
              %>
    <d:pane_tab id="<%= abc %>" >
    <f:facet name="label">
    <d:pane_tablabel label="test" commandName="third"/>
    </f:facet>
    <jsp:include page="addMaintenence.jsp"/>
    </d:pane_tab>
              <%
    %>
    It gives duplicate id error. Now I am not sure if my approach is right or not. Also if it not correct what should I try ??
    Any pointers would be helpful.
    Thanks in advance.
    Priyanka

  • Rendering Problems of JSF Tomahawk and Richfaces elements

    Hello,
    we developed a J2EE-Application on the Netweaver 7.0 (SP16) Platfarm, that uses JFS, Myfaces Tomahawk and Richfaces.
    It is developed as a "normal" J2EE Webmodule Project and works very well (even in the Portal).
    But one requiremant is, that the Application has to be a Development Component in a Development Track.
    So we ported the application into the Track without much trouble. But then we realized that many UI-Components, especially the Richfaces-Components do not render correctly.
    It seems, that the underlying Java-scrips are not generate properly, so that for example the Richfaces Calendar Component completetly fails. Also the scripts that apply certail style aspects to the UI-Components vanished.
    I have absolutely no idea, what could be the reason for that. There are no errors or exceptions. Just the underlying scripts are not generated or do not work.
    Does anybody have a hint what could be the solution?
    Regards,
    Jens Stolpmann
    Edited by: Jens Stolpmann on Jul 3, 2009 4:24 PM

    Hello,
    How did you manage to integrate RichFaces into your NWDS ? Do you have by any chance a tutorial that explains the steps to do it ?

  • Can not upload image of larger size in jsf

    i had some issues in file uploading. File uploading is working fine in my local machine and when i am using the www.mywebsite.com:8080/fileUpload.jsf
    but i can not upload images by using the following www.mywebsite.com/fileUpload.jsf
    Ie: without the port. I am using windows server and tomcat 5.5.27
    When i am trying to upload a bigger size image i am getting the following error
    I am using jsf(tomahawk)
    09:10:47,315 ERROR MultipartRequestWrapper:? - Exception while uploading file.
    org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Socket read failed
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
    at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:85)
    at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.getParameter(MultipartRequestWrapper.java:181)
    at org.apache.myfaces.context.servlet.RequestParameterMap.getAttribute(RequestParameterMap.java:42)
    at org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:91)
    at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getTreeStructureToRestore(HtmlResponseStateManager.java:159)
    at org.apache.myfaces.application.jsp.JspStateManagerImpl.getSequenceString(JspStateManagerImpl.java:260)
    at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:230)
    at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:267)
    at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:231)
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at com.zerone.rrs.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:100)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:444)
    at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:472)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
    at java.lang.Thread.run(Unknown Source)

    Never mind . problem solved after i restarted

  • Tab Item change for two panel group with 4 tabs each

    Hi
    All
    Will tab work for dynamic data loading in a panel group ?
    scenario .
    Panel group got 4 tabs . each tab contains grid view jsf component. these grid view will populate data once the Index page loads . each tab;s grid view will get data dynamically from backing bean with value objects .
    i am getting data for first tab . which is selected as true . but cannot change focus to other tabs. the functionality of tabchange event listener is not working. i checked the data for other tabs grid view. its coming correctly but cann;t see it in jsf page.
    tabs won;t work . is there any reason which stops working of tab , when we pass data dynamically to all grid views in 4 different tabs at a time.
    thanks in advance.
    Rambhapuri

    Data loading is happening , but cann;t change the tab , because tab item listener is not firing . when user clicks on other tab.
    regards
    rambhapuri

  • JSF + RichFaces

    Hello everybody!
    I'm makin an application using Spring + Hibernate + JSF (+Tomahawk). All is ok, but now i want to add ajax funtionality to some components.
    I have include de richfaces libraries but i have a lor of problems.
    Can i use RichFaces with tomahawk components?
    Thanks in advance.

    ok, now my application is load but now i have problems with my jscookmenu. It said that the jscook_action isn ull, but the menu is ok.
    I attach part of my web.xml. There is sth i have to change??
    <context-param>
           <param-name>log4jConfigLocation</param-name>
           <param-value>/WEB-INF/log4j.properties</param-value>
      </context-param>
      <!-- Par�metros de Spring -->
      <context-param>
           <param-name>contextConfigLocation</param-name>
           <param-value>/WEB-INF/applicationContext.xml</param-value>
      </context-param>
      <!-- Parametros de RichFaces -->
       <context-param>
            <param-name>org.richfaces.SKIN</param-name>
            <param-value>blueSky</param-value>
        </context-param>
      <!-- Par�metros de MyFaces -->
      <context-param>
           <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
           <param-value>true</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.application.CONFIG_FILES</param-name>
         <param-value>/WEB-INF/faces-config.xml</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.DETECT_JAVASCRIPT</param-name>
         <param-value>false</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>
      <filter> 
         <filter-name>sessionFilter</filter-name> 
        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> 
      </filter>
      <filter>
         <filter-name>extensionsFilter</filter-name>
         <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
         <init-param>
              <param-name>uploadMaxFileSize</param-name>
              <param-value>100m</param-value>
         </init-param>
         <init-param>
              <param-name>uploadThresholdSize</param-name>
              <param-value>100k</param-value>
         </init-param>
      </filter>
      <filter-mapping>
         <filter-name>sessionFilter</filter-name>
         <url-pattern>*.jsf</url-pattern>
      </filter-mapping>     
      <filter-mapping>
         <filter-name>extensionsFilter</filter-name>
         <servlet-name>Faces Servlet</servlet-name>
      </filter-mapping>
      <filter-mapping>
           <filter-name>extensionsFilter</filter-name>
         <url-pattern>/faces/*</url-pattern>
      </filter-mapping>
      <filter>
              <display-name>RichFaces Filter</display-name>
              <filter-name>richfaces</filter-name>
              <filter-class>org.ajax4jsf.Filter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>richfaces</filter-name>
              <servlet-name>Faces Servlet</servlet-name>
              <dispatcher>REQUEST</dispatcher>
              <dispatcher>FORWARD</dispatcher>
              <dispatcher>INCLUDE</dispatcher>
         </filter-mapping>
      <listener>
         <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
      </listener>
      <listener>
         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
      <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>
      <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
     

  • How to reset the JSF Portlet session state in weblogic portal 10.3

    Hi All,
    We are implementing our application with the jsf1.2 with 10.3.0 portal framework.
    in a tab i placed my jsf portlet, it will navigate up to 4 pages. We do have some other tabs too in our application. So when i navigate to other tabs and when i comeback to the jsf portlet tab i am resetting the portlet state to first page by onDeactivation portal event.
    But the problem when the user within the tab and navigate to pages if he clicks again the tab it is not redirecting to start page.
    I know we do have refresh action in our pageflows .. but how to reset the jsf portlet to start page when it is not deactivating. Please do help me..
    Thanks in advance...
    Edited by: Siddu4u on Oct 10, 2011 8:33 PM

    Hello,
    This documentation should help you to use the import tool in the Portal Admin Console:
    http://download.oracle.com/docs/cd/E15919_01/wlp.1032/e14245/deployment.htm#i1047336
    Kevin

  • Multiple PUs in a single persistence.xml

    Hi,
    I'm trying to define two different PUs for a standalone and Java EE environments, so a single persistence.xml could be used.
    Here goes the persistence.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
      <persistence-unit name="derbyPU" transaction-type="RESOURCE_LOCAL">
        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
        <class>pl.jaceklaskowski.jsf.tomahawk.entities.Pracownik</class>
        <properties>
          <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver" />
          <property name="openjpa.ConnectionURL" value="jdbc:derby:target/derbyDB;create=true" />
          <property name="openjpa.ConnectionUserName" value="app" />
          <property name="openjpa.ConnectionPassword" value="app" />
          <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
          <property name="openjpa.Log" value="DefaultLevel=WARN,SQL=TRACE" />
        </properties>
      </persistence-unit>
      <persistence-unit name="Kadry">
        <jta-data-source>jdbc/derby</jta-data-source>
        <class>pl.jaceklaskowski.jsf.tomahawk.entities.Pracownik</class>
      </persistence-unit>
    </persistence>and here goes the managed bean of a JSF application I'm developing.
    package pl.jaceklaskowski.jsf.tomahawk;
    import java.util.List;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    public class Pracownicy {
        @PersistenceContext(name="Kadry")
        EntityManager em;
        DataModel pracownicy = new ListDataModel();
        public DataModel getLista() {
            List resultList = em.createQuery("SELECT p FROM Pracownik p ORDER BY p.lastName").getResultList();;
            pracownicy.setWrappedData(resultList);
            return pracownicy;
    }When I run it on GF v2b36 I'm getting the following exception:
    com.sun.enterprise.deployment.backend.IASDeploymentException: Deployment Error -- Could not resolve a persistence unit corresponding to the persistence-context-ref-name [Kadry] in the scope of the module called [C:\projs\myfaces-tomahawk\target\myfaces-tomahawk]. Please verify your application.
            at com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUsViaPCRefs(BundleDescriptor.java:689)
            at com.sun.enterprise.deployment.WebBundleDescriptor.findReferencedPUs(WebBundleDescriptor.java:709)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.getAllPersistenceUnitDescriptors(PersistenceProcessor.java:158)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:119)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:198)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:159)
            at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:109)
            at com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:66)
            at com.sun.enterprise.deployment.backend.ModuleDeployer.handlePostDeployEvent(ModuleDeployer.java:618)
            at com.sun.enterprise.deployment.backend.ModuleDeployer.postDeploy(ModuleDeployer.java:607)
            at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:172)
            at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:174)
            at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
            at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:892)
            at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
            at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:761)
            at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
            at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)I double-checked that the jar with the Kadry PU is in WEB-INF/lib directory of the web application.
    Does anyone have any idea what might be wrong?
    Jacek
    Jacek Laskowski
    http://www.jaceklaskowski.pl

    Hi Jacek,
    The attribute you should set is unitName(), not name(). name() defines the location of the
    @PersistenceContext dependency within the component environment (java:comp/env). It
    is independent of the dependency type and appears on all Java EE environment annotations :
    @EJB, @Resource, etc.
    unitName() specifies the name of the associated persistence unit. If there is only one defined it's
    not needed. However, in your case there are two so since it's not specified there isn't enough
    information to resolve the correct one.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Suppressing Applet alerts when using java mail api

    Hi,
    Im using the following code to send email from my application. Im using JSF (tomahawk), Spring and hibernate in my application. I'm using spring email API classes to send email. This code works perfectly fine in the sense its parsing template and sending emails to the configured email id.
    I have defined this class as a managed bean and i have a commanButton is UI which is bound to this sendEmail() method
    <t:commandButton value="Send email" action= #{email.sendEmail}/>
    import java.io.StringWriter;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import java.util.Properties;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeMessage;
    import org.apache.velocity.Template;
    import org.apache.velocity.VelocityContext;
    import org.apache.velocity.app.VelocityEngine;
    import org.apache.velocity.exception.ParseErrorException;
    import org.apache.velocity.runtime.resource.loader.StringResourceLoader;
    import org.apache.velocity.runtime.resource.util.StringResourceRepository;
    import org.springframework.mail.MailException;
    import org.springframework.mail.SimpleMailMessage;
    import org.springframework.mail.javamail.JavaMailSenderImpl;
    import org.springframework.mail.javamail.MimeMessageHelper;
    import au.gov.nsw.railcorp.onlineticketing.external.model.request.ServiceFees;
    public class EmailService {
         JavaMailSenderImpl sender;
         VelocityEngine engine;
         public EmailService(){
         sender = new JavaMailSenderImpl();
             sender.setHost("<smtp ip>");
             sender.setPort(25);
             sender.setUsername("<user id>");
             sender.setPassword("<password>");
             engine = new VelocityEngine();
             Properties p = new Properties();
             p.setProperty("resource.loader", "string");
             p.setProperty("string.resource.loader.class",
                  "org.apache.velocity.runtime.resource.loader.StringResourceLoader");
             try {
                   engine.init(p);
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         public VelocityEngine getEngine() {
              return engine;
         public void setEngine(VelocityEngine engine) {
              this.engine = engine;
         public JavaMailSenderImpl getSender() {
              return sender;
         public void setSender(JavaMailSenderImpl sender) {
              this.sender = sender;
         public static void main(String args[]){
              EmailService emailService=new EmailService();
              emailService.sendEmail();
         public boolean sendEmail(){
         try{
                 MimeMessage message = sender.createMimeMessage();
                 MimeMessageHelper helper = new MimeMessageHelper(message);
                 helper.setTo("<to email id>");
                 helper.setFrom("<from email id>");
                 helper.setSubject("Teting velocity");
                 VelocityContext context = new VelocityContext();
                 StringWriter writer =  new StringWriter();
                 Template template =new Template();
                    StringResourceRepository repository =StringResourceLoader.getRepository();
                    String tempText="<html><body>Hi, ${username}...<p> this is a some template!</p></body></html>";
                 repository.putStringResource("myTemplate",tempText );
                 context.put("username", "Marc");
                 template = engine.getTemplate("myTemplate");
                  template.merge(context, writer);
                  System.out.println("VM Template:\n" + tempText);
                  System.out.println("Output:\n" + writer);
                  String body=writer.toString();
                  helper.setText(body,true);
                  sender.send(message);
            catch (MessagingException ex) {
                // simply log it and go on...
                System.err.println(ex.getMessage());           
            catch (MailException ex) {
                // simply log it and go on...
                System.err.println(ex.getMessage());           
            } catch (ParseErrorException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
         return true;
    }The problem i have is when i try to invoke the function sendEmail() from my UI it is throwing a series of applet alerts (some 10 of them) . The following are the alerts that i get
    1. The applet is attempting to invoke the java/lang/System.getProperty() operation on java.home
    2. The applet is attempting to perform a read operation on the file C:\Program Files\java\jre1.5.0_14\javamail.providers
    3. The applet is attempting to perform a read operation on the file C:\Program Files\java\jre1.5.0_14\javamail.address.map etc....
    For ever applet alert i had to click on 'allow' for it to proceed. But there is no problem in sending mail after that. One more interesting this is i DONT get this alert when i try to execute this java class directly instead of calling the method from another class or from UI.
    Can someone please let me know the reason for this applet alert and the way to suppress it?
    Its really urgent .. please help
    Thank you..

    Hi Subhadip,
    Thanks for the quick response :)
    Please help me understand this.. Im not explicitly using applet anywhere .I guess it should be used internally by one or many of the API classes i have used . In this scenario how can self sign the applet and which one?
    I have included some jars like activation.jar,mail-1.4.2.jar,velocity-1.6.2.jar in my webapp lib . Is there a means to sign these jars and use? Is this what you are suggesting me to do?
    One more doubt i have is how come the same method runs without any problem when executed as a standalone java class (with main() method)
    Will be really helpful if you could help me understand this...
    Thanks,
    Swami

  • Rich: calendar problem when automatically adjust clock for daylight saving

    Hello, I'm in trouble when the option to automatically adjust clock for daylight saving time is marked. My locale is pt_BR, and when I try to select the day it simply returns to 17.10.2010 on 16.10.2010 took the test in the following component and realized that the same problem occurs when the Windows clock option is selected .
    http://livedemo.exadel.com/richfaces-demo/richfaces/calendar.jsf?tab=usage&cid=15374785
    I also noticed that this problem occurs in all components of the JSF schedule, no matter what the distribution
    http://www.primefaces.org:8080/prime-showcase/ui/calendarDisplay.jsf
    Question is, how to make the jsf solve this problem without having to uncheck the Windows clock?
    See below for the following attempts to try to fix the problem:
    faces-config.xml file
        <locale-config>
             <default-locale> en </ default-locale>
             <supported-locale> en_US </ supported-locale>
             <supported-locale> of </ supported-locale>
             <supported-locale> fr </ supported-locale>
            <supported-locale> es </ supported-locale>
            <default-time-zone-id> Brazil / East </ default-time-zone-id>
        </locale-config>
    {code}
    Created file DateTimeZoneConverter
    {code:java}
    import java.util.SimpleTimeZone;
    import javax.faces.convert.DateTimeConverter;
    public class extends DateTimeZoneConverter DateTimeConverter {
         public DateTimeZoneConverter () {
            super ();
            SimpleTimeZone stz = new SimpleTimeZone (7200000, "Brazil/East");
            this.setTimeZone (stz);
    {code}
    In the example above I'm forcing the useDaylight is false.
    In component:
    {code:java}
    <rich:calendar id = "periodoVigencia" enableManualInput = "true" datePattern = "dd / MM / yyyy" inputSize = "10"
               value = "# () contratoMBeanList.criteria.dataInicioVigencia"
               label = "# (msg ['contrato.consultarContrato.field.periodovigencia.label'])">
               <f:convertDateTime pattern="dd/MM/yyyy" type="date" dateStyle="short" timeZone="GMT-3"/>
    </rich:calendar>
    {code}
    and in the web.xml file
    {code:java}
    <context-param>
         <param-name> timezone </ param-name>
          <param-value> GMT-3 </ param-value>
    </context-param>
    {code}
    But nothing worked. And now what do I do? How to fix this problem, there are some more configuration to be done? Help, please!
    P.S.:Apologize for my english, I'm Brazilian.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Like I said, were attempts to resolve the error.
    OK, now how to solve this problem? Try the test in your area by selecting the day that DST occurs, you will see what will happen the same problem (to select the day that DST occurs on the screen will return one day less), do the test with the demos that I put in the first post, rich: calendar and prime: calendar.
    I do not know if it helps, but I noticed the firebug firefox debugging, it does not matter the way you change the locale or timezone, as the current date from the calendar javascript will always be the standard of the machine running the component.

  • In netbeans

    Im using net beans 6 and is a must for my project i"m using visual java server faces for that when I run a particular web application with ui components some time i recieve message indicating componnent error ang displaying java.lang.nullpointer exception,and when I press the click to see the design button i recive a message indicating
    tabSet1: com.sun.webui.jsf.component.PanelLayout cannot be cast to com.sun.webui.jsf.component.Tab
    why is this please help me i"m stuck in here...

    I'm getting this error also time to time. When I restart Netbeans, everything works fine. I don't know why this is happening, maybe a bug of netbeans?!
    Does this error occur, even when you restart Netbeans?

  • View technology

    As I read more on JSF, I am getting confused.
    All the examples I read, they are either on SUN's standard jsf html components or on tomahawk.
    Now there is facelets, is Facelets a replacement for tomahawk?
    If I were to build a new app, Should I use JSF+Tomahawk or JSF + Facelets?
    Could somebody clear my confusion
    thanks

    No Facelets don�t replace tomahawk. Tomahawk is a package of difrerent components for JSF. So you can work JSF + Tomahawk +Facelets. I haven�t read so much about Facelets but I know is a way to manage the View handler for JSF.
    I hope this help

Maybe you are looking for

  • Trouble with Windows Vista Home Premium SP2 x64

    Hello everyone My system is in a very big mess. I'm using Ideapad y550 and recently I was hit by the continuous restart cycle. I updated my windows as usual and after a system restart as part of the update processs, windows just kept on restarting. "

  • Problem with photo gallery

    I have a 16GB iPad 2 with 5 ios with the latest update and when I realized that the last synchronization into my photo albums is a problem: one of them just disappear and return as soon as I update photos and then clicking again on albums. Why is thi

  • Save as PDF issues

    My computer runs both Mac OS X 10.6.8 and Mac OS X 10.9, I skipped 10.7 and 10.8. On 10.6.8 I double-click on a txt file that has no line more than 80 characters long and it brings up TextEdit. Then I click File->Print->pdf->"save as pdf" and it crea

  • Delay or no response when clicking on internet and mail links

    For the past day or so, whenever I click on mail messages or internet links with the left side of the mouse, they're either very delayed and I have to click on them several times, or they don't open at all. My mail, in particular , isn't opening. I c

  • Purchasing an Album via iTunes Store

    When looking through the iTunes Store, I found an album that I want to purchase. If I purchased this album, would it just insert the music into my iTunes Library, or would I receive the music CD through the mail? Please reply ASAP Thank you so much i