Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

requestDispatcher throws IllegalArgumentException - path must be absolute ?

843841Jun 26 2003 — edited Jun 27 2003
Hi,
Here's my code (part of the servlet code, session is a valid HttpSession):
String resourceUrl="http://localhost:8080/test.html";
requestDispatcher=session.getServletContext().getRequestDispatcher(resourceUrl);
I made sure that the file exists and is available via browser. However, that line throws an exception:
>>>
java.lang.IllegalArgumentException: path must be absolute: `http://localhost:8080/test.html'
at com.caucho.server.http.Application.getRequestDispatcher(Application.java:2464)
at test.CookieMonster.service(CookieMonster.java:192)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
...
<<<

I don't know why this happens - I thought resourceUrl was an absolute path. Any suggestions on the subject would be greatly appreciated.
Thank you,

Mark
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2003
Added on Jun 26 2003
2 comments
447 views