0

I'm trying to use a dynamic way to call my servlet resources,methods, etc.. in my jsp pages. Currently i'm using <form action=/TestServlet/reg /> how can i get the servlet path or name in my pages without using TestServlet manually !?

Mohammadreza Khatami
  • 1,444
  • 2
  • 13
  • 27
  • Why would you need that to be dynamic? The servlet is mapped to a well-defined static URL, that doesn't change over time. So there's nothing dynamic here. – JB Nizet Apr 30 '16 at 06:49
  • @JBNizet Actually, the root context can be configured at deployment (one common use case is [blue-green deployment](http://martinfowler.com/bliki/BlueGreenDeployment.html)). The JEE specification is highly *dynamic*. – Elliott Frisch Apr 30 '16 at 06:51
  • @ElliottFrisch agreed. I didn't understand that the OP wanted to make the context path dynamic. – JB Nizet Apr 30 '16 at 06:54

0 Answers0