• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

remove a name/value pair from request

 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, guys:

I am trying to programmatically remove a name/value pair from
request in my jsp file. For example, if I have a path like
the following:
http://localhost:8080/mysampleweb/initpage?isHome=true

If I want to remove "isHome=true" and produce the following
path:
http://localhost:8080/mysampleweb/initpage

Is there a way to do it?

regards,
 
Kedar Dravid
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should do it:
StringBuffer parURL=(StringBuffer)request.getRequestURL();
someString = parURL+"";
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kedar Dravid:
This should do it:
StringBuffer parURL=(StringBuffer)request.getRequestURL();
someString = parURL+"";


Thanks, Kedar. That works.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic