SAS Institute. The Power to Know

FOCUS AREAS

Developer Resources

Products

Technologies

API Reference

SAS AppDev Studio 3.0 Developer's Site

Java Technologies for the Server

Java servlets provide a component-based, platform-independent method for building Web applications. Servlets can access any Java API, and they combine built-in support with solid performance for HTTP-specific calls. JavaServer Pages (JSP) technology is an extension of servlet technology that is designed to support HTML and XML page development. It makes it easier to combine static template data with dynamic content. JSP technology can complement servlets in your Web application development.

Servlets (Java Servlet API)

Servlets enable you to perform processing on the server instead of on the client. They are typically executed as the result of a Web browser request, and they produce HTML output that is then displayed on the client. Servlet creation involves writing a Java class using Java code, and then running that Java class from a Web server that incorporates a servlet engine.

With servlets, the process of writing the server-based Java code that creates interactive applications is simplified. Servlets are scalable and fully portable. They enable you to take advantage of object-oriented programming techniques, and they offer excellent performance. Additionally, unlike CGI, servlets use a single process for all requests against the server. Therefore, servlets reduce the risk of overloading the server.

If you are familiar with applet development, then you will find servlet development to be straightforward as well. Unlike applets, servlets are not downloaded to the client. As a result, developers do not have to work with numerous and customized client-side programs nor with the varying environments in which those clients may operate.

SAS AppDev Studio provides support for servlet development through its webAF integrated Java development environment. The webAF Project Wizard can help you create a servlet-based project, and you can also perform integrated servlet debugging through webAF software. Servlets can use InformationBeans in webAF software to access enterprise information and SAS analytical tools. For example, a servlet might dynamically access data from a SAS Server and then format it as HTML to display it on the client Web browser. If necessary, servlet threads can be funneled through the SAS AppDev Studio Middleware Server (MWS). MWS determines how many SAS sessions should be opened to satisfy SAS server demands, effectively performing connection pooling to SAS for requests coming from servlets.

JavaServer Pages

A JSP is an extension of the Java Servlet API that makes it easier to build Web pages that have dynamic content. JSP technology uses XML tags and scriptlets written in Java to encapsulate the logic that generates the dynamic page content. The rest of the page is simply tagged as HTML. JSP technology separates the user interface from the application logic, which

In the simplest terms, a JSP is simply an HTML page that contains embedded Java code.

JSP technology is a good choice for your Web application if your organization requires a standards-based approach, needs to use existing Java expertise, wants to build new Java expertise, or emphasizes reusable components. JSP technology can also be used to create highly scalable enterprise applications that are easy to maintain.

You can embed Java programs directly in the JSP using scriptlet tags. You can also include reusable, cross-platform components (such as InformationBeans or TransformationBeans) with JSP-specific XML tags that make it easy to instantiate JavaBeans components and to manipulate component properties from within your Web page. webAF software provides a set of JavaBeans called TransformationBeans that take data from an existing webAF model and transform it into various representations (such as HTML, XHTML, WML, DHTML and/or JavaScript) that make sense in a Web page based on the requesting client browser.

For more information, see Web Applications Reference.