| This is a simple JSP Program I
had lying around to get accustomed to using the jsp language and the Java
Reference Implementation. Basic Concepts
enterName.jsp: The code is commented so it is self-explanatory... ( I hope ? )
Quickly a comment on the request object and how I used it. Any variables contained in the HTML Form tag and/or passed on the URL are contained in the request object. This is a useful way to pass information around in HTML. The values are stored as named value pairs and can be retrieved public Object getParameter( String objectName ). Here is displaySavedName.jsp. This page shows how simple it is to retrieve variables for the session.
The name value saved with the session will continue to be saved until the session times out. The timeout value can be set using the method public void setMaxInactiveInterval(int interval). Click here to see source code of enterName.jsp using just Scriplets. I find that sometime combines the HTML embedded in the Scriplets makes the code unreadable and also difficult to maintain. In the end the developer will have the final say, but the poor person left to maintain the code will be the true judge of the results.
|