• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RequestDispatcher repeating /servletname problem

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I deployed my servlet under /servletname. the forms in the jsp pages have their action to be "servletname/tag". when page A submits a form and control is returned back to page A using:
RequestDispatcher dis = req.getRequestDispatcher("/pageA.jsp");
dis.forward(req, resp);
the page is displayed but the url in the browser appears as:
'/servletname/servletname/tag'
submit the page again a third time and you get:
'/servletname/servletname/servletname/tag'.
This goes on and on with the /servletname appearing in the url as many times as you submit the form.
what is going on? how do i solve this problem so that the url is:
'/servletname/tag'?
[ April 11, 2002: Message edited by: tom walters ]
[ April 11, 2002: Message edited by: tom walters ]
 
tom walters
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
solved it. the action in the forms was 'servletname/tag' instead of '/servletname/tag'. when i changed the form action to '/servletname/tag' the problem went away.
 
reply
    Bookmark Topic Watch Topic
  • New Topic