Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   having problem with RequestDispatcher (http://www.velocityreviews.com/forums/t390726-having-problem-with-requestdispatcher.html)

Joshua 02-09-2007 02:46 AM

having problem with RequestDispatcher
 
hi all.
i am currently working with java-based blogging engine.
it's presentation layer is based on struts framework.

to make urls look tidy (www.myblog.com/entry/Test-Entry)
i've been trying to use RequestDispatcher object to forward the
incoming tidy url to our blog engine's native url (such as
http://www.myblog.com/blog/entry/vie...le=Test-Entry).

but it does not work at all.
system yields the log below.

- Invalid path /blog/entry/view was requested

i don't have any idea.
could anybody help me out?
thanks.


joshua song.


Joshua 02-09-2007 02:49 AM

Re: having problem with RequestDispatcher
 
sorry i forgot something.
i used this two lines of simple code:

RequestDispatcher rq = request.getRequestDispatcher("/blog/entry/
view.do?logTitle=Test-Entry");
rq.forward(request, response);


Lew 02-09-2007 07:13 AM

Re: having problem with RequestDispatcher
 
Joshua wrote:
> sorry i forgot something.
> i used this two lines of simple code:
>
> RequestDispatcher rq = request.getRequestDispatcher("/blog/entry/
> view.do?logTitle=Test-Entry");
> rq.forward(request, response);


When you get the RD from request it cannot step outside the current context
root. You have to get the ServletContext of the other context root, then call
ServletContext.getRequestDispatcher(java.lang.Stri ng) on it.

- Lew


All times are GMT. The time now is 04:45 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.