having problem with RequestDispatcher

J

Joshua

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
www.myblog.com/blog/entry/view.do?logTitle=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.
 
J

Joshua

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);
 
L

Lew

Joshua said:
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.String) on it.

- Lew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top