Posts

Showing posts with the label services

Eclipse PDE: Everything about Editor

Image
Editors are the most important part of eclipse IDE framework. Editor are the primary framework to create and modify resource like files. Every eclipse plug-in or eclipse based products needs to provide custom editor for editing proprietary resources. I am tried to put important parts of Eclipse Editor Framework in this pos. This is the first post from the series "Everything About Editor" Everything about Editor Document Partition Syntax Highlighting Auto-Edit Strategy Code Completion using Content Assist Eclipse divides the concept of a text editor into two parts: the document and the viewer. While the document holds the actual content of the editor, the viewer is responsible for handling the content display. This nice Model-View-Controller (MVC)-style separation allows you to separate code that manipulates the content of the editor from the part that manipulates its display. The Document represents the "model" part of the text editor framework. It c...

Creating Self-Signed Certificates Open SSL Part 2 : Making Apache HTTP Server SSL enabled.

Image
  In previous post I have explained how to generate self-signed certificates using openSSL. This post We will see how to use this certificate for a secured web application. Now lets use these certificates to make a web application secure. For this I have downloaded Apache HTTP Server including OpenSSL and installed from here. 1. First step is to make Apache HTTP Server SSL enabled. Following the simple steps given below to get SSL enabled Edit <APACHE_INSTALL_HOME>/config/httpd.conf and uncomment following line LoadModule ssl_module modules/mod_ssl.so Include conf/extra/httpd-ssl.conf Edit <APACHE_INSTALL_HOME>/config/extra/httpd-ssl.conf and update following attributes SSLCertificateKeyFile <Location of Server.key file, generated as per previous post> SSLCertificateFile <Location of Server.crt file, generated as per previous post>   2. Restart the Server <APACHE_INSTAL_HOME>/bin/httpd.exe –k restart 3. Install/import certifica...

RESTful WS using Jersey Part 2 – Parameterized approach

Image
This post is in sequel  RESTful WS using Jersey Part 1 - Hello World . It shows how to utilize parameterized urls as well as query string. Please refer Part 1 to know developing restful services from scratch. This post utilizes same example. Parameters can be passed as part of path as well as url query string. Jersey provides two annotations @PathParam   and @QueryParam for extracting parameters from path and query respectively. We have modified getText method to accept both kind of parameters as below 1. Complete resource class will be package demo.resorces; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import javax.ws.rs.PathParam; import javax.ws.rs.Consumes; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.GET; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; /** * REST Web Service * * @author Yogesh */ @Path("hello/{UserName}") p...

RESTful WS using Jersey Part 1 - Hello World

Image
Here is the simple tutorial for RESTful Web Service using jersey implementation for RESTful Web Services. Java EE 6 has introduced jersey API as implementation for JSR-311 as API for RESTful Web Services. For ease of development,deployment and testing i have used NetBean 6.8 which supports JEE 6. Jersey is an annotation based implementation. Here are the few important annotations used in this tutorial @path(“/path/”) - a relative URI path indicating where the Java class will be hosted @GET - a request method designator and corresponds to HTTP Get method @POST - a request method designator and corresponds to HTTP Post method @Produces("text/plain") - specify the MIME media types of representations a resource can produce @Consumes("text/plain") -specify the MIME media types of representations a resource can consume @PathParam("User_Name") - a type of parameter that you can extract for use in your resource class @QueryPar...

New Features in Java Enterprise Edition 6 (JEE 6)

Latest version of Java Enterprise Edition is focused on eae of development and simplicity. Key goals of this version are Extensibility – supports for additional technologies and frameworks Profiles – support for creating custom profiles based on application scope or requirement. Pruning New Features introduced in this edition are Simplified EJB 3.1 No local business interface – one step further from EJB 3.0 specification, EJB 3.1 specifications removes mandatory business interface Singleton EJB – to share application wide data and support concurrent access. EJB 3.1 can be part of war file directly without creating a separate jar file EAR >>       WAR >>             JSP/Static Pages             WEB_INF >>         ...

Deploying Services to OC4J with RESTful support

Image
       OC4J container provide support for RESTful services. OC4J installation comes with web service assembling tool (wsa) which take an extra optional parameter to give REST support. This post explains step by step approach to implement and deply RESTful services to OC4J. 1. Interface Code package demo.service; import java.rmi.Remote; import java.rmi.RemoteException; public interface StringService extends Remote{     public String toUppercase(String str) throws RemoteException;     public String toLowerCase(String str)throws RemoteException; } 2. Implementation for Interface package demo.service; import java.rmi.Remote; import java.rmi.RemoteException; public class StringServiceImpl {     public StringServiceImpl() {     }     public String toUppercase(String str){   ...