| Author |
filter, forward,ajax call
|
Miran Cvenkel
Ranch Hand
Joined: Nov 23, 2010
Posts: 138
|
|
I have a request to my site, intercept it, and since I know there is nothing, I forward request to valid address
Then it arrives to the exact page that I want. On that page java script:
Now the prob is that ajax no longer calls to
catchAjaxRequest.jsp
but instead to
gallery/catchAjaxRequest.jsp
which does not exist there.
Any advice ?
I guess I have to change request, before I forward the whole thing ?
|
Searchable nature photo gallery: http://agrozoo.net/jsp/Galery.jsp?l2=en
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Moving to Servlets.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Markas Korotkovas
Greenhorn
Joined: Jan 27, 2011
Posts: 21
|
|
|
In your second snippet you have "catchAjaxRequest.jsp" which is relative path, so when making the request the whole context is included (everything after the domain in your URL). In order to exclude the context add a / like this "/catchAjaxRequest.jsp". This will result in a URL like yourdomain.com/catchAjaxRequest.jsp which is what you are looking for i think.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
|
|
|
The URL should start with the context path of the web application, which is not necessarily just /.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Miran Cvenkel
Ranch Hand
Joined: Nov 23, 2010
Posts: 138
|
|
|
Thank you both. That was helpful.
|
 |
 |
|
|
subject: filter, forward,ajax call
|
|
|