Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java. lang. IllegalArgumentException: Path does not start with a "/" character  RSS feed

 
Dhuruv Wadekar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use a web page with form controls on it. when the user clicks on submit, I try to transfer this information to a servlet. In the servlet I try to attach a value to the request and return it, using a request dispatcher like this.

RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("http://www.xyz.com/Index.jsp");
req.setAttribute("operationType", operationType);
dispatcher.forward(req,res);


However my servlet returns a error :

java.lang.IllegalArgumentException: Path http://www.xyz.com/Index.jsp does not start with a "/" character


Can anyone help me resolve this issue?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Dhuruv Wadekar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well Actually the index.jsp that i was talking about is the main jsp page with form controls that is trying to call the servlet. All I m trying to do is to include the operationType object in the request and forward it to the same page...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK.
Did you read the API docs from the link that I posted?
Can you see why the argument to getRequestDispatcher is invalid?
[ April 08, 2008: Message edited by: Ben Souther ]
 
Dhuruv Wadekar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I did....And it's working fine now.... thank you very much...Previously I didn't know that the reference of the URL must be given with respect to Root of that context

Thanks once again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!