jsf-1.2

Calling REST service in my JSF application

若如初见. 提交于 2019-12-11 01:09:32
问题 I have a legacy application written in JSF 1 but I have this requirement to edit the code and call a rest service in my managed bean prior to displaying the user interface. I am just not too sure how to implement this? Anyone have idea over this? 回答1: Actually it isn't an good idea to perform this from @ManagedBean, you in this way mix here presentation and logic. @ManagedBean related more to the presentation layer. In any way you should perform HTTP POST or GET request to your service, get

Custom Validator, should I use FacesContext#addMessage() or throw ValidatorException?

别说谁变了你拦得住时间么 提交于 2019-12-10 23:07:25
问题 I was wondering what is the correct way of implementing the custom Validator in JSF 1.2. In my Validator class' public void validate(FacesContext context, UIComponent component,Object value) throws ValidatorException {} method, I am doing the validation check and just adding the FacesMessage instance to the context by context.addMessage(new FacesMessage(xxx...); in case of invalid condition. This seems to be working fine in my application. However, I am not sure if I also need to explicitely

How to validate a field in jsf

自作多情 提交于 2019-12-10 12:11:39
问题 I have many fields in my addNew.xhtml page. I have to do validations of the fields on client side. One of the field is city . I want to get a validation error if I don't enter city which says city cannot be left blank . Previously I was working on grails framework and it was a very easy task to customize validations. Now I am working on jsf and I'm having trouble finding good examples on the internet to solve this issue. Can you please help me out in implementing this validation <!DOCTYPE

Cannot click hidden button by JavaScript

与世无争的帅哥 提交于 2019-12-10 00:47:34
问题 function openEditDialog(){ window.showModalDialog('/atmew/pages/asset/searchInclude/assetEdit.mew'); document.getElementById('reData').click(); alert('after rerender'); } then there is a button: <a4j:commandLink id="edit" action="#{searchController.openAssetEdit}" oncomplete="openEditDialog()" immediate="true" ajaxSingle="true"> <h:graphicImage url="/images/edit_icon.png" </h:graphicImage> <f:param name="arId" id="arId" value="#{vo.assetReceiving.id}"/> </a4j:commandLink> The Other button

JSF 1.2 on Wildfly 8 Final - weld-core-jsf is still referencing JSF 2.2 API

主宰稳场 提交于 2019-12-09 00:18:13
问题 I'm currently migrating a JSF-1.2 app to Wildfly 8 Final and am stuck :( First of all, I've read many post with related issues (e.g. https://community.jboss.org/message/845006 or Migrate JSF 1.2 Seam app to WildFly Beta 1) but the proposed solution (excluding the weld subsystem) doesn't work for me. What I did: I followed the multi-jsf feature tutorial here and installed JSF 1.2 as a module for wildfly (to be exact, 3 modules). The next was that I added exclusions for javax.faces.api and com

RichFaces fileUpload not reRendering

 ̄綄美尐妖づ 提交于 2019-12-08 07:53:22
问题 I'm trying to rerender a couple of components following the upload of a file (a photo) but for some reason, upon completion of the upload, the components are not being rerendered. Could anyone please help? I'm using Java 1.6 JSF 1.2 Richfaces 3.3.3 Seam 2.2GA on a 64 bit Windows 7 machine running the app in Tomcat 6; <h:panelGrid columns="2" id="photoGrid" rendered="#{not signUpAction.fileUpRendered}" styleClass="standard"> <h:graphicImage value="#{signUpAction.imageUrl}" width="150" height=

Multiple JSF components inside a PanelGrid

爷,独闯天下 提交于 2019-12-08 07:02:25
问题 I am trying to get the reusable group of jsf 1.2 components inside a panelgrid using Facelet tag file with @Balusc's previous answer at How to make a grid of JSF composite component? as a reference. I have copied /WEB-INF/tags/input.xhtml and example.taglib.xml and the main application xhtml. However, I am running into some issues. 1. If I don't pass the id and simply do <my:input id="cat" type="text" label="FirstName" bean="#{bean}" property="fName" required="true" /> <my:input id="dog" type

Backing bean property that should return a string with html code returns empty string

你说的曾经没有我的故事 提交于 2019-12-08 02:31:23
问题 I have a property in my backing bean that returns html code: public String getHtmlPrevisualizar() { return "<html><head><title></title></head><body>Hello world.</body></html>"; } What I want to do is show this html code in a iframe. I do this with javascript. This is the xhtml page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j

JSF 1.2 startElement and writeAttribute explanation

こ雲淡風輕ζ 提交于 2019-12-07 08:30:42
问题 I've had occasion to write some custom renderers for my project and that's working perfectly well. However I am somewhat confused by some of the parameters in the ResponseWriter methods. The documentation doesn't explain this very well so I'm hoping one of the resident JSF experts can explain this better. Specifically: public abstract void startElement(java.lang.String name, javax.faces.component.UIComponent component) throws java.io.IOException Parameters: name - Name of the element to be

Navigation from managed bean constructor in ADF Faces JSF 1.2

放肆的年华 提交于 2019-12-07 07:33:35
问题 Is it possible to navigate to another page/view from the constructor of the managed bean? I want this redirection if any exception occurred. I have tried many ways: Try-1: getFacesContext().responseComplete(); getFacesContext().getApplication().getNavigationHandler().handleNavigation(getFacesContext(), null, "gotoPartError"); getFacesContext().renderResponse(); Try-2: getServletResponse().sendRedirect("partError.jspx") Try-3: getFacesContext().responseComplete(); getFacesContext()