• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is there any way to add new http prams

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
I wander if can shove another http param even if I didn�t send it throw submit
before the the request.getParameterMap(); capture it ?

The reason is :
there is already working system that handling the request paramets I like it to handle another paramer on the way before it retched to the request.getParameterMap();
[ August 31, 2006: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could wrap the request object from a filter and override the getParameterMap method.
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you show me example please ?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The closest example I have is one that wraps the response object and writes the servlet's output to stdout before sending to the browser.

See http://simple.souther.us/capture.war.
[ August 31, 2006: Message edited by: Ben Souther ]
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the example i just miss informetion how to use it with jsp
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You won't be able to do this from a JSP page.
It will involve some java coding
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no problem about java coding but how i implement it with jsp ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You won't be able to do this from a JSP page.
 
Stefan Evans
Bartender
Posts: 1784
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to add a parameter to the request before it gets to this JSP, your best bet is probably to use a ServletFilter.

It can intercept all incoming requests to specified resources, and gives you the chance to run java code before/after invoking the requested resource.
You would need something like this in web.xml. This example shows the filter applying to one JSP only. By setting the url-pattern you can have it affect any resource you like.


And then in the MyFilter class something like this:


You can find a related post in another forum
 
Manzar Zaidi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could add additional parameters to a request forwarding it through a jsp and using jsp:forward actions which let you embed jsp:param inside them, thus adding more actual request parameters to the request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic