jsf-1.2

Downloading a file using JSF

匆匆过客 提交于 2021-02-11 14:00:43
问题 Hi I am trying to download a file from server but at the end of my process I end up with only numbers and some weird characters on my browser. It's not downloading the file. I am using seam and JSF 1.2. Here is my code: public void writeBytesToResponse(UploadDefinition _instance, String path) { FacesContext context = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) context .getExternalContext().getResponse(); try { byte[] bytes = getFile(path); response

Programmatically register taglib reference

偶尔善良 提交于 2020-01-15 04:12:46
问题 Is there a way to programmatically, in a java code, register custom taglib reference? I am using JSF 1.2_09, rich faces 3.3.3, jsf-facelets 1.1.14. Specifically: In this code, jsf Expression Language is used to do some job for us, like concatenation of 2 results in one field or similar stuff.. FacesContext ctx = FacesContext.getCurrentInstance(); Application app = ctx.getApplication(); ExpressionFactory ef = app.getExpressionFactory(); ELContext elContext = ctx.getELContext(); ValueExpression

JSF 1.2 Life Cycle understanding: Executing the ValueChangeListener method in InvokeApplication phase

倾然丶 夕夏残阳落幕 提交于 2020-01-14 06:26:22
问题 I am using a <h:selectBooleanCheckbox> in the facet header of a DataTable. All the rows content for that <h:column> DataTable are <h:selectBooleanCheckbox> . The rows are getting selected perfectly the way I wanted. Below is the code I used: <h:form> <h:dataTable value="#{employeeService.employeeList }" var="empl" binding="#{employeeService.dataTablebinding }"> ...... ...... ...... <h:column> <f:facet name="header"> <h:selectBooleanCheckbox id="chkBoxAll" value="#{employeeService.checkedHdr }

content disposition with attachment doesnt work for AJAX response

一世执手 提交于 2020-01-03 04:16:07
问题 The problem for me is pretty straight forward. Onclick of an anchor tag , I execute a javascript using a4j:jsFunction and the action of this function should stream an XML file from server. The problem is , the stream sent on richfaces response doesnt give a saveAs dialog but instead renders the xml on the browser. After reading many articles I understood that Ajax response cannot give a saveAs Dialog. xhtml snippet: <h:form> <a4j:jsFunction name="updateCart" reRender="idFavouritePanel"> <a4j

session handling in JSF 1.2

一曲冷凌霜 提交于 2020-01-03 03:24:51
问题 How do we handle session variables (add/fetch) in JSF 1.2? A scenario: Consider a login screen where the user logs in successfully, the user model is stored in session. The user modes contains the user role. Next time onwards, for every user action, check the user role from the user model and display the form accordingly. In such a case how to add the user odel in session and how to etrieve it every time from the session? Previously I have worked in Struts 1.2 where in the execute method, we

ValueChangeEvents being fired only after other components are clicked

倖福魔咒の 提交于 2019-12-25 01:21:48
问题 I'm trying to use an InputFile within JSF (1.1.7) and Apache Trinidad (1.0.11). I define a change event for it but the event is not being fired when I change the file selection but when I click on another component of the form. Here is the jsp code: <trh:body> <tr:panelPage> <tr:form usesUpload="true" id="myForm"> <tr:inputFile columns="80" id="archivo" valueChangeListener="#{myBean.changeInputFile}" immediate="true"> </tr:inputFile> <tr:commandButton text="Begin"/> </tr:form> </tr:panelPage>

How to make a clickable row in a rich:datatable?

冷暖自知 提交于 2019-12-24 10:39:28
问题 I have a JSF page with a rich:dataTable where, in each row, I put h:commandLink s to lead to pages with the details of the row selected. I wanted to make the whole row clickable, calling the action method when the user clicks anywhere in the row. Is that possible without JavaScript? And if JavaScript is the only way out, what would be the best way do it? Search for a commandLink and "click" it? Thanks in advance! 回答1: I got the whole rows clickable with a bit of styling. I made the links

Passing value from Servlet to JSF Action method in WebLogic

假如想象 提交于 2019-12-24 05:23:07
问题 I am trying to pass an Object from Servlet 's doPost() to JSF's Managed bean 's action method. But I am unable to do that. I have tried to set the value from Servlet as: request.getSession().setAttribute(key, "JYM"); And tried to retrieve it form Managed bean as: FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(key) It is returning null . Also this is also returning null from Managed bean : ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext()

Using Facelets instead of JSP results in java.lang.StackOverflowError at javax.servlet.http.HttpServletRequestWrapper.getSession()

邮差的信 提交于 2019-12-24 02:43:19
问题 I am using JBoss4.2 with the eclipse IDE. When I run the hellojsf program using JSP view technology, it works fine. When I try with Facelets usings the same components, I am getting the below exception: 2012-06-20 12:41:30,941 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/HelloJSF].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception java.lang.StackOverflowError at javax.servlet.http.HttpServletRequestWrapper.getSession

Stop JSF Event Chain

折月煮酒 提交于 2019-12-24 02:10:00
问题 I'm working on modifying a jsf-1.2 application for use on a tablet pc. For that purpose I have made the rows of a table clickable to open the detail view of the rows contents, rather than have the user click on a link in that table (which is the case in the Desktop Version). It works fine so far. Each row can, however, contain two rich-buttons that open a different link. The contents of that link is opened in a new tab, like it's supposed to. My problem is, that the action event of the