|
|||||||||||||
How To Build A Survey: Using JSPAbout JSP/Java A huge benefit of the survey tool is that if you know how to write Java and JSP, you can make your survey do almost anything. Branching, advanced branching, randomizing pages, and nearly anything you can think of the logic for is all possible when you edit the you web pages directly. If you want to understand this, it is a good idea that you have some experience in programming, especially programming in Java.
A "JSP" page is similar to an HTML file, except that the file name ends with ".jsp" instead of ".html". And, it's dynamic -- HTML pages don't change when the user visits them, but a JSP page does. JSP Commands and TagsIn page1.jsp, there are several commands that create the survey and show the page. Let's go through them one at a time.
This includes another JSP page, the contents of which you can imagine to be "included" directly into this page, as if copied and pasted automatically. The file named "include_questionnaire.jsp" you can see that it includes several other files, and it starts the beginning of a webpage. Similarly, at the end of page1.jsp, you'll see
This does the same thing as the first one, including a bunch of HTML and other things that end up at the bottom of the page. The middle tag will load the survey and the questions that you made in the Survey Editor:
This is called a "JSP tag" -- it loads a little program which creates HTML and puts it into the page. The tag's name is "survey:surveypage", shown at the beginning. This loads one page of the survey. The text in the middle are parameters. To see how to use and modify JSP Tags, see the surveypage documentation. For many JSP tags, there is better information in the JavaDocs. More Information About JSP/Java For more information about using JSP and Java, you may want to try a tutorial or two:
|
|
||||||||||||