[ Team LiB ] Previous Section Next Section

Q&A

Form and Form Variable Names

Q1:

I press the Submit button, but the form won't load. What am I doing wrong?

A1:

Aside from checking for spelling errors in the action attribute of the <form>, you must also make sure that the capitalization action attribute matches the name of the form JSP. Even if you are running under Windows, Java is case sensitive, so you can run into problems if you use capitalization that is different from the actual filename when you try to invoke a JSP.

Q2:

Why are the form variable values null?

A2:

If you can't get the value of a form variable, the reason is usually because the name of the variable in the form doesn't exactly match the name you use in the getParameter method, either because of a spelling difference or a capitalization difference.


    [ Team LiB ] Previous Section Next Section