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
- Start a new project by choosing File
New.
- Select a project type of Web Application Project and enter
a project name of StrutsValidation. Click OK.
- In Step 1 of the wizard, click Next to accept the default location.
- Select Struts Framework Web Application as the template and click Next.
- Deselect SAS Taglib & T-beans (which automatically unchecks SAS runtime classes,
so that only Struts Tag Library remains checked), and click Next.
- Accept the default initial content type of Java Server Page and
file name index.jsp by clicking Next.
- Select Tag Library JavaServer Page as the template and click Next.
- Accept the default web application project options by clicking Next.
- Click Finish to construct and display the initial files for the project.
- Copy and paste the source code for file
index.jsp, replacing any existing text, and save the file.
Creating the Other Files
- 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.
- 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.
- Similarly, create a new Java Server Page file named
thankyou.jsp. Replace its text
with the source code, and save it.
- 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.
- Replace the existing text of file
struts-config.xml with the
source code, and save the file.
- 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
- Choose Build
Build Project.
- Choose Tools
Services
Start Java Web Server.
- Wait a few moments and then click the Execute in browser button to display the
initial page.