• Post Reply Bookmark Topic Watch Topic
  • New Topic

dought on request.getParameter();  RSS feed

 
Omkar G. Deshmukh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi team,

i am requesting one parameter through request.getParameter(); in my servlet from on jsp. what will happend if i dont pass values to this parameter from that jsp.

will it cause Bad Request exception?

kindly give me the solution for this if yes.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it?
 
Omkar G. Deshmukh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its working fine .

but somtimes my resine showing Bad request exception.

i just want to know is it good way of prograamming or not?
because in my logic i am calling this servlet two times ...
one with parameter and without parameter.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there is no matching parameter, the method will simply return null.

If you are getting a Bad Request response, the problem lies elsewhere.
 
Omkar G. Deshmukh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you sir.

but can you tell me the reason for getting this "BadRequestException"?
this will help me a lot....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not with the information you have supplied. You have wrongfully guessed that it has something to do with un-submitted parameters. Beyond that we have no idea what the issue is.

Please read TellTheDetails and ItDoesntWorkIsUseless and supply more information regarding the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!