OrderEntry.jsp.

Power Java
Techniques for Optimizing Web Site Development and Runtime Characteristics

Christopher A. Fregly
Listing 3. OrderEntry.jsp.


<HTML>
<HEAD>
<TITLE>Order Entry</TITLE>

<SCRIPT>
<!- The following script sets the action
selected by the user. ->

 function submitForm( theAction ){
  document.form.navAction.value = theAction;
  document.form.submit();
}
</SCRIPT>

</HEAD>
<BODY>

<!- order entry HTML here ->

<FORM NAME = "orderEntryForm"
ACTION="/servlets/OrderEntryServlet"
TARGET="main">
<INPUT TYPE = 'button"
NAME = "SubmitOrderAction"
VALUE = "Submit Order"
onClick='submitForm("SubmitOrderAction")'>
<INPUT TYPE = "button"
NAME = "CancelOrderAction"
VALUE = "Cancel Order"
onClick='submitForm("CancelOrderAction")'>

<!-
The following are required to give the controller
servlet enough information to call the appropriate
method and redirect to the next scene.
->
<INPUT TYPE = "hidden"
NAME = "navAction"
VALUE = "">
<INPUT TYPE = "hidden"
NAME = "currentSceneName"
VALUE="OrderEntry">
</FORM>
</BODY>
</HTML>

About the Author

Christopher A. Fregly is Senior Cunsultant for BEA Systems Inc. in Chicago. He can be contacted at chris@fregly.