|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
request.getParameter() in same page as form .. ?
I have a jsp page with a form. form contains a textfield, once the user submits the form, i want jsp scriptlet to get the value of the user input and carry out processing on it within the same page and give a result.
problem is the first time the page is loaded, there is an error in the request.getParameter() statement since no form has yet been submitted i guess .... if i use another page ... it works ... but i want to display the information in the same page ... thanks |
|
#2
|
|||
|
|||
|
You must first check if the parameter exists. I see this mistake even by pros.
Code:
String p = request.getParameter("p");
if (p != null) {
. . .
}
You can make some external class for processing this, too. Even better if you can define a tag handler to handle that situation. Geary's 'Advanced Java ServerPages' has a pretty good discussion about custom tags.
__________________
http://dhtmlkitchen.com/ |
|
#3
|
|||
|
|||
|
You must first check if the parameter exists. I see this mistake even by pros.
Code:
String p = request.getParameter("p");
if (p != null) {
. . .
}
You can make some external class for processing this, too. Even better if you can define a tag handler to handle that situation. Geary's 'Advanced Java ServerPages' has a pretty good discussion about custom tags. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > request.getParameter() in same page as form .. ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|