Skip to content

Commit aa425ad

Browse files
author
Pankaj Kumar
committed
Adding JavaEE and Spring Batch Projects
1 parent 5019408 commit aa425ad

File tree

96 files changed

+3212
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3212
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
4+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
5+
id="WebApp_ID" version="3.1">
6+
<display-name>JAX-RS-HelloWorld</display-name>
7+
8+
<servlet>
9+
<servlet-name>Jersey REST Service</servlet-name>
10+
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
11+
<init-param>
12+
<param-name>com.sun.jersey.config.property.packages</param-name>
13+
<param-value>com.journaldev.jaxrs.service</param-value>
14+
</init-param>
15+
<load-on-startup>1</load-on-startup>
16+
</servlet>
17+
<servlet-mapping>
18+
<servlet-name>Jersey REST Service</servlet-name>
19+
<url-pattern>/*</url-pattern>
20+
</servlet-mapping>
21+
</web-app>

JavaEE/JAX-RS-HelloWorld/pom.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>JAX-RS-HelloWorld</groupId>
5+
<artifactId>JAX-RS-HelloWorld</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<packaging>war</packaging>
8+
9+
<dependencies>
10+
<dependency>
11+
<groupId>com.sun.jersey</groupId>
12+
<artifactId>jersey-server</artifactId>
13+
<version>1.19</version>
14+
</dependency>
15+
<dependency>
16+
<groupId>com.sun.jersey</groupId>
17+
<artifactId>jersey-servlet</artifactId>
18+
<version>1.19</version>
19+
</dependency>
20+
</dependencies>
21+
22+
<build>
23+
<sourceDirectory>src</sourceDirectory>
24+
<plugins>
25+
<plugin>
26+
<artifactId>maven-war-plugin</artifactId>
27+
<version>2.6</version>
28+
<configuration>
29+
<warSourceDirectory>WebContent</warSourceDirectory>
30+
<failOnMissingWebXml>false</failOnMissingWebXml>
31+
</configuration>
32+
</plugin>
33+
<plugin>
34+
<artifactId>maven-compiler-plugin</artifactId>
35+
<version>3.3</version>
36+
<configuration>
37+
<source>1.7</source>
38+
<target>1.7</target>
39+
</configuration>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.journaldev.jaxrs.service;
2+
3+
import javax.ws.rs.GET;
4+
import javax.ws.rs.Path;
5+
import javax.ws.rs.PathParam;
6+
7+
@Path("/test")
8+
public class TestService {
9+
10+
@GET
11+
@Path("/hello/{msg}")
12+
public String sayHello(@PathParam(value="msg") String msg){
13+
return "Hello "+msg;
14+
}
15+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
package com.journaldev.jaxws.service;
3+
4+
import javax.xml.bind.annotation.XmlRegistry;
5+
6+
7+
/**
8+
* This object contains factory methods for each
9+
* Java content interface and Java element interface
10+
* generated in the com.journaldev.jaxws.service package.
11+
* <p>An ObjectFactory allows you to programatically
12+
* construct new instances of the Java representation
13+
* for XML content. The Java representation of XML
14+
* content can consist of schema derived interfaces
15+
* and classes representing the binding of schema
16+
* type definitions, element declarations and model
17+
* groups. Factory methods for each of these are
18+
* provided in this class.
19+
*
20+
*/
21+
@XmlRegistry
22+
public class ObjectFactory {
23+
24+
25+
/**
26+
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.journaldev.jaxws.service
27+
*
28+
*/
29+
public ObjectFactory() {
30+
}
31+
32+
/**
33+
* Create an instance of {@link Person }
34+
*
35+
*/
36+
public Person createPerson() {
37+
return new Person();
38+
}
39+
40+
/**
41+
* Create an instance of {@link PersonArray }
42+
*
43+
*/
44+
public PersonArray createPersonArray() {
45+
return new PersonArray();
46+
}
47+
48+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
2+
package com.journaldev.jaxws.service;
3+
4+
import javax.xml.bind.annotation.XmlAccessType;
5+
import javax.xml.bind.annotation.XmlAccessorType;
6+
import javax.xml.bind.annotation.XmlType;
7+
8+
9+
/**
10+
* <p>Java class for person complex type.
11+
*
12+
* <p>The following schema fragment specifies the expected content contained within this class.
13+
*
14+
* <pre>
15+
* &lt;complexType name="person">
16+
* &lt;complexContent>
17+
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
18+
* &lt;sequence>
19+
* &lt;element name="age" type="{http://www.w3.org/2001/XMLSchema}int"/>
20+
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
21+
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
22+
* &lt;/sequence>
23+
* &lt;/restriction>
24+
* &lt;/complexContent>
25+
* &lt;/complexType>
26+
* </pre>
27+
*
28+
*
29+
*/
30+
@XmlAccessorType(XmlAccessType.FIELD)
31+
@XmlType(name = "person", propOrder = {
32+
"age",
33+
"id",
34+
"name"
35+
})
36+
public class Person {
37+
38+
protected int age;
39+
protected int id;
40+
protected String name;
41+
42+
/**
43+
* Gets the value of the age property.
44+
*
45+
*/
46+
public int getAge() {
47+
return age;
48+
}
49+
50+
/**
51+
* Sets the value of the age property.
52+
*
53+
*/
54+
public void setAge(int value) {
55+
this.age = value;
56+
}
57+
58+
/**
59+
* Gets the value of the id property.
60+
*
61+
*/
62+
public int getId() {
63+
return id;
64+
}
65+
66+
/**
67+
* Sets the value of the id property.
68+
*
69+
*/
70+
public void setId(int value) {
71+
this.id = value;
72+
}
73+
74+
/**
75+
* Gets the value of the name property.
76+
*
77+
* @return
78+
* possible object is
79+
* {@link String }
80+
*
81+
*/
82+
public String getName() {
83+
return name;
84+
}
85+
86+
/**
87+
* Sets the value of the name property.
88+
*
89+
* @param value
90+
* allowed object is
91+
* {@link String }
92+
*
93+
*/
94+
public void setName(String value) {
95+
this.name = value;
96+
}
97+
98+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
package com.journaldev.jaxws.service;
3+
4+
import java.util.ArrayList;
5+
import java.util.List;
6+
import javax.xml.bind.annotation.XmlAccessType;
7+
import javax.xml.bind.annotation.XmlAccessorType;
8+
import javax.xml.bind.annotation.XmlElement;
9+
import javax.xml.bind.annotation.XmlType;
10+
11+
12+
/**
13+
* <p>Java class for personArray complex type.
14+
*
15+
* <p>The following schema fragment specifies the expected content contained within this class.
16+
*
17+
* <pre>
18+
* &lt;complexType name="personArray">
19+
* &lt;complexContent>
20+
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
21+
* &lt;sequence>
22+
* &lt;element name="item" type="{http://service.jaxws.journaldev.com/}person" maxOccurs="unbounded" minOccurs="0"/>
23+
* &lt;/sequence>
24+
* &lt;/restriction>
25+
* &lt;/complexContent>
26+
* &lt;/complexType>
27+
* </pre>
28+
*
29+
*
30+
*/
31+
@XmlAccessorType(XmlAccessType.FIELD)
32+
@XmlType(name = "personArray", propOrder = {
33+
"item"
34+
})
35+
public class PersonArray {
36+
37+
@XmlElement(nillable = true)
38+
protected List<Person> item;
39+
40+
/**
41+
* Gets the value of the item property.
42+
*
43+
* <p>
44+
* This accessor method returns a reference to the live list,
45+
* not a snapshot. Therefore any modification you make to the
46+
* returned list will be present inside the JAXB object.
47+
* This is why there is not a <CODE>set</CODE> method for the item property.
48+
*
49+
* <p>
50+
* For example, to add a new item, do as follows:
51+
* <pre>
52+
* getItem().add(newItem);
53+
* </pre>
54+
*
55+
*
56+
* <p>
57+
* Objects of the following type(s) are allowed in the list
58+
* {@link Person }
59+
*
60+
*
61+
*/
62+
public List<Person> getItem() {
63+
if (item == null) {
64+
item = new ArrayList<Person>();
65+
}
66+
return this.item;
67+
}
68+
69+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
package com.journaldev.jaxws.service;
3+
4+
import javax.jws.WebMethod;
5+
import javax.jws.WebParam;
6+
import javax.jws.WebResult;
7+
import javax.jws.WebService;
8+
import javax.jws.soap.SOAPBinding;
9+
import javax.xml.bind.annotation.XmlSeeAlso;
10+
import javax.xml.ws.Action;
11+
12+
13+
/**
14+
* This class was generated by the JAX-WS RI.
15+
* JAX-WS RI 2.2.4-b01
16+
* Generated source version: 2.2
17+
*
18+
*/
19+
@WebService(name = "PersonService", targetNamespace = "http://service.jaxws.journaldev.com/")
20+
@SOAPBinding(style = SOAPBinding.Style.RPC)
21+
@XmlSeeAlso({
22+
ObjectFactory.class
23+
})
24+
public interface PersonService {
25+
26+
27+
/**
28+
*
29+
* @param arg0
30+
* @return
31+
* returns boolean
32+
*/
33+
@WebMethod
34+
@WebResult(partName = "return")
35+
@Action(input = "http://service.jaxws.journaldev.com/PersonService/addPersonRequest", output = "http://service.jaxws.journaldev.com/PersonService/addPersonResponse")
36+
public boolean addPerson(
37+
@WebParam(name = "arg0", partName = "arg0")
38+
Person arg0);
39+
40+
/**
41+
*
42+
* @param arg0
43+
* @return
44+
* returns boolean
45+
*/
46+
@WebMethod
47+
@WebResult(partName = "return")
48+
@Action(input = "http://service.jaxws.journaldev.com/PersonService/deletePersonRequest", output = "http://service.jaxws.journaldev.com/PersonService/deletePersonResponse")
49+
public boolean deletePerson(
50+
@WebParam(name = "arg0", partName = "arg0")
51+
int arg0);
52+
53+
/**
54+
*
55+
* @param arg0
56+
* @return
57+
* returns com.journaldev.jaxws.service.Person
58+
*/
59+
@WebMethod
60+
@WebResult(partName = "return")
61+
@Action(input = "http://service.jaxws.journaldev.com/PersonService/getPersonRequest", output = "http://service.jaxws.journaldev.com/PersonService/getPersonResponse")
62+
public Person getPerson(
63+
@WebParam(name = "arg0", partName = "arg0")
64+
int arg0);
65+
66+
/**
67+
*
68+
* @return
69+
* returns com.journaldev.jaxws.service.PersonArray
70+
*/
71+
@WebMethod
72+
@WebResult(partName = "return")
73+
@Action(input = "http://service.jaxws.journaldev.com/PersonService/getAllPersonsRequest", output = "http://service.jaxws.journaldev.com/PersonService/getAllPersonsResponse")
74+
public PersonArray getAllPersons();
75+
76+
}

0 commit comments

Comments
 (0)