jsf-2

renaming jsf.js.jsf to jsf.js.xhtml

风格不统一 提交于 2019-12-12 03:17:18
问题 The xhtml pages contain <script src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&stage=Development" type="text/javascript"></script> If I remove the scripts the javascript functions do not work as expected. The requirement is to support only .xhtml pages. So, I went ahead and removed servlet-mapping for .jsf in web.xml, which results in javascript functions being executed incorrectly. So, can we change jsf.js.jsf to jsf.js.xhtml? 回答1: That should be done automatically if you're properly

Conditional linking to an CSS file

我怕爱的太早我们不能终老 提交于 2019-12-12 03:16:17
问题 In my JSF2 project I want to include following two style sheet to my Facelet page based on a condition which is to be obtained from a managed bean. <link rel="stylesheet" href="css/menu_style_1.css" type="text/css" /> <link rel="stylesheet" href="css/menu_style_2.css" type="text/css" /> How can I achieve this? 回答1: try <h:outputStylesheet name="css/menu_style_1.css" target="head" rendered="#{myBean.myValue eq 'myCondition1'}"/> and <h:outputStylesheet name="css/menu_style_2.css" target="head"

/Registration.xhtml @19,81 validator=“#{UsernameValidator}”: Identity 'UsernameValidator' was null and was unable to invoke

风格不统一 提交于 2019-12-12 03:14:25
问题 This is my project structure: This is in my XHTML file: <h:inputText id="username" value="#{user.username}" required="true" validator="#{UsernameValidator}" /> <h:message for="username"/> And here is UsernameValidator class: @FacesValidator("UsernameValidator") public class UsernameValidator implements Validator { @Override public void validate(FacesContext fc, UIComponent uic, Object value) throws ValidatorException { JOptionPane.showMessageDialog(null, "in validator class"); if (String

java.lang.NumberFormatException: Trying to extract rowIndex from clientId 'j_idt36:j_idt38:j_id2' For input string: “j_idt38”

守給你的承諾、 提交于 2019-12-12 03:13:02
问题 I am using EJB 3.0 + JPA 2.0 + PrimeFaces 3.2 + JSF 2.0. The navigation in my application was great with no problems when I repeated the same code in every page. When I template.xhtml I used as a master page so that the same code applies to all pages, an error message comes: javax.servlet.ServletException: Trying to extract rowIndex from clientId 'j_idt36:j_idt38:j_id2' For input string: "j_idt38" This link show you when the error message rises: http://www.youtube.com/watch?v=rR6CqwBREpM

IE-8 Compatible issue with Primefaces?

雨燕双飞 提交于 2019-12-12 03:11:48
问题 Hi i am having a problem with IE -8 because when i execute my code in Chrome and mozilla it is good ! but in IE-8 it is not executing properly. saying that dialog.show is not defined <p:calendar value="#{bean.method}" mode="inline"> <p:ajax update="@all" event="dateSelect" listener="#{Bean.method1}" oncomplete="dialog.show()" /> <p:schedule id="dialog" initialDate="#{Bean.method3}"/> showing Errors . When i click on the Date Calendar the Date in the Schedule is getting displayed. but in IE-8

authorization in JSF2

徘徊边缘 提交于 2019-12-12 03:09:41
问题 what is the best way to implement authorization in JSF2? through, servlet filter, phase listener or ther is something new that I am not aware of? 回答1: There are two pieces to this: Authentication, and Authorisation. First Authentication: You can configure your web.xml to perform JAAS-based authentication according to a url pattern. Alternatively, if url-based authentication is too coarse-grained for you, you could do this manually with a PhaseListener or page actions using the

mojarra is not defined

♀尐吖头ヾ 提交于 2019-12-12 03:08:37
问题 I'm developing JSF application with mojarra. I'm getting javascript error "mojarra is not defined". After deploy everything is ok, ajax call works properly. But after refreshing page, error appears. There is lack of javascript include in head tag after refreshing. It seems to be working very moody. Same behavior I have on Tomcat and Glassfish, Mojarra is in version 2.0.3. 回答1: One of the reason this error can appear is by using <head>..</head> and <body>...</body> tags instead of <h:head>...<

@ManagedBean and @Transactional - bug in Spring? Workarounds?

两盒软妹~` 提交于 2019-12-12 03:08:23
问题 I had the following JSF backing bean in my Webapp @ManagedBean class MyBackingBean implements Serializable { private MyHibernateRepository repository; ... @Transactional public void save() { .... repository.save(myObject); } } When it gets to the repository.save method call - I get the following error no transaction is in progress I've got two questions Is this because of a bug like this? I believe there are two workarounds - are there any others? 2.1 First workaround - using

Save Upload image into local system folder in jsf 2.0

痞子三分冷 提交于 2019-12-12 03:06:35
问题 I am new to jsf frame work.I am using jsf2.0 in eclipse ide.I have try to upload a images in jsf2.0.I have uploaded the image but it stored on eclipse server.The problem is when i clean the server the images are deleted.So i need a help,to upload photo into system local folder.please find and help me. 回答1: You need to specify an absolute path in new File (or new FileOutputStream , depending on how you're locating the result file). So, do not do File file = new File("uploads/filename.ext");

Liberty profile: birt and jsf integration

风流意气都作罢 提交于 2019-12-12 02:59:19
问题 I'm building a web application running on Liberty profile 8.5, with JSF 2.0 feature enabled (jsf-2.0 in server.xml) and BIRT integration in the web app. The web application includes all BIRT needed libs in WEB-INF/lib folder, but the only way to make it working (specially for chart report) is to set the classloader to 'parentlast' in the server.xml: <webApplication contextRoot="MyApp" id="MyApp" location="MyApp.war" name="MyApp"> <classloader delegation="parentLast"/> </webApplication> In