Resources

SAS® AppDev Studio 3.0 Developer's Site

Quick-Build - Struts Declarative Validation Example

For the detailed steps, see the How to Build - Struts Declarative Validation Example.

Creating the Project and index.jsp Page

  1. Start a new project by choosing File New.
    1. Select a project type of Web Application Project and enter a project name of StrutsValidation. Click OK.
    2. In Step 1 of the wizard, click Next to accept the default location.
    3. Select Struts Framework Web Application as the template and click Next.
    4. Deselect SAS Taglib & T-beans (which automatically unchecks SAS runtime classes, so that only Struts Tag Library remains checked), and click Next.
    5. Accept the default initial content type of Java Server Page and file name index.jsp by clicking Next.
    6. Select Tag Library JavaServer Page as the template and click Next.
    7. Accept the default web application project options by clicking Next.
    8. Click Finish to construct and display the initial files for the project.
  2. Copy and paste the source code for file index.jsp, replacing any existing text, and save the file.

Creating the Other Files

  1. Using the File Open command, open ...Projects\StrutsValidation\webapp\WEB-INF\Classes\Resources\application.properties. Replace the content of the file with the source code, and save it.
  2. Use the File New command to add a new Java Server Page file named submitcomment.jsp, accepting the default values. Replace its content with the source code, and save the file.
  3. Similarly, create a new Java Server Page file named thankyou.jsp. Replace its text with the source code, and save it.
  4. Use the File New command to create a Java source file named SubmitCommentAction.java with a package name of app. On the second page of the wizard, select Simple Java File. Then copy and save the source code.
  5. Replace the existing text of file struts-config.xml with the source code, and save the file.
  6. Use the File Open command to open file ...Projects\StrutsValidation\webapp\WEB-INF\validation.xml. Replace its content with the source code, and save the file.

Testing the Project

  1. Choose Build [arrow] Build Project.
  2. Choose Tools [arrow] Services [arrow] Start Java Web Server.
  3. Wait a few moments and then click the Execute in browser button to display the initial page.