Pages

Thursday, April 26, 2012

Maven Tomcat Plugins



I tried to install and build a war into a tomcat server through 
maven. 
 I add the following tomcat plugin into the pom.xml file 



<plugins> 
        <!-- Maven Tomcat Plugin --> 
        <plugin> 
                <groupId>org.codehaus.mojo</groupId> 
                <artifactId>tomcat-maven-plugin</artifactId> 
                        <configuration> 
                                <server>TomcatServer</server> 
                        </configuration> 
        </plugin> 
</plugins>




Wednesday, April 25, 2012

My First Project in Maven

Steps to build and execute a maven project

·    Install jdk 1.7 and set the class path
·     Install 3.0.4 and set the class path -http://maven.apache.org/download.html#Installation
·    Type “mvn –version” in the command prompt to check whether the maven installed properly or not.
 ·   Create a directory to build your project and go that directory via command prompt
       C:\users\Lukshy\Project>
 ·   Type “ mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=org.yarlithub.yschool -DartifactId=yschool” in the command prompt. 


       · Then a directory yschool (project name) has created in that folder. Go to that directory and compile the project.
      Type “mvn compile” 
      C:\users\Lukshy\Project\yschool> mvn compile

 ·  Here also the build success message displayed
 ·  Include the jetty plugin in the pom.xml file
      · Type "mvn install jetty : run” . Now the jetty will be start.
 · Now we can see the page in the browser.Go to the browser and type:   
      http://localhost:8080/yschool
·    Go to the file index.jsp along this path yschool -->src --> main --> webapp -->index.jsp and we can we can edit it. 






Tuesday, April 24, 2012

Session 1 - Java web programming

This session was conducted by JK. First he talked about why they started ySchool project and what they going to do with this course.From this course I hope that we can get the ability to develop an open source project.

What I learned
What is web programming?
Web programming is about interaction between the computers via browser.JSP and Servlets are Java’s web technologies.
Web Server – The webserver contains the all web data. When a client requests a web object it gives the correct object to the client.
Eg: - Apache Server         
ISS
Servlet Container – It is also a webserver. It is most specific to dynamic data.When we write java related applications the apache server doesn’t accept them.  Therefore we need a servlet.  Servlet can process JSP.
Application Server - Application server also a server which exposes business logic to client applications through various protocols.


Process - when a client request a simple web page

  • The client request a simple hello.jsp file to the server
  • The server contains the jsp container. Which is used for process JSP pages
  • The container knows which servlet controller is appropriate to process this page and send to it.
  • Then the servlet page is generated.
  • The page is send back to the container as a servlet class file with a response message.
  • The container execute it and send the response to the client.
MVC - Model View Controller
MVC is a way of splitting an application in to three parts: a model, a view and a controller.
Nowadays we have to satisfy multiple type of end users. There fore we need a Model View Controller to support different type of users.
In web applications 
JSP pages are the views and the servlets are as controllers.




      

ySchool Project


I have a great opportunity to participate at the free crash course on Java web programming. This free online course is held by yarlIt hub community for developing ySchool project.
As a Jaffna student I would like to say, joining on yschool project is a good chance to us. Because we haven’t got any opportunity like this yet