SunQuest
           Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old July 2nd, 2002, 10:57 AM
sarimraza sarimraza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 8 sarimraza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 2nd, 2002, 04:50 PM
dhtmlkitchen dhtmlkitchen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 30 dhtmlkitchen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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/

Reply With Quote
  #3  
Old July 2nd, 2002, 04:50 PM
dhtmlkitchen dhtmlkitchen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Boston, MA
Posts: 30 dhtmlkitchen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > request.getParameter() in same page as form .. ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway