• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
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?
 
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 VI Editor Redhat
  • 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
 
Your buns are mine! But you can have this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic