Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

having problem with RequestDispatcher

Thread view: 
Joshua - 09 Feb 2007 02:46 GMT
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.
Joshua - 09 Feb 2007 02:49 GMT
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 - 09 Feb 2007 07:13 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.