好吧,这肯定是今天最简单的问题了。这是我第一次尝试 Java 和 JSP。
我刚刚使用 Eclipse 编写了一个小型 Java 应用程序。现在我想将这个小应用程序提供到网页中。我需要弄清楚Java应用程序和网页之间的联系。
这是我的申请:
public class PhraseOMatic {
public static void main(String[] args) {
// CREATE WORD ARRAYS
String[] wordListOne = {"24/7", "Multi-tier", "30,000 foot", "B-to-B", "win-win", "front-end", "back-end", "web-based"};
String[] wordListTwo = {"empowered", "sticky", "concentric", "distributed", "leveraged", "shared", "accelerated", "aligned"};
String[] wordListThree = {"process", "tipping point", "mindshare", "mission", "space", "paradigm", "portal", "vision"};
// CALCULATE ARRAY LENGTHS
int oneLength = wordListOne.length;
int twoLength = wordListTwo.length;
int threeLength = wordListThree.length;
// PRINT OUT THE PHRASE
int i = 1;
while (i < 10) {
// GENERATE RANDOM NUMBERS
int rand1 = (int) (Math.random() * oneLength);
int rand2 = (int) (Math.random() * twoLength);
int rand3 = (int) (Math.random() * threeLength);
// BUILD A PHRASE
String phrase = wordListOne[rand1] + " " + wordListTwo[rand2] + " " + wordListThree[rand3];
// PRINT OUT PHRASE
System.out.println("What we need is a " + phrase + ".");
i = i + 1;
}
}
}
如何让编译后的应用程序呈现为网页?接下来我需要采取什么步骤?
谢谢!!!