File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes is there any way to add new http prams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "is there any way to add new http prams" Watch "is there any way to add new http prams" New topic
Author

is there any way to add new http prams

Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
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

Joined: Dec 11, 2004
Posts: 13410

You could wrap the request object from a filter and override the getParameterMap method.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
can you show me example please ?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Apr 27, 2006
Posts: 597
thanks for the example i just miss informetion how to use it with jsp
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You won't be able to do this from a JSP page.
It will involve some java coding
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
no problem about java coding but how i implement it with jsp ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

You won't be able to do this from a JSP page.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
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

Joined: Oct 21, 2004
Posts: 43
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.


SCJP 1.2, SCWCD 1.4.<br />What goes around comes around ... with ver 1.1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is there any way to add new http prams