Code for Reading a xlsx file in java
You may need to include some of the jar files like xmlbeans-2.3.0.jar dom4j-1.1.jar poi-ooxml-schemas-3.6-20091214.jar poi-ooxml-3.6-20091214.jar poi-3.6-20091214.jar You can google it and download and include it along with the below code. You have to include a simple xlsx file with some values in it (string values) and run the code. This code will fetch the values and print it on the screen.Similarly you can do for the numeric cells. Or i will paste a different code for it. Leave a comment if you need some help.
Basic example on Spring WebServices using Maven
This is a very basic example on spring webservices purely built on spring. In this example we have use maven to build, apache tomcat as a server. JAXB is used to convert xsd's to java classes. EndPoints are used for minimal configuration to handle incoming request. MessageDispatcher Servlet is used to deliver the soap messages to the endpoints The complete code is available at https://github.com/ankurgoel11/Spring-WS-Basic We will walkthrough the important parts of the code. I have named the project as spring-ws1 There are many ways to create a project. I have created all the directories manually and they are like given below: After Creating the above directory structure open the eclipse and perform the below steps: Step 1: After performing all the above steps you can see the project in your eclipse. Now you have to write the code in eclipse. Open the file pom.xml at the root of the folder and put the below text. Pom.xml will download all the libraries from the internet and generate the java file from the xsd file. All the required libraries will be downloaded and added to eclipse. The plugin in the below pom.xml willl generate java classes for the xsd files present. Now Create the web.xml with the below code. We have defined a servlet MessageDispatcherServlet specifically designed for SOAP messages Create a file with the below code spring-ws-servlet.xml. As the servlet name is spring-ws in the web.xml so we have to name the file as spring-ws-servlet.xml. In this file we have created beans and defined required classes. Create the file user.xsd with the below code. Create the file UserLoginEndPoint.java to handle request and send back response Now compile the project from the command prompt using maven with the below 2 commands: mvn clean eclipse:eclipse mvn install Now deploy the war file on the tomcat server. If you do not get the option as run on server or does not list in the add or remove on the right click of the server. Then export the project as war file and put the war file in the webapps folder. It will be auto deployed. Hit the url: http://localhost:8080/example1/UserService/user.wsdl You will see the wsdl generated. Now open the soap ui and create the project with the above wsdl. Then create a request and send it, you will see a flying response coming in. Please do leave your feedback.
Spring-WebServices using maven, hibernate basic example (hello world)
This example is based on spring, hibernate, maven, webservices, apache-tomcat, DetachedCriteria, orm, EndPoints. Api used in this examples are:
Read File in a String object all at once in java