• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

filter, forward,ajax call

 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Servlets.
 
Markas Korotkovas
Greenhorn
Posts: 21
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL should start with the context path of the web application, which is not necessarily just /.
 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both. That was helpful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic