aspose file tools*
The moose likes Servlets and the fly likes filter, forward,ajax call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "filter, forward,ajax call" Watch "filter, forward,ajax call" New topic
Author

filter, forward,ajax call

Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 149
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: 19760
    
  20

Moving to Servlets.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
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: 61648
    
  67

The URL should start with the context path of the web application, which is not necessarily just /.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 149
Thank you both. That was helpful.
 
 
subject: filter, forward,ajax call