Posts

Showing posts from 2012

JSF 2.0 render issues

If the Component is not rendered on screen then the f:ajax cant do any refreshing as the Id itself is not present on the client DOM.The <f:ajax render> client ID should refer a component which is always rendered on the client side. It will then be exactly the HTML representation of that component which will be updated by JavaScript. If the HTML representation of that component is not there on the client side DOM because the rendered of the component is false , then JavaScript has nothing to find and update and in effect "nothing" will happen. Set it to for example @form which indicates the entire form: which is a very bad practice. Try to wrap the entire component with some thing like a panelGrid or worst case a Form tag and rerender it so that all within the scope is rerendred.

500 Error in Weblogic Server in between requests

Stack Trace looks some what like this java.lang.NoSuchMethodError: javax/servlet/http/HttpServletResponse.getStatus() this happens mostly when there is a cookie clash. if Different applications have same cookie configured then the request from browser is unable to reach server and eventually throws a 500 error .. :)..

Eclipse Helios JSF Xhtml Content Assist Slow

The Content Assist for Eclipse Helios JEE Version seems to be very slow and i did some basic googling and found this quick cure which actually work for me so documenting it here. Turn off JAX-WS Proposals in Content Assist Window > Preferences --> Java > Editor > Content Assist > Advanced " Not Only this other than the following and what format you are working disable everyhting else. The basic things required for JSF perspective are 1.Basic Proposals 2.java Proposals 3. SWT Template 4. Template Proposals Remove all unused items from both the windows and restart eclipse .. Definitely a visible change in content Assist :).. Also one other thing is changing the file assosiation in the Window -- >preferences --> general --> Editors -->File Assosiation and select the Xhtml and use the editor as HTML Editor and click on default.

JSF 2.0 Notes

The return string for an action event if appended with the "faces-redirect=true" will cause the page to redirect to that URL.if no URL then the page name is matched and will be navigated automatically to that  page.                    Eg:  redirectUrl+  "?faces-redirect=true"       2. An ampersand on an xhtml page should be added as "&amp;" to avoid parsing errors.

Concurrency in Java

Process: A process runs independently and isolated of other processes. It cannot directly access shared data in other processes. The resources of the process are allocated to it via the operating system, e.g. memory and CPU time. Threads: threads are so called lightweight processes which have their own call stack but an access shared data. Every thread has its own memory cache. If a thread reads shared data it stores this data in its own memory cache. Threads exist within a process — every process has at least one. Threads share the process's resources, inclu

Core - Java Notes

1. Normal printing of the hashcode will print the Class Name and @hexadecimal value which is default. Inorder to get a custom String on printing the object then override the toString() Method. 2, String and Wrapper class overrides the equals method so that comparison is the same. 3. if we dont override the equals method then the objects wont work properly in sets and cant be used as keys in hashtable. 4.it is possible to use an object as a key in a hashtable but the objects equals property should be overridden else we will never be able to create that key as every object creation will create a seperate hashcode. 5.HashCodes are typically used to increase the perfomance of large large collection of data. 6. in real life hashing also it is not required that one bucket contains only 1 value one bucket can have 2 values with identical hashcode so retrieving froma hashing set is a 2 step process. 1. Find the right bucket and use equals operator. 7. If 2 objects are equal the

Why Spring Over EJB?

1. EJB is Complicated - To implement any functionality we need to touch at least 4 files business Interface,Home Interface,Beans and Deployment Descriptor.However with Spring it works on POJO and can use AOP for further services. 2. EJB is Invasive - In order to implement an interface in EJB we need to use Javax.ejb interface.There is a tight coupling with the EJB and code always requires an EJB container for it to work.however in the case of Spring there is no such direct dependancy on Spring code. 3. Entity Ejb's are not as mature as the ORM frameworks avaliable like Hibernate etc.Spring provides an excellent integration with these ORM frameworks.

Spring AOP

An Enterprise Application has many components and each performing its own function.Some times one component has to perform the function of another like logging,Security,transaction Management all goes into different component to manage.These are called Cross cutting Concerns as they cut into other functionality. AOP Helps us to make these functionalists a different layer and these layer can be applied declaratively.So we add an Aspect to a functionality whose responsibilty is to do its job. The Acegi security system uses Spring’s AOP support as the foundation of a framework that adds declarative security to Spring-enabled applications

File Not Found Exception

banging the head trying to find why the file is not loaded even after adding to classpath. The Simple thing to do is Add the below lines so that the system shows where the classpath location it is trying to access. File file = new File("file.txt"); System.out.println(file.getCanonicalPath());

Spring MVC -- My understandings and Notes

Which is better Bean factory or Application Context?. Bean factory instantiates and Configures the Bean, Application context also does the same however Application Context enables the configured bean for many other enterprise specific features like AOP and transactions. So always Application Context is better except in case where resources are limited as in mobile. Bean Factory provides advanced configuration mechanisms to manage the beans of any types.Application context is build on top of this and provides easy access to features like AOP and Transaction Management.Application Context is Complete super set of Bean factory and all features in bean factory are present in application context and it enables the beans to be more enterprise centric. The org.springframework.beans.factory.BeanFactory is the actual representation of the Spring IoC container .org.springframework.beans.factory.BeanFactory is the actual representation of the Spring IoC container. The Most Commonly

Weblogic Portal Administration Console Log In

If the Web Logic Portal Admin Console doesn't log in after typing the URL.If it just remains in the same page ..try using the HTTPS URL.Get the port from server configuration and make it login.