本人是剛入門的小小新手,
遇到了一些關於Java的問題,想請教論壇上各位協助
1.若您撰寫了 com.frogjump.hr.Main 及 com.frogjump.prj.Main 與 com.frogjump.mgr.Main 三個 Main Class。請描述如何將它們皆置於 frog_jump.jar 中,且在任何工作路徑下,都能藉由 java -jar frog_jump.jar 命令,執行 com.frogjump.prj.Main 類別。
2.當你試著開發一個Web應用程式,提供會員的新增、修改、刪除、查詢等功能,請簡述如何運用MVC的架構,並且發出相關的商業邏輯與資料整合層的元件;此外,你又該如何達成設計前、後分離的程式?
第一題說明如下
資料來源為 Oracle 官網文件
We want to execute the main method in the class MyClass in the package MyPackage when we run the JAR file.
We first create a text file named Manifest.txt with the following contents:
Main-Class: MyPackage.MyClass
Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.
We then create a JAR file named MyJar.jar by entering the following command:
jar cfm MyJar.jar Manifest.txt MyPackage/*.class
This creates the JAR file with a manifest with the following contents:
Manifest-Version: 1.0
Created-By: 1.7.0_06 (Oracle Corporation)
Main-Class: MyPackage.MyClass
When you run the JAR file with the following command, the main method of MyClass executes:
java -jar MyJar.jar
第二題說來話長(其實是我不會)
我就結束這一回合