http://www.tutorialspoint.com/spring/spring_overview.htm
http://docs.spring.io/docs/Spring-MVC-step-by-step/
https://youtu.be/iCQspqBpOB0
http://www.tutorialspoint.com/spring/spring_overview.htm
http://docs.spring.io/docs/Spring-MVC-step-by-step/
https://youtu.be/iCQspqBpOB0
자바 웹 어플리케이션에 대해서 매우 정리가 잘 되어 있는 글이다.
추가로 서블릿에 대해서도 함께 정리해 보면,
Servlets are server side components that provide a powerful
mechanism for developing server side programs. Servlets
provide component-based, platform-independent methods for
building Web-based applications, without the performance
limitations of CGI programs. Unlike proprietary server
extension mechanisms (such as the Netscape Server
API or Apache modules), servlets are server as well as
platform-independent. This leaves you free to select a "best
of breed" strategy for your servers, platforms, and tools.
Using servlets web developers
can create fast and efficient server side application
which can run on any servlet enabled web server. Servlets
run entirely inside the Java Virtual Machine. Since the
Servlet runs at server side so it does not checks the
browser for compatibility. Servlets can access the entire
family of Java APIs, including the JDBC API to access
enterprise databases. Servlets can also access a library of
HTTP-specific calls, receive all the benefits of the mature
java language including portability, performance,
reusability, and crash protection. Today servlets are the
popular choice for building interactive web applications.
Third-party servlet containers are available for Apache Web
Server, Microsoft IIS, and others. Servlet containers are
usually the components of web and application servers, such
as BEA WebLogic Application Server, IBM WebSphere, Sun Java
System Web Server, Sun Java System Application Server and
others.
Servlets are not designed for a specific protocols. It is
different thing that they are most commonly used with the
HTTP protocols Servlets uses the classes in the java
packages javax.servlet and javax.servlet.http. Servlets
provides a way of creating the sophisticated server side
extensions in a server as they follow the standard framework
and use the highly portable java language.
source: http://www.allinterview.com/showanswers/4911/what-is-servlet-and-what-you-get-when-we-use-servlets.html
general definition of Servlet from Wikipedia
http://help.websiteos.com/support/limitations_on_cgi_scripts.htm
http://www.hinduwebsite.com/webresources/cgiscripts.asp
View 가 필요없는 서비스일 경우엔 바로 Servlet으로 구현하고, View 가 필요한 서비스일 경우엔 JSP 를 활용.
reference : Performance Comparison of Alternative Solutions For Web-To-Database Applications
Source:
https://stackoverflow.com/questions/1913098/what-is-the-difference-between-an-interface-and-abstract-class
An interface is a contract: the guy writing the interface says, "hey, I accept things looking that way", and the guy using the interface says "OK, the class I write looks that way".
An interface is an empty shell, there are only the signatures (name / params / return type) of the methods. The methods do not contain anything. The interface can't do anything. It's just a pattern.
E.G (pseudo code):
// I say all motor vehicles should look like this:
interface MotorVehicle
{
void run();
int getFuel();
}
// my team mate complies and writes vehicle looking that way
class Car implements MotorVehicle
{
int fuel;
void run()
{
print("Wrroooooooom");
}
int getFuel()
{
return this.fuel;
}
}
Implementing an interface consumes very little CPU, because it's not a class, just a bunch of names, and therefore there is no expensive look-up to do. It's great when it matters such as in embedded devices.
Abstract classes, unlike interfaces, are classes. They are more expensive to use because there is a look-up to do when you inherit from them.
Abstract classes look a lot like interfaces, but they have something more : you can define a behavior for them. It's more about a guy saying, "these classes should look like that, and they have that in common, so fill in the blanks!".
e.g:
// I say all motor vehicles should look like this :
abstract class MotorVehicle
{
int fuel;
// they ALL have fuel, so why not let others implement this?
// let's make it for everybody
int getFuel()
{
return this.fuel;
}
// that can be very different, force them to provide their
// implementation
abstract void run();
}
// my team mate complies and writes vehicle looking that way
class Car extends MotorVehicle
{
void run()
{
print("Wrroooooooom");
}
}
While abstract classes and interfaces are supposed to be different concepts, the implementations make that statement sometimes untrue. Sometimes, they are not even what you think they are.
In Java, this rule is strongly enforced, while in PHP, interfaces are abstract classes with no method declared.
In Python, abstract classes are more a programming trick you can get from the ABC module and is actually using metaclasses, and therefore classes. And interfaces are more related to duck typing in this language and it's a mix between conventions and special methods that call descriptors (the __method__ methods).
As usual with programming, there is theory, practice, and practice in another language :-)
---------------------------------------------------------------------------------------------------------------
The key technical differences between an abstract class and an interface are:
When a programmer executes the following make from README file, he may have a compile error related on 'size_t' of
"cd ../libfree # continue building the basic library
make "
Solution : Refer this site.
(replace size_t with socklen_t)
Then you execute 'make' without other error.
Eclipse 는 no package structure Jar 안에 있는 class 를 읽을 수 없다.
이 경우, 해당 jar 를 classpath에 설정한 후, default package 안에 class를 만들어서 호출하면 사용 가능.
cmd 콘솔에서 Java Package 를 직접 컴파일하고 실행할 때 어느 위치에서 해야하는지 정리해 보았습니다.
항상 Eclipse같은 IDE에서만 실행했더니, 막상 cmd에서 할 땐 많이 햇갈리네요.
4번째 수정, 더 이상 수정할 일 없기를...
-4th-------------------------------------------------------------------------------------------
C:\SourceCodes\src\ ← compile, run 위치
└algo ← (pacakge)
└rbtree ← Source file, Dependency 위치 (pacakge)
Compile :
C:\SourceCodes\src\javac -classpath .\algo\rbtree; -d . .\algo\rbtree\RedBlackBST.java
Run :
C:\SourceCodes\src\java -classpath .\algo\rbtree; algo.rbtree.RedBlackBST < .\algo\rbtree\tinyST.txt
http://www.jitendrazaa.com/blog/java/compile-and-run-java-program-in-package-from-command-line/
-3rd-------------------------------------------------------------------------------------------
D:\ProjectFolder\
└bin\ ← class 파일 위치(명령어 실행 위치)
└src\ ← compile 위치
└Main.java
└lib\
└ojdbc14.jar
└etc.jar
└vo\
└util\
폴더 : ProjectFolder, src(package 아님), lib
package : vo, util
compile :
D:\ProjectFolder\src\javac -classpath .;lib\etc.jar;ojdbc14.jar; -d ../bin Main.java
실행 :
D:\ProjectFolder\src\bin>java -classpath .;lib\etc.jar;ojdbc14.jar; Main
-2nd--------------------------------------------------------------------------------
파일 위치 및 명령어 실행 위치 현황
D:\Java_EXE \
└Genealogy2 \ ←명령어 실행 위치
└data
└lib ← swt.jar 위치
└META-INF
└src \ ← 실행 파일 위치
실행 명령어
"C:\Program Files\Java\jdk1.5.0_14\bin\"java -classpath lib\swt.jar; src/ManageGenealogy
-1st---------------------------------------------------------------------------------
cmd 콘솔에서 package를 컴파일하고 실행할 때.
d:\PackageTest\ ← 컴파일 및 명령어 실행위치
└Util ← PackageTest.java 위치
컴파일 명령 : javac -d . PackageTest.java
실행 명령 : java Util/PackageTest
댓글을 달아 주세요