Java provides an approach to reduce the size of Jar so that it can travel on HTTP network faster to deploy jar on a website. Pack200 is a format to compress and decompress jar files. It is a HTTP compression that runs faster on network. Pack200 has been specified in JSR 200. There are two components in Pack200. One is used to pack jar files with .pack extension and other is used to unpack
In hibernate an entity or object has three states. It can be persistent, detached or transient. All the states are defined with hibernate session. Persistent state object resides in session where as detached and transient or not in session. Objects of detached and transient state can later be made persistent. In this page, we will discuss these states in depth.
To show which type file you are using or seeing, you need to enable the File Extension option in your machine. Follow the bellows steps to see your file extension
1. Go to the any folder or where your file is located.
2. Click on the View. A tab will open.
Uploading file using Using RESTful Web Services with JAX-RS is easy. We need to create a method in our resource class. The upload method should be annotated with @POST, @Path and @Consumes. @Consumes take the arguments MediaType. MediaType will be MediaType.MULTIPART_FORM_DATA to upload the file. The upload method will take parameters of @FormDataParam. @FormDataParam provides input to upload file.
JAX-WS is java API for XML Web Service. JAX-WS uses XML messages to communicate with the client. These XML messages are Simple Object Access Protocol (SOAP). JAX-WS contains WSDL description of offered services. WSDL is Web Service Description Language. While using SOAP a contract must be established for the services which are being offered. WSDL describes the contract for SOAP based design.
Spring security facilitates custom login page and custom error messages if authentication failed. In spring security configuration XML, if we look at the , we can declare . This tag has the attribute as login-page and default-target-url. login-page attribute gives the login page URL and default-target-url attribute gives page path when login is successful. Find the below configuration for custom Login page.
JPA is Java Persistence API. JPA provides Object Relational Mapping (ORM) in Java. JPA handles the database query, database optimization, database cache, data saving, querying. JPA covers Java Persistence API, query language, Criteria API and ORM metadata. JPA makes database handling easy.
Lambda expressions are one of the important features included in java 8. Lambda Expressions are used to write concise code for that interface which consist one method i.e. functional interface. Lambda Expression is also used to iterate collection in simple way.
Java NIO 2 provides the API which monitors the given directory. Directory creation, deletion, changing the name of directory or creating any file or directory inside any directory, all can be observed efficiently with WatchService and Watchable of the java.nio.file API which has been introduced in JDK 7. In this way to monitor any file or directory creation, deletion or updation is now very easy with the help of this NIO 2 API.
Singleton Design Pattern is widely used in the software application. This design pattern ensures that a given task will be performed by only one class and that class will be global access of point. So getting one and only one instance of class ensures so many purposes of the developers in different scenario.
Pixel Perfect is a Firefox/Firebug extension that allows web developers and designers to easily overlay a web composition over top of the developed HTML.
1. Open the Mozilla Firefox and hit the Firefox button and click on the Add-ons button.
2. Search Pixel Perfect in the Search box(remember Pixel Perfect only work properly when Firebug id already installed, if Firebug is not installed then first install the Firebug, to add Firebug repeat the same process means search Firebug in Search box )
A bean with prototype scope is initialized every time whenever request for prototype bean is made. The spring container creates more than one instance of prototype scope as required. In the example I have two beans A and B, both have the dependency of the bean X. In this case there will be two instance of bean X in spring container.
We will create a java project with maven in eclipse. We will start from scratch and learn step by step.
1. Install Maven in your Window
2. Install Maven in eclipse
3. In eclipse we will create a simple java project for demo. I have created a java project named as JavaProject in my eclipse. There is a class TestLogger.java . In our demo , there will be a apache logger to print the a message.
This page is devoted to give step by step idea to take input as augments in java program with eclipse. We have a simple java program which will print the first arguments given as an input in eclipse. Find the java program.
In this page, we learn how to integrate spring with hibernate. Spring is a J2EE framework and Hibernate is a ORM that is Object Relation Mapping Tool.
If we integrate these two, they play a great role to run a large application and make the maintenance very easy.