Search Results

Search found 1116 results on 45 pages for 'jsf'.

Page 24/45 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • managed beans as managed properties

    - by Sean
    I am using JSF 1.1 on WebSphere 6.1. I am building search functionality within an application and am having some issues. I've stripped out the extras, and have left myself with the following: 4 managed beans: SearchController - Controller bean, session scope SearchResults - session scope (store the results) ProductSearch - session scope (store the search conditions) ResultsBacking - Backing bean for DataTable, used to determine which row was clicked, request scope The SearchController bean has, as managed properties, the other 3. All except ResultsBacking are session scoped. If there is only 1 item in the search results, I want to bring up that record directly. I call setFirst(0) for the data table in the ResultsBacking method (I want to use the existing method that handle which item was clicked, so this is called right after the setFirst). When I go to do another search, I get an IllegalArgumentException when calling getRowData in the data table. According to the api, this is thrown 'if now(sic) row data is available at the currently specified row index'. I'm confused as to why this happens. It works the first time but not the second. Do I need to remove the ResultsBacking on a new search to get rid of the old state?

    Read the article

  • Error while using JSFUnit/HtmlUnit/CSSParser

    - by brianf
    We've just recently converted our project to using Maven for builds and dependency management, and after the conversion I'm getting the following exception while trying to run any JSFUnit tests in my project. Exception class=[java.lang.UnsupportedOperationException] com.gargoylesoftware.htmlunit.ScriptException: CSSRule com.steadystate.css.dom.CSSCharsetRuleImpl is not yet supported. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:527) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537) ... All the dependencies and JARs for JSFUnit were pulled with Maven using the JBoss repository (http://repository.jboss.com/maven2/). We're using the following dependencies in the project: jboss-jsfunit-core 1.2.0.Final jboss-jsfunit-richfaces 1.2.0.Final richfaces-ui 3.3.2.GA openfaces 2.0 JSF 1.2_12 Facelets 1.1.14 Before the dependencies were being managed by Maven, we were able to run our JSFUnit tests just fine. I was able to semi-fix the issue by using a ss_css2.jar file that someone had tucked into our WEB-INF/lib directory (from before the Maven conversion). I'm hoping to find out if there's something else I can do to fix the dependencies in Maven rather than resorting to managing some of the dependencies myself.

    Read the article

  • Accessing selected node of richfaces tree from Javascript

    - by kazanaki
    Hello This should be a very simple question. I have a richfaces tree that is rendered using JSF. When the user clicks on a node I want a javascript function to run. Nothing more nothing less. No redirects, no re-submit, no-rerender, no Ajax. Just plain old Javascript. I have seen the onselected attribute of the tree and it indeed fires a Javascript method. But of course I want to know which node was clicked. Here is what I have so far <head> <script type="text/javascript"> function documentClicked(nodeRef) { alert("Node is "+nodeRef); } </script> </head> <rich:tree switchType="client" value="#{ajaxDocumentTree.rootNode}" var="document" onselected="documentClicked()" > <rich:treeNode iconLeaf="../images/tree/doc.gif" icon="../images/tree/doc.gif"> <h:outputText value="#{doc.friendlyName}" /> </rich:treeNode> But this does not work because nodeRef is undefined. I expected that the first argument of the callback would be the selected node but this is not the case. So the question is this: How do I fire a Javascript function with the selected node from a richfaces tree?

    Read the article

  • t:commandSortHeader not being styled

    - by JBristow
    I've got the following JSF: <t:column styleClass="cb-status-column"> <f:facet name="header"> <t:commandSortHeader columnName="externalStatus" styleClass="cb-status-column"> Status </t:commandSortHeader> </f:facet> <h:outputText value="#{tx.externalStatus}" title="#{tx.externalStatus}"/> </t:column> Unfortunately, it renders like this: <th> <a href="#" onclick="return oamSubmitForm('transactionsTableForm','cb-activity-table:j_id131');" id="cb-activity-table:j_id131"> Status </a> </th> How do I get it to look like this: <th class="cb-status-column"> <a href="#" onclick="return oamSubmitForm('transactionsTableForm','cb-activity-table:j_id131');" id="cb-activity-table:j_id131"> Status </a> </th>

    Read the article

  • h:commandButton action not working inside a h:datatable.

    - by Chris
    I'm stuck with this piece of jsf code that I don't understand why it's working when used outside a datatable and doesn't inside a datatable... <h:dataTable id="myTable" rendered="true" value="#{bean.selectedItemsList}" var="items"> <h:column> <h:commandButton action="#{bean.removeItemFromList}" image="/resources/images/deleterow.gif"> <f:actionListener binding="#{bean.actionListenerImpl}" type="com.mycorp.ActionListenerImpl"/> </h:commandButton> </h:column> <h:column> <h:outputText value="#{items}" /> </h:column> </h:dataTable> I read around the net to put value="#{items}" inside the action listener so the action can get the items in the row like this: <f:actionListener value="#{items}" binding="#{bean.actionListenerImpl}" type="com.mycorp.ActionListenerImpl"/> But it's doesn't work either. Bu if I do the action outside the data table everything work fine. <h:commandButton action="#{bean.removeItemFromList}" image="/resources/images/deleterow.gif"> <f:actionListener binding="#{bean.actionListenerImpl}" type="com.mycorp.ActionListenerImpl"/> </h:commandButton> Side note I also tried a4j:commandButton and didn't so I guess my problem is probably the actionlistener or how the bean handling it.

    Read the article

  • Occasional weird Glassfish errors, resolved by a restart?

    - by Pooria
    I'm developing a web app using netbeans with GlassFishv3. Every once in a while when I add a new feature in my app, glassfish starts nagging with stupid errors, after a lot of time wasting and panicking, i restart glassfish and run my application again, then suddenly the errors all go away and my site starts acting correctly. (or in case I have made a real mistake, i receive a reasonable & descriptive error from GF.) [Edit: the rest of the question was revealed to have been my own mistake.] But the problems don't end there. Recently, i added the ability to write comments in a (JSF) page, after the user submits their comment, i add it to the database and redirect to the same page, so that hopefully the page refreshes with the new comment, but it wont! The underlying Mysql database shows that the new comment has been added, but the page just wont show the new comment! I've tried everything (e.g. deleting browser cache, using different browsers) but only after restarting GF is when the page shows the new comment! Do you have any idea what the problem could be? Could this be a Glassfish bug? What i am using: JSF2, EJB3.1, JPA, MySql

    Read the article

  • 'send' button error 401

    - by jjd
    I'm having a strange error with 'Send' button I have the following code on my page <div id="fb-root"></div> <script type="text/javascript"> (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=<myAppId>"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <br/> <fb:like send="true" width="450" show_faces="true"></fb:like> The 'send' button works fine if I access the application via IP address, but if I use a domain name, Facebook returns The page at http://<...>.com:8080/pages/question.jsf could not be reached because the server returned status code 401. Meantime 'like' button works fine. The application front-end is built with JSF2+Primefaces. Any ideas would be appreciated Thanks

    Read the article

  • Managed bean property value not set to null

    - by Vladimir
    Hi! I'm new to JSF, so this question might be strange. I have an inputText component's value bound to managed bean's property of type Float. I need to set property to null when inputText field is empty, not to 0 value. It's not done by default, so I added converter with the following method implemented: public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) throws ConverterException { if (StringUtils.isEmpty(arg2)) { return null; } float result = Float.parseFloat(arg2); if (result == 0) { return null; } return result; } I registered converter, and assigned it to inputText component. I logged arg2 argument, and also logged return value from getAsObject method. By my log I can see that it returns null value. But, I also log setter property on backing bean and argument is 0 value, not null as expected. To be more precise, it is setter property is called twice, once with null argument, second time with 0 value argument. It still sets backing bean value to 0. How can I set value to null? Thanks in advance.

    Read the article

  • Trigger JavaScript action after Datatable is loaded

    - by perissf
    In a JSF 2.1 + PrimeFaces 3.2 web application, I need to trigger a JavaScript function after a p:dataTable is loaded. I know that there is no such event in this component, so I have to find a workaround. In order to better understand the scenario, on page load the dataTable is not rendered. It is rendered after a successful login: <p:commandButton value="Login" update=":aComponentHoldingMyDataTable" action="#{loginBean.login}" oncomplete="handleLoginRequest(xhr, status, args)"/> As you can see from the above code, I have a JavaScript hook after the successful login, if it can be of any help. Immediately after the oncomplete action has finished, the update attribute renders the dataTable: <p:dataTable var="person" value="#{myBean.lazyModel}" rendered="#{p:userPrincipal() != null}" /> After the datatable is loaded, I need to run a JavaScript function on each row item, in order to subscribe to a cometD topic. In theory I could use the oncomplete attribute of the login Button for triggering a property from myBean in order to retrieve once again the values to be displayed in the dataTable, but it doesn't seem very elegant. The JavaScript function should do something with the rowKey of each row of the dataTable: function javaScriptFunctionToBeTriggered(rowKey) { // do something }

    Read the article

  • Where is the taglib definition of PrimeFaces 4?

    - by Michael Wölm
    I am looking around how to define custom components in JSF. According to the Java EE tutorial, any custom component needs to be described in a taglib. When I take a look into the PrimeFaces source, I cannot find any taglib file or any hint where the namespace is bound and the available components are defined. I am adding primefaces jar to my dependencies, adding xmlns:p="http://primefaces.org/ui to the xml namespace, defining some primfaces components on my page and it works... Ok, but neither I can find the related taglib in the source or binary package nor my IDE (IntelliJ) is able to find where "xmlns:p="http://primefaces.org/ui" is pointing to. Therefore, code completion is also not possible. (all other mojarra taglibs are found.) Is it possible that PrimeFaces is defining the taglib via annotations directly in Java classes or is it generating it during runtime? I can easily find the UIComponents, primefaces defines in its source, but the configuration of the taglib seems to be missing. I am sure I just don't know how PrimeFaces is doing it, but the javaeetutorial is not describing any other opportunity than defining a ...-taglib.xml

    Read the article

  • How to bind a servlet to a context?

    - by simpatico
    I got javax.servlet.ServletException: Error instantiating servlet class servlets.MemoServlet javax.naming.NameNotFoundException: Name servlets.MemoServlet is not bound in this Context when using <form action="MemoServlet"> I know I could use managedbeans, but I've to use servlets. I suspect the problem has to do with JSF. context.xml: <?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" path="/MemoWeb/faces"/> web.xml: <servlet-mapping> <servlet-name>MemoServlet</servlet-name> <url-pattern>/faces/MemoServlet</url-pattern> </servlet-mapping> <servlet> <servlet-name>MemoServlet</servlet-name> <servlet-class>servlets.MemoServlet</servlet-class> </servlet> I seem to have this problem all over the place: com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection on managed bean userManager .... Caused by: javax.naming.NameNotFoundException: Name user.UserManager is not bound in this Context

    Read the article

  • Catch hibernate exceptions with errorpage handler?

    - by membersound
    I'm catching all exceptions within: java.lang.Throwable /page.xhtml java.lang.Error /page.xhtml But what If I get eg a hibernate ex: org.hibernate.exception.ConstraintViolationException Do I have to define error-pages for EVERY maybe occuring exception? Can't I just say "catch every exception"? Update Redirect on a 404 works. But on a throwable does not! <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> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error.xhtml</location> </error-page> <error-page> <error-code>404</error-code> <location>/error.xhtml</location> </error-page>

    Read the article

  • Why does p:panelGrid not work with ui:repeat?

    - by CycDemo
    If I use as below, I get no error, no output. Why does p:panelGrid not work with ui:repeat? Note : I don't want to use c:forEach because of the I already face a lot of JSF issue. <p:panelGrid> <ui:repeat value="#{MyBean.dataList}" var="data"> <p:row> <p:column> <h:outputText value="#{data.name}"/> </p:column> <p:column> <h:outputText value="#{data.description}"/> </p:column> </p:row> </ui:repeat> </p:panelGrid> MyBean.java public List<Data> getDataList(){ List<Data> result = new ArrayList<Data>(); result.add(new Data("Name 1", "Description 1")); result.add(new Data("Name 2", "Description 2")); result.add(new Data("Name 3", "Description 3")); result.add(new Data("Name 4", "Description 4")); return result; } Expected output with primefaces

    Read the article

  • JSF 2.2, Interceptors 1.2, and JPA 2.1 Replay: Java EE 7 Launch Webinar Technical Breakouts on YouTube

    - by arungupta
    As stated previously (here, here, and here), the On-Demand Replay of Java EE 7 Launch Webinar is already available. You can watch the entire Strategy and Technical Keynote there, and all other Technical Breakout sessions as well. We are releasing the next set of Technical Breakout sessions on GlassFishVideos YouTube channel as well. In this series, we are releasing JSF 2.2, Interceptors 1.2, and JPA 2.1. Here's the JSF 2.2 session: Here's the Interceptors 1.1 session: Here's the JPA 2.1 session: Enjoy watching them over the next few days before we release the next set of videos! And don't forget to download Java EE 7 SDK and try numerous bundled samples.

    Read the article

  • Primefaces tabview: set the active index on tab change

    - by Virgi
    I've got a tab view that contains two tab. When I switch from tab 1 to tab 2, I'm calling some code that executes a validation and updates some values. Depending on the result of this validation, I would like to stay on tab 1, or go to tab 2, and refresh the tabs' content. My tabview: <h:form id="form"> <p:tabView id="tabview" activeIndex="#{ctrl.idx}" dynamic="true" cache="false"> <p:ajax event="tabChange" listener="#{ctrl.doStuff}" update=":form:tabview"/> <p:tab title="Tab 1" id="t1"> <h:panelGrid columns="1" cellpadding="10"> <h:outputText value="#{ctrl.s1}"/> </h:panelGrid> </p:tab> <p:tab title="Tab 2" id="t2"> <h:panelGrid columns="1" cellpadding="10"> <h:outputText value="#{ctrl.s2}"/> </h:panelGrid> </p:tab> </p:tabView> </h:form> My test code that simly changes the values: public void doStuff() { s1 = String.valueOf(Math.random()); s2 = String.valueOf(Math.random()); } I thought that changing the active tab index in my method would be enough, like that: public void doStuff() { // ... idx = 0; } On tabChange event, the method is called but the tabview components goes to the clicked tab, ignoring the idx new value. I thought adding an update attribute to p:ajax would render the whole tabview but only the tabs and/or the tabs' content is re rendered. And weirdest of all, if I change update=":form:tabview" to update=":form" or update="@form", I only receive the tab's content in the ajax response - the component disappears from the page! My bean is viewscoped, I'm using Primefaces 3.5, JSF 2.1 and Tomcat 7. Any idea? Thanks.

    Read the article

  • Form value not passed to Seam bean after a4j reRender

    - by Casper
    I'm making a webapp in Seam but ran into a problem I can't seem to fix. I have a JSF form where the customer can select a reservation type through a combobox. Based on the selected value, other form components gets rendered. For example: the customer selects Hours as reservation type, a panelGroup gets rendered where the customer can select a start- and an end hour. But if the customer would select 'part of the day' as reservation type, a selectOneMenu gets rendered where the customer can select a part of the day (morning, afternoon, evening) The rerendering well but the values of the components with a rendered conditional won't get passed to the bean. They stay null values. This is the code i'm talking about: <h:panelGrid columns="2"> <h:outputText value="Reservation Type" /> <h:selectOneMenu value="#{selectedPeriodPart}"> <s:selectItems value="#{productManager.getAvailableDayPartsSpot()}" var="daypart" label="#{daypart.label}"></s:selectItems> <s:convertEnum /> <a4j:support ajaxSingle="true" event="onchange" action="#" reRender="spot"></a4j:support> </h:selectOneMenu> <h:outputText id="date_spot" value="Date" /> <a4j:outputPanel id="calendar_spot" layout="block"> <rich:calendar value="#{reservation.reservationPeriod.startDate}" locale="en" cellWidth="24px" cellHeight="22px" style="width:200px" /> </a4j:outputPanel> <h:outputText rendered="#{selectedPeriodPart eq 'DAY_PART'}" value="Daypart" /> <h:selectOneMenu value="#{selectedDaypart}" rendered="#{selectedPeriodPart eq 'DAY_PART'}"> <f:selectItem id="si_morning" itemLabel="Morning (6:00 - 12:00)" itemValue="morning" /> <f:selectItem id="si_afternoon" itemLabel="Afternoon (12:00 - 18:00)" itemValue="afternoon" /> <f:selectItem id="si_evening" itemLabel="Evening (18:00 - 00:00)" itemValue="evening" /> </h:selectOneMenu> <h:outputText rendered="#{selectedPeriodPart eq 'HOURS'}" value="Hours" /> <h:panelGroup id="hours_spot" rendered="#{selectedPeriodPart eq 'HOURS'}"> <ui:include src="/includes/reservation/select_hours.xhtml" /> </h:panelGroup> </h:panelGrid> </s:div></code> Note: The calendar value do get passed back to the bean but the value of this piece of code doesn't (it does if you remove the rendered conditional):

    Read the article

  • Javascript self contained sandbox events and client side stack

    - by amnon
    I'm in the process of moving a JSF heavy web application to a REST and mainly JS module application . I've watched "scalable javascript application architecture" by Nicholas Zakas on yui theater (excellent video) and implemented much of the talk with good success but i have some questions : I found the lecture a little confusing in regards to the relationship between modules and sandboxes , on one had to my understanding modules should not be effected by something happening outside of their sandbox and this is why they publish events via the sandbox (and not via the core as they do access the core for hiding base libary) but each module in the application gets a new sandbox ? , shouldn't the sandbox limit events to the modoules using it ? or should events be published cross page ? e.g. : if i have two editable tables but i want to contain each one in a different sandbox and it's events effect only the modules inside that sandbox something like messabe box per table which is a different module/widget how can i do that with sandbox per module , ofcourse i can prefix the events with the moduleid but that creates coupling that i want to avoid ... and i don't want to package modules toghter as one module per combination as i already have 6-7 modules ? while i can hide the base library for small things like id selector etc.. i would still like to use the base library for module dependencies and resource loading and use something like yui loader or dojo.require so in fact i'm hiding the base library but the modules themself are defined and loaded by the base library ... seems a little strange to me libraries don't return simple js objects but usualy wrap them e.g. : u can do something like $$('.classname').each(.. which cleans the code alot , it makes no sense to wrap the base and then in the module create a dependency for the base library by executing .each but not using those features makes a lot of code written which can be left out ... and implemnting that functionality is very bug prone does anyonen have any experience with building a front side stack of this order ? how easy is it to change a base library and/or have modules from different libraries , using yui datatable but doing form validation with dojo ... ? some what of a combination of 2+4 if u choose to do something like i said and load dojo form validation widgets for inputs via yui loader would that mean dojocore is a module and the form module is dependant on it ? Thanks .

    Read the article

  • form inside tabview doesn't work

    - by user3536737
    i am working with jsf and primefaces , and here is what 've tried well i want to creat a tabview that get data from an arraylist in my bean i get for exemple 4 tabs , and inside each one i've created a hidden panel where i have a form with 2 input text to update informations , do i display the panel when i click on the second button Update , after that my panel is not hidden anymore , and i set the new values and click on the second button to update the informations , the problem is that the updating and the execution is working only for the first tab , it means when i try to update the new informations it works for the first one and for the other tabs it doesn't here is the code <p:tab title="#{rr.nom_ressource}"> <h:panelGrid> <h:graphicImage value="Ressources/images/emp.jpg" style="vertical-align:middle" /> <span style="font-size:15px; width:170px; display:inline-block;"> Nom : #{rr.nom_ressource} Type: #{rr.type_ressource} Specification: #{rr.experience} </span> <h:commandButton image="Ressources/images/delete.jpg" actionListener="#{SelectBean.act}" update=":form" style="vertical-align:middle" > Update </h:commandButton> <h:commandButton update=":outPanel" actionListener="#{SelectBean.mod1()}" image="Ressources/images/update.png" style="vertical-align:middle" > Modifier </h:commandButton> <h:form id="form111"> <p:growl id="growl" showDetail="true" sticky="true" /> <p:panel rendered ="#{SelectBean.bol}" closable="true" toggleable="true" id="outPanel" styleClass="outPanel" widgetVar="outpanel"> <h:outputLabel value="Nom " /> <h:inputText value="#{SelectBean.nom}" /> <br/> <h:outputLabel value="Experience " /> <h:inputText value="#{SelectBean.exp}" /> <br/> <h:commandButton value="Update" action="#{SelectBean.done}"/> </p:panel> </h:form> </h:panelGrid> </p:tab> for my managedbean the code is correct i think the problem is here

    Read the article

  • Exception thrown while accessing HTML DataTable in backing bean

    - by Denzil
    Hi folks, I am building a simple application in JSF with the CrUD functionality. I am trying to implement edit functionality using the tomahawk component .I am unable to retrieve the selected row in my backing bean. Here's my JSP file snip: <t:dataTable id="data" binding="#{selectOneRowList.dataTable}" styleClass="scrollerTable" headerClass="standardTable_Header" footerClass="standardTable_Header" rowClasses="standardTable_Row1,standardTable_Row2" columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column" var="car" value="#{selectOneRowList.list}" sortColumn="#{selectOneRowList.sortColumn}" sortAscending="#{selectOneRowList.sortAscending}" preserveDataModel="false" preserveSort="true" preserveRowStates="true" rows="10" > <h:column> <f:facet name="header"> <h:outputText value="Select"/> </f:facet> <t:selectOneRow groupName="selection" id="hugo" value="#{selectOneRowList.selectedRowIndex}" onchange="submit();" immediate="true" valueChangeListener="#{selectOneRowList.processRowSelection}"/> </h:column> <h:column> <f:facet name="header"> </f:facet> <h:outputText value="#{car.id}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Cars" /> </f:facet> <h:outputText value="#{car.type}" /> </h:column> <t:column sortable="true"> <f:facet name="header"> <h:outputText value="Color" /> </f:facet> <h:outputText value="#{car.color}" /> </t:column> </t:dataTable> Here's my backing bean SelectOneRowList.java : public void editCar(ActionEvent event) { System.out.println("Row number ## " + _selectedRowIndex.toString() + " selected!"); System.out.println("Datatable ::"+ dataTable); System.out.println("Row Count ::" + dataTable.getRowCount()); dataItem = (SimpleCar) getDataTable().getRowData(); //selectedCar = (SimpleCar) _list.get(Integer.parseInt(_selectedRowIndex.toString())); selectedCar = (SimpleCar) dataTable.getRowData(); System.out.println(dataTable.getRowData()); } My DTO{Data Transfer Object} which is SimpleCar.java contains the variables ID, type, color and their respective setters/getters. The dataItem variable is of type "SimpleCar". The dataTable is of type HTMLDataTable. I am able to get the the first 3 SOP's but the 4th SOP isn't printed. I receive the following exception on the server : javax.faces.el.EvaluationException: Exception while invoking expression #{selectOneRowList.editCar} org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156) javax.faces.component.UICommand.broadcast(UICommand.java:89) javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97) javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171) org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32) org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95) org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70) javax.faces.webapp.FacesServlet.service(FacesServlet.java:139) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341) On click of the edit button the editCar method in my backing bean is invoked. I need to get the data of the selected row in my backing bean. Why is the exception occurring ? The above example is taken from the tomawhawk examples WAR distributed on the website. I have gone through many links including the ones on BalusC but none of them have helped. Regards,

    Read the article

  • Losing sessions on GlassFish

    - by synti
    I have a web application that logs users in a @SessionScoped managed bean. It's all the basic stuff, pretty much like this: users logs in using regular http form and gets redirect to user area (wich is protected using a filter). But if any resource on that area is accessed, the request somehow uses a new session, wich has no managed bean, no user, and the filter does his job, redirecting him to login page. Here's the login form: <h:form> <h:outputLabel for="email" value="Email "/> <p:inputText id="email" size="30" value="#{loginManager.email}"/> <h:outputLabel for="password" value="Password "/> <p:password id="password" size="12" value="#{loginManager.password}"/> <p:commandButton value="Login" action="#{loginManager.login()}"/> </h:form> The loginManager managed bean: @ManagedBean @SessionScoped public class LoginManager implements Serializable { @EJB private UserService userService; private User user; private String email; private String password; public String login() { user = userService.findBy(email, password); if (user == null) { // FacesMessage stuff } else { return "/user/welcome.xhtml?faces-redirect=true"; } } public String logout() { FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); return "/index.xhtml?faces-redirect=true"; } // Getters, setters (no setter for user) and serialVersionUID And then comes the filter that protects the user area: @WebFilter(urlPatterns="/user/*", displayName="UserFilter") public class UserFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpSession session = ((HttpServletRequest)request).getSession(false); LoginManager loginManager = (LoginManager) session.getAttribute("loginManager"); if (loginManager == null || !loginManager.hasUser()) { HttpServletResponse resp = (HttpServletResponse) response; resp.sendRedirect("index.xhtml"); } final User user = loginManager.getUser(); if (user.isValid()) { chain.doFilter(request, response); } else { HttpServletResponse resp = (HttpServletResponse) response; resp.sendRedirect("index.xhtml"); } } The UserService is just a stateless EJB that handles persistence. Part of the JSF for user area: <h:form> <p:panelMenu> <p:submenu label="Items"> <p:menuitem value="Add item" action="#{userItens.addItems}" ajax="false"/> <p:menuitem value="My items" /> </p:submenu> </p:panelMenu> </h:form> And finally the userItens managed bean. @ManagedBean @RequestScoped public class UserItens { private User user; @PostConstruct private void init() { HttpSession session = (HttpSession) FacesContext.getCurrentInstance() .getExternalContext().getSession(false); LoginManager loginManager = (LoginManager) session.getAttribute("loginManager"); if (loginManager != null) user = loginManager.getUser(); } public String addItems() { // Doesn't get here. Seems like UserFilter comes first, doesn't find // an user and redirects. } I'm using glassfish and session timeout is now on 0.

    Read the article

  • Seam conversation ending suddenly when using Redirect

    - by Markos Fragkakis
    Hi all, Because I get some errors on conversations ending abruptly, I created in my project some test pages that reproduce the issue. The navigation takes place between pageA.xhtml and pageB.xhtml. Please tell me if I am using something in the wrong way. My configuration: Seam 2.2.0.GA WebLogic 10.3.2 (11g) Richfaces 3.3.2 JSF 1.2 Note: the same happens when using annotations to begin / end conversations ======= PAGE A @Name("pageaAction") public class PageaAction { @Out(required = false, scope = ScopeType.CONVERSATION) Person person; public String rule3() { person = new Person(); person.setEmail("[email protected]"); person.setName("markos"); return "rule3"; } } <?xml version="1.0" encoding="UTF-8"?> <page> <navigation> <rule if-outcome="rule3"> <begin-conversation /> <redirect view-id="/pages/seam_sandbox/pageb.xhtml" /> </rule> </navigation> </page> ... <h:commandButton action="#{pageaAction.rule3()}" value="h:commandButton" /><br/> ... ======= PAGE B @Name("pagebAction") public class PagebAction { @In(required = false, scope = ScopeType.CONVERSATION) Person person; public String redirectA() { return "redirectA"; } } <?xml version="1.0" encoding="UTF-8"?> <page> <navigation> <rule if-outcome="redirectA"> <end-conversation before-redirect="true" /> <redirect view-id="/pages/seam_sandbox/pagea.xhtml" /> </rule> </navigation> </page> ... <h:commandButton action="#{pagebAction.redirectA()}" value="h:commandButton" /> ... ========== EXCEPTION: This happens after a random number of redirects. javax.faces.FacesException: {pagebAction.redirectA()}: java.lang.IllegalStateException: No conversation context active at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at javax.faces.component.UICommand.broadcast(UICommand.java:387) at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324) at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299) at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256) at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) Caused by: javax.faces.el.EvaluationException: java.lang.IllegalStateException: No conversation context active at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) ... 45 more Caused by: java.lang.IllegalStateException: No conversation context active at org.jboss.seam.ScopeType.getContext(ScopeType.java:133) at org.jboss.seam.Component.getValueToInject(Component.java:2325) at org.jboss.seam.Component.injectAttributes(Component.java:1736) at org.jboss.seam.Component.inject(Component.java:1554) at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) at eu.emea.pim.prs.web.seamsandbox.PagebAction_$$_javassist_seam_8.redirectA(PagebAction_$$_javassist_seam_8.java) 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:597) at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335) at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280) at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59) at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65) at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) ... 46 more

    Read the article

  • javax.servlet.ServletException: WriteText method cannot write null text

    - by Learner
    I have created a Web application using JSF+Icefaces+Richfaces+Primefaces.It is working great while I run it from eclipse as a project but When I created its WAR file and deployed in GlassFish Server then while rendering a page it is throwing this exception javax.servlet.ServletException: WriteText method cannot write null text I searched but didn't get any good solution.A quick help is highly appreciated Edit:1 I think this would be the relevant part for this <li class="page_item" id="liMasterSearch"> <!-- this is for hide (<li class="page_item hide" id="liMasterSearch"> applied to every class) --> <h:commandLink value="Search" action="#{masterRenderBean.showSimpleSearch}"></h:commandLink> </li> <li class="page_item" id="liAdvanceSearch"> <h:commandLink value="Advance Search" action="#{masterRenderBean.showADVS}"></h:commandLink> </li> Here you can see two links (1) Search and (2) Advance Search when I click on Search , It shows search page (By rendering-Actually I have included all pages in masterpage and render them on commandlink functions) <h:panelGroup rendered="#{not masterRenderBean.simpleSearch}"> <ui:include src="../../WebPages/SearchPages/MasterSearch.xhtml"></ui:include> </h:panelGroup> But When I click on Advance Search link (on which this part should render) <h:panelGroup rendered="#{not masterRenderBean.advs}"> <ui:include src="../../WebPages/SearchPages/PersonalAdvanceSearch.xhtml"/> </h:panelGroup> The browser show the above exception. NOTE: Keep in mind that this problem is occurring in deploying.It is not coming in actual application when I run it from eclipse from code EDIT:2 I found in server logs that this exception is coming due to acefaces and this portion of code <ace:autoCompleteEntry id="txtplaceofbirth" rows="10" autocomplete="false" minChars="2" width="150" value="#{inputPersonal.selectedplcofBirth}" filterMatchMode="none" valueChangeListener="#{inputPersonal.valueChangeEventCity}"> <f:selectItems value="#{inputPersonal.cities}"/> </ace:autoCompleteEntry></h:outputFormat> is messing up.Any idea Why this is hapening? Edit #3: Here is the full tack trace of exception [#|2012-11-19T09:55:48.026+0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=53;_ThreadName=Thread-2;|java.lang.NullPointerException: WriteText method cannot write null text at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:314) at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:340) at com.sun.faces.renderkit.html_basic.OutputMessageRenderer.encodeEnd(OutputMessageRenderer.java:163) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1764) at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757) at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760) at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:142) at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:391) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:722) |#]

    Read the article

  • JSF 2.0: Validate equality of 2 InputSecret Fields (confirm password) without writing Code?

    - by yournamehere
    I'm developing a pure JavaEE6 application with JSF 2.0 and Glassfish. My JSF implementation is Primefaces (beside Mojarra provided by Glassfish). I want to verify if the values of 2 password fields in a JSF form are equal. With Seam, there is the neat component <s:validateEquality for="pw1"/>. I want do to the same without Seam, just using JSF (or maybe a component of a JSF library). Until now i only saw examples which validate the form with a custom validator. But i would like to compare the fields without writing Java code or Javascript code. Is that possible? This what it looks like with Seam: ... <h:inputSecret id="passwort" value="#{personHome.instance.password}" redisplay="true" required="true"> <f:validateLength minimum="8"/> <a:support event="onblur" reRender="passwortField" bypassUpdates="true" ajaxSingle="true" /> </h:inputSecret> ... <h:inputSecret id="passwort2" required="true" redisplay="true"> <!-- find the JSF2.0-equivalent to this tag: --> <s:validateEquality for="passwort"/> <a:support event="onblur" reRender="passwort2Field" bypassUpdates="true" ajaxSingle="true" /> </h:inputSecret> ... Any help is appreciated. Thanks!

    Read the article

  • Modifying JSF Component Tree in PhaseListener

    - by jamiebarrow
    Hi all, I'm having an issue. I've implemented a PhaseListener, which is meant to add a style class to any UIInput components in the tree that have messages attached to them, and removes the style class if it doesn't have any messages attached to them. The PhaseListener runs in the RENDER_RESPONSE phase, and does it's work in both the beforePhase and afterPhase methods while debugging. While debugging, I found that beforePhase doesn't have access to the full component tree, but afterPhase does. Any changes done in afterPhase aren't rendered though. How do I go about this? I want this to be completely server side. Thanks, James

    Read the article

  • JSF 2 Scriptmanager style functionality

    - by CDSO1
    I need to be able to add some javascript to all ajax postback responses (PartialViewContext.isAjaxRequest == true) but I am not succeeding with any implementation I try. I have tried implementing a PhaseListener and adding my script using PartialResponseWriter.insert* to add eval blocks, as well as trying to add the script by creating a script element. (Results in CDATA cannot nest, or just invalid XML) I have tried decorating PartialViewContextFactory to override the PartialViewContext.processPartial and add the script after the wrapped instance has processed it... How should I go about adding sripts to an Ajax response? Something similar to what .NET has with Scriptmanager.registerClientScriptBlock preferably. Thank you

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >