Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
 
Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!