Simplicity 233 User Manual

Browse online or download User Manual for Mini tillers Simplicity 233. 233-29: Building an Online Entry Form with WebAF (and a

  • Download
  • Add to my manuals
  • Print
  • Page
    / 19
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
1
Paper 233-29
Building an Online Entry Form with WebAF™ (and a Little Java)
Frederick Pratter, Eastern Oregon University, La Grande, Oregon
ABSTRACT
The AppDev Studio® software suite from SAS® is a comprehensive set of tools for developing web
applications. This paper is intended as a quick introduction to WebAF, the SAS IDE (Integrated
Development Environment) for building dynamic web content based on SAS data. Once an initial system
configuration has been established, it is possible to provide dynamic access to SAS datasets in real-time for
thin clients that do not have any SAS software available. This is accomplished using the JavaServer Pages
technology from Sun Microsystems, along with some server-side SAS resources
.
INTRODUCTION
Obviously, there is far more material than could be covered in a single conference paper, but the general
steps in the procedure can be summarized as follows:
1. Start a SAS job spawner on a SAS/Connect server
2. Start a Tomcat session on a web server
3. Create a web application base directory on the server
4. Register a connection to the spawner
5. Create a new WebAF project
6. Add JSP content to the project
7. Stir well and serve.
The following example is based on an online examination application that was developed to demonstrate
how to build an entry form using WebAF. Hopefully, the examples provided will give a sense of how easy it
can be to create complex web forms using SAS (and a little Java).
Before starting WebAF, it is important to perform several preliminary housekeeping tasks, summarized as
steps 1-3 in the list above. Explaining what these do and why they are necessary can be a little complicated.
STEP 1: REMOTE DATA SERVICES
SAS supports several different ways to access data on a remote server, including SAS/SHARE,
SAS/CONNECT and SAS/IOM. The latter two reply on a server program called a Remote Host Spawner.
The spawner program listens for TCP connections to the host, just like a web server but on a different port
(by default, 2323). The following example describes starting the SAS Connect Spawner, but the principles
are the same for IOM.
Starting the spawner is handled differently on Windows and UNIX. On Windows servers, the spawner
program is stored in the SAS root directory. Just run spawner.exe from a command window, or if AppDev
Studio has been installed on the server you can use the handy SAS menu selection under Version 8
Start>Programs>AppDev Studio>Services>SAS V8>Start SAS Connect Spawner. (The other choices
are Start SAS IOM Spawner and Start SAS Share Data Server.) Under Windows 2000 and XP it is
possible to install the spawner as a service, so that it will run as a background process whenever the server
is started. For a complete list of the available startup options, see Starting and Stopping SAS/Connect in the
SAS System Help contents under Help on SAS Software Products>SAS/Connect Software.
On UNIX, the spawner program is installed by default under the SAS root directory in
utilities/bin/sastcpd and can be started with the following command:
SUGI 29 Tutorials
Page view 0
1 2 3 4 5 6 ... 18 19

Summary of Contents

Page 1 - SUGI 29 Tutorials

1Paper 233-29 Building an Online Entry Form with WebAF™ (and a Little Java) Frederick Pratter, Eastern Oregon University, La Grande, Oregon ABSTRACT

Page 2

10ADDING A CONNECTION OBJECT For the online examination example the first JavaServer Page prompts the student to select a test from the ones availabl

Page 3

11ADDING A DATASET OBJECT Once the connection has been instantiated, the DatasetInterface control must be added to reference the specific EXAMS.TESTS

Page 4

12Note that in the EXAMS.TEST data set, the first column is the test number and column 2 is the name of the test. The data are passed to the page con

Page 5

13 Figure 13. HTML Form Element The form get method calls the next JavaServer Page, page1.jsp. (If you want to suppress the parameter display you can

Page 6

14Whichever method is chosen, a window appears at the bottom of the display with something like the following text. Starting tomcat. Check logs/tomca

Page 7

15CONCLUSION As should be obvious from this brief introduction, AppDev Studio is an extremely powerful and flexible collection of tools for web devel

Page 8

16APPENDIX I – SAMPLE DATA SETS EXAMS tnum tname 1 Astronomy 2 Chemistry 3 Geology 4 Meteorology 5 Physics 6 Mathematics 7 Computer Science QUESTION

Page 9

17APPENDIX II – More JavaServer Pages page1.jsp – Display the next question <%-- page1.jsp --%><%@taglib uri="http://www.sas.com/taglib

Page 10

18page2.jsp – display the correct answer <%-- page2.jsp --%><%@taglib uri="http://www.sas.com/taglib/sasads" prefix="sasads&q

Page 11

19<%-- begin HTML code --%><html><head><title>On-line Exam Demo: page2.jsp</title></head><body><h1 style

Page 12

2sastcpd -service spawner –shell &The sastcpd program runs by default as a daemon, so it is not necessary to use nohup . Again, if you want it to

Page 13

3C:\AppDevStudio\WebAppDev\templatescontains a couple of web application “starter” directories, called empty and sasads. Of course empty is not reall

Page 14

4When you start WebAF for the first time, you will only see one connection: the default one. To create another connection, click on New. This will di

Page 15

5Port: 2323Intransients differing from the defaultProperty Default Modified-------- ------- --------debugTelnetConnectClient trueinitialStatementisAp

Page 16

6real time 0.00 secondscpu time 0.00 secondsNOTE: SAS Server: Authorization commencing...NOTE: SAS Server: Client LOGONNOTE: NEW task=3 factory=8387

Page 17

7Three text input boxes show up: Project name, Java package and Location. The only one of these that you have to specify is the project name—in this

Page 18

8text brings up a list additional of field values that can be automatically inserted into the text. In this case, the generated URL is http://localh

Page 19

9STEP 6. CREATING A NEW JAVASERVER PAGE WebAF will automatically open a new JavaServer Page. Or a new JSP page can be readily constructed in WebAF by

Comments to this Manuals

No comments