Search Results

Search found 106 results on 5 pages for 'nitesh panchal'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Why does @PostConstruct callback fire every time even though bean is @ViewScoped? JSF

    - by Nitesh Panchal
    Hello, I am using datatable on page and using binding attribute to bind it to my backing bean. This is my code :- <?xml version='1.0' encoding='UTF-8' ?> <!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:p="http://primefaces.prime.com.tr/ui"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form prependId="false"> <h:dataTable var="item" value="#{testBean.stringCollection}" binding="#{testBean.dataTable}"> <h:column> <h:outputText value="#{item}"/> </h:column> <h:column> <h:commandButton value="Click" actionListener="#{testBean.action}"/> </h:column> </h:dataTable> </h:form> </h:body> </html> This is my bean :- package managedBeans; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.component.html.HtmlDataTable; @ManagedBean(name="testBean") @ViewScoped public class testBean implements Serializable { private List<String> stringCollection; public List<String> getStringCollection() { return stringCollection; } public void setStringCollection(List<String> stringCollection) { this.stringCollection = stringCollection; } private HtmlDataTable dataTable; public HtmlDataTable getDataTable() { return dataTable; } public void setDataTable(HtmlDataTable dataTable) { this.dataTable = dataTable; } @PostConstruct public void init(){ System.out.println("Post Construct fired!!"); stringCollection = new ArrayList<String>(); stringCollection.add("a"); stringCollection.add("b"); stringCollection.add("c"); } public void action(){ System.out.println("Clicked!!"); } } Please tell me why is the @PostConstruct firing each and every time i click on button? It should fire only once as long as i am on same page beacause my bean is @ViewScoped. Further, if i remove the binding attribute then everything works fine and @PostConstruct callback fires only once. Then why every time when i use binding attribute? I need binding attribute and want to perform initialisation tasks like fetching data from webservice, etc only once. What should i do? Where should i write my initialisation task?

    Read the article

  • How do i access EJB implementing remote interface in separate web application?

    - by Nitesh Panchal
    Hello, I am using Netbeans 6.8 and Glassfish v3.0. I created an ejb module and created entity classes from database and then created stateless session bean with remote interface. Say eg. @Remote public interface customerRemote{ public void add(String name, String address); public Customer find(Integer id); } @Stateless public class customerBean implements customerRemote{ //implementations of methods } Then i created a new web application. But now how do i access remote ejb's in my web application. I could lookup a bean with jndi name but what i want to know is, what type of object it will return? How do i typecast it in customerRemote? I don't have any class named customerRemote in my web application. So, how do i do it? Also, what about the entity class Customer? There is no such class named Customer in my web application also. All ejb's and entity classes are in separate ejb module. Please help me :(

    Read the article

  • Please help me with Red5 server

    - by Nitesh Panchal
    hello, I have installed Red5 server successfully and also am able to run the demos fine. Now, I want to create a sample red5 server application. I created a sample project according to the specific directory structure that Red5 requires. But, now when i try to open this project in Netbeans 6.8, i am unable to because both have a different directory structure. So, Netbeans doesn't consider it as a project. I actually want to convert this project to a war file, so i can deploy it to red5/webapps directory and then red5 deployer service can make project out it automatically. How do i convert this project to a war file? because in Netbeans i am unable to open it. Please help. Thanks in advance :)

    Read the article

  • Servlet Security question about j_security_check, j_username and j_password

    - by Nitesh Panchal
    Hello, I used jdbcRealm in my web application and it's working fine. I defined all constraints also in my web.xml. Like all pages of url pattern /Admin/* should be accessed by only admin. I have a login form with uses standard j_security_check, j_username and j_password. Now, when i type Admin/home.jsf it rightly redirects me login.jsf and there when i type the password i am redirected to home.jsf. This works alright but problem comes i directly go to login.jsf and then type password and username. This time it again redirects me to login.jsf. Is there any way through which i can specify which page to go when successful login is there? I need to specify different different pages for different roles. For Admin, it is /Admin/home.jsf for general users it is /General/home.jsf because login form is shared between different type of users. Where do i specify all these things? Secondly, i want to have a remember me checkbox at the end of login form. How do i do this? By default, it is submitted to j_security_check servlet and i have no control over its execution. Please help. This doesn't seem so hard but looks like i am missing something.

    Read the article

  • How does this iterative Tower of Hanoi work? C

    - by Nitesh Panchal
    Hello, while surfing google, i found this interesting solution to Tower Of Hanoi which doesn't even use stack. Can anybody explain me in brief, what is it actually doing? And this solution really acceptable? #include <stdio.h> #include <stdlib.h> int main() { int n, x; printf( "How many disks? " ); scanf( "%d", &n ); printf("\n"); for (x=1; x < (1 << n); x++) printf( "move from tower %i to tower %i.\n", (x&x-1)%3, ((x|x-1)+1)%3 ); return 0; }

    Read the article

  • How do i solve A datatable problem in JSF

    - by Nitesh Panchal
    I have a databale on index.xhtml <h:dataTable style="border: solid 2px black;" value="#{IndexBean.bookList}" var="item" binding="#{IndexBean.datatableBooks}"> <h:column> <h:commandButton value="Edit" actionListener="#{IndexBean.editBook}"> <f:param name="index" value="#{IndexBean.datatableBooks.rowIndex}"/> </h:commandButton> </h:column> </h:dataTable> My bean :- @ManagedBean(name="IndexBean") @ViewScoped public class IndexBean implements Serializable { private HtmlDataTable datatableBooks; public HtmlDataTable getDatatableBooks() { return datatableBooks; } public void setDatatableBooks(HtmlDataTable datatableBooks) { this.datatableBooks = datatableBooks; } public void editBook() throws IOException{ int index = Integer.parseInt(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("index").toString()); System.out.println(index); } } My problem is i always get the same index in server log even though i click the different edit buttons, Imagine that there is one collection which is supplied to the datatable. I have not shown that in bean. If i change scope from ViewScope to RequestScope it works fine. What can be the problem with @ViewScoped? Thanks in advance :)

    Read the article

  • A beginner's JSF question about form validation

    - by Nitesh Panchal
    Hello, I am having a form and many input elements in that. I want certain fields to be validated, so i keep validateLenth etc on those. And i want some fields to not be validated. For example, i have contact information and address information both on the same page. I want to treat contact information as one group. So if some fields are invalid they should not be submitted and address information to be independent of contact information. Thus, if address information is corrected it should be submitted. I have one form only on the page but two buttons, one for address and one for contact. Simply put :- What is the equivalent of validationGroup of Asp.Net in JSF?

    Read the article

  • How do i set the Transaction Isolation in EJB?

    - by Nitesh Panchal
    Hello, I am not able to find a way to set TransactionIsolation in ejb. Can anybody tell me how do i set it? I am using persistence. I have looked the following classes : EntityManager , EntityManagerFactory, UserTransaction. None of them seems to have any method like setTransactionIsolation or such. Do we need to change persistence.xml? I just read a book named Mastering EJB 3.0 4th edition. They gave a full 10 page theory about Isolation level that this problems occur and that occurs and such things but at the end they gave this paragraph :- "As we now know, the EJB standard does not deal with isolation levels directly, and rightly so. EJB is a component specification. It defines the behavior and contracts of a business component with clients and middleware infrastructure (containers) such that the component can be rendered as various middleware services properly. EJBs therefore are transactional components that interact with resource managers, such as the JDBC resource manager or JMS resource manager, via JTS, as part of a transaction. They are not, hence, resource components in themselves. Since isolation levels are very specific to the behavior and capabilities of the underlying resources, they should therefore be specified at the resource API levels. " What exactly does it mean? What is meant by resource level APIs? Please help me. If persistence has no way to set Isolation Level then why do they give such huge theory in an EJB book and make it heavy in weight unnecessarily :(

    Read the article

  • How do i integrate paypal in my website? Java

    - by Nitesh Panchal
    Hello, I want to integrate paypal in my java web application. I saw that they offer many methods to accomplish this. But i want my visitors to remain on my site only. My friend told me that Paypal offers webservice. But i can't seem to find any documentation on Paypal site. If anybody could help me with this, i would be really very grateful. Please offer me the relevant links on Paypal where i could read and get my things done. Secondly, my friend also told me that we need to give location to paypal where my visitors would be redirected once paypal payment is complete. But i am confused. I am working on localhost. How would Paypal know about my localhost? I have already created my sandbox testing account. What should be my next step. Please explain me in detail. I don't know anything about Paypal. Once i created a demo application of Express checkout where they give a simple button of Pay Now and on clicking on it shopping cart etc appears. But now i want my visitors to stay on same website. Thanks in advance :)

    Read the article

  • Where should i save my images that user uploads? java web application

    - by Nitesh Panchal
    Hello, I am saving the image at this location :- private static String photoGalleryPath = "/Common/PhotoGallery/"; In PhotoGallery. I create userid wise folders and save images. Everything works fine. But when i clean and build my project. The whole folder of PhotoGallery gets deleted. This looks very funny to me :). Why does it delete my whole folder everytime? And what more should i do to tell the extra smart Glassfish to not to delete my folders?

    Read the article

  • Same loop giving different output. Java IO

    - by Nitesh Panchal
    Hi, I am facing a very strange problem where the same loop keeps giving me different different output on change of value of BUFFER final int BUFFER = 100; char[] charArr = new char[BUFFER]; StringBuffer objStringBuffer = new StringBuffer(); while (objBufferedReader.read(charArr, 0,BUFFER) != -1) { objStringBuffer.append(charArr); } objFileWriter.write(objStringBuffer.toString()); When i change BUFFER size to 500 it gives me a file of 7 kb when i change BUFFER size to 100000 it gives a file of 400 kb where the contents are repeated again and again. Please help. What should i do to prevent this?

    Read the article

  • A very strange problem -> CSS file not detected .Java web application

    - by Nitesh Panchal
    Hello, If i browse my site using http://localhost:8080/abc/Login/index.jsf, everything works fine. But if browse it using simply http://localhost:8080/abc, the page is shown but all its images and css files are missing. What can be the problem? I have this in my web.xml :- <form-login-config> <form-login-page>/Login/index.jsf</form-login-page> <form-error-page>/Login/index.jsf</form-error-page> </form-login-config> Probably, images are not getting referenced correctly. Can anybody help me? I have referenced css file as follows :- <link href="./Css/MainStyleSheet.css" rel="stylesheet" type="text/css" /> where Css is folder in Login

    Read the article

  • A beginner's log4J question

    - by Nitesh Panchal
    Hello, i configured log4j for basic purpose usin the conversion pattern :- log4j.appender.rollingFile.layout.ConversionPattern=%p %t %c - %m%n But now i want to log the class name from which the error came as well as the username(available in session object) as well as the date and time when that event occurs. How do i do this? What changes do i need to make in format string? Thanks in advance :)

    Read the article

  • How do i get file path of my file in java enterprise application?

    - by Nitesh Panchal
    Hello, I created java enterprise application and it consists of ejb module and web application. I have plain old xml file in source packages folder in package "common" in my ejb module. I want to pass this file path in File() constructor for one class in ejb module. How do i do it? If i pass any of the below it doesn't work :- new File("abc.xml"); //this take file from glassfish/domains/domain1 :( new File("./abc.xml"); I don't want to pass hardcode path like /home/administrator/appname/module/etc.. I want the path relative from my ejb module. Please help me. I've tried all things. Actually when i created a class in same folder and then try classname.getResource("abc.xml").getPath() it works fine. But what if i don't have any class in that folder. Waiting for your replies

    Read the article

  • How to display image in Swing? in textarea?

    - by Nitesh Panchal
    Hello, I am creating a chat application using JApplet. I have a TextArea where all chat messages go. Everything in working fine and smooth just as you would expect a basic chat application to do. Now i want to add support for gestures. I wanted to know, how can we show an icon in textarea? it only takes string in append() method. Thanks in advance :)

    Read the article

  • How to get rid of library references problem? Java

    - by Nitesh Panchal
    Hello, I created a web application and it used several libraries once upon a time. So i added them but later on i found alternative and actually better ways to do the same things. So i removed references from my project for those jars and libraries. Everything works fine but when i move the same project to my friend's laptop Netbeans 6.8 simply doesn't let me deploy the project and gives the whole bundle of errors of libraries that i used previously but i don't now. I removed all references from build.impl file and then when i deploy it, it works fine. But when i do a clean and build and try to deploy it, build.impl automatically again adds those lines of xml which contain references to libraries an again gives me a whole long list of errors. How do i get rid of this? I am really tired of these silly errors. Thanks in advance :)

    Read the article

  • How do i create these borders in the middle?

    - by Nitesh Panchal
    Hello, I know how to generate rounded corners using images. But please have a look at the link :- http://roundedbox.andreas-kalt.de/ The rounded corners on all four corners are all images, but my question is how are those borders in the middle done? Those green color borders that surround the whole div. The tutorial is given but it is German :(. Also i don't want to use Css3 like -webkit-border-radius etc as they are not yet supported in IE Thanks in advance :)

    Read the article

  • NullpointerException Binding not working JSF managed bean.

    - by Nitesh Panchal
    Hello, I created a simple HtmlInputText <h:inputText binding="#{IndexBean.objUIInput}" /> Then in my managed bean, it is :- private UIInput objUIInput; public UIInput getObjUIInput() { objUIInput.setValue("laala"); return objUIInput; } public void setObjUIInput(UIInput objUIInput) { System.out.println("Set!!"); this.objUIInput = objUIInput; } But i always get NullpointerException. Do i need to do anything extra on my JSF page? like we do jsp:usebean setproperty? Please help me.

    Read the article

  • OOP question about functions that struck me all of a sudden.

    - by Nitesh Panchal
    Hello, May be my question is stupid. But i would like to get it cleared. We know that functions are loaded in memory only once and when you create new objects, only instance variables gets created, functions are never created. My question is, say suppose there is server and all clients access a method named createCustomer(). Say suppose all clients do something which fired createCustomer on server. So, if the method is in middle of execution and new client fires it. Will the new request be put on wait? or new request also will start executing the method? How does it all get managed when there is only one copy of function in memory? No book mentions answers to this type of questions. So i am posting here where i am bound to get answers :).

    Read the article

  • From where can i download free themes for my web application?

    - by Nitesh Panchal
    Hello, I am developing a web application and want to allow user to select theme for his/her personalization. I want to know from where can i find free css theme templates? By theme i mean, same css templates and it should have same css class names referenced in css file, because then only i can load the css file and the whole look and feel gets changed in webpage. If the class names in css files are different then it's not easy. Only thing that should change is images and background color etc. But the layout and css classes should remain same. Any help would be appreciated. Thanks in advance.

    Read the article

  • How do scroll the contents to bottom by default in JTextPane?

    - by Nitesh Panchal
    Hello, I have JTextPane on my window and i have JTextField. When i press enter enter in JTextField, the text gets added in JTextPane. Everything works fine and scrollbar too appears on its own. But, it doesn't appear properly. It automatically scrolls to the beginning of the content in JTextPane. How do i keep the scrollbar to the end of JTextPane? Please let me know if my question is unclear. Thanks in advance :)

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >