JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > ... > Tutorial > Create a webapp project structure for your web application
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  Create a webapp project structure for your web application
Added by scud, last edited by yangkaifeng on Apr 10, 2006  (view change)
Labels: 
(None)

开始一个空白的web应用

你能使用 webapps/build.xml 文件创建一个项目结构帮助你快速的开始.
只要运行'ant new'和根据提示信息进行.

new:
     [echo]
     [echo]             +=============================================================+
     [echo]             |              -- Create a new web application  --            |
     [echo]             +=============================================================+
     [echo]

    [input] Enter the name of your new application [myapp]? ww-sample
     [echo] Creating 'ww-sample' web application...
     [copy] Copying 7 files to /Users/rainerh/projects/webwork/webapps/ww-sample
     [copy] Copying 1 file to /Users/rainerh/projects/webwork/webapps/ww-sample
     [echo]
     [echo]             +=============================================================+
     [echo]             |    -- Your Web Application was created successfully! --     |
     [echo]             |                                                             |
     [echo]             | Now you should be able to cd to your application and run:   |
     [echo]             | > ant build -Dwebapp=ww-sample                              |
     [echo]             +=============================================================+

BUILD SUCCESSFUL

此任务是在webapps目录下生成一个新的目录.

例如, 下面是使用'ant new'创建的名为 'ww-sample'的一个新的webapp项目:

webapps/
  ww-sample/
    src/
      java/
         com/opensymphony/webwork/example/HomeAction.java -- A simple action example implementation
      webapp/
        index.jsp -- redirects to home.action
        WEB-INF/
          classes/
            webwork.properties -- Simple properties to use Spring and run webwork in devMode
            xwork.xml -- Basic action mapping sample with 1 action mapping
          pages/
            home.jsp -- The home.jsp referenced via the HomeAction
          applicationContext.xml -- blank Spring definition file. Add your Spring beans here.
          web.xml -- basic web.xml for webwork

你现在能重新创建一个基于webwork运行的项目结构.

你可能想查看其他一些webapp项目例子,或得到一些更高级的使用范例.请查看showcase, starter, 或者shopping-cart应用.

Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators