What can I do after the JSWDK is configured? When using http: // localhost: 8080 to open the JSP page, we see the default page specified by jswdk Index.jsp, this page is located in the webpages directory. When we look at JSP or servlets, it is also the various JSP pages in the Examples directory. Compare the examples directory and webpages directory, see what the directory structure of these two directories is the same? Does there have a web-infroductory directory? Open the web-inf directory no two folders? One is a JSP, one is servlets, there are four files, respectively: mappings, webapp, servlets, Mine, look at the properties of these four files, is it a Properties type? Then open the startserver.bat file (of course, open it with a writing board), find the following statement:
Set beanjars =. / example / web-inf / jsp / beans; ./ WebPages / Web-INF / JSP / Beans;
This at least a point, that is, in the Examples folder and the WebPages folder, you can view the JSP page directory, the web-inf / jsp / beans must be located in the beanjars variable. Speaking here, you should know how to set your own release directory. Still give an example:
Create a publisher (for example, JSppages) in the jswdk directory, then build a named web-infer in jsppages, create a JSP and servlets in web-infers, and build a beans in JSP, so that the catalog structure is Basically, then copy mappings, mine, servlets, four files in WebApp to the web-inf directory, and the first step is completed. Next, modify the webserver.xml file and the startserver.bat file. Open the webserver.xml file with a writing board to find the following statement:
Change Examples to JSppages and save, then modify the startserver.bat file to find the following statement:
Set beanjars =. / example / web-inf / jsp / beans; ./ WebPages / Web-INF / JSP / Beans;
Then add the / jsppages / web-INF / JSP / Beans path to the Beanjars variable. Ok, all the work is done here, give a helloworld.jsp program to see:
hEAD>
<%
String msg = "This is JSP Test."
OUT.PRINT ("Hello World!");
%>
html>
Put this JSP file in your own publishing directory or its subdirectory, then run http: // localhost: 8080 / jsppages / helloWorld.jsp
Take a look, isn't it to see Hello World! This is JSP Test. Word? In addition, the Java's bytecode file must be placed in the JSP / Beans directory, and the written JSP file remembers the reference.