I have a scenario where i am trying to access a servlet that is cotained as part of the custom webapplication (deployed using wMTomcat) from a DSP which is present in the same package. If i invoke a servlet from a JSP everything seems to work fine, however nothing seems to happen if i invoke the same servlet from the DSP. Since it is in same package i dont want to use the entire URL i.e. http://hostname:port/web/packageName/servletName . If i access the servlet directly as servletName from a JSP, it works fine.
I don’t believe this is possible. A DSP doesn’t access servlets. The only thing they can do is invoke IS services. DSPs use a different processing engine than JSPs.
Where “DownloadFile” is the servlet name and “MY_ENTERPRISE_MONITOR” is the packagename … As usual , servlet class file will be copied into “\web\WEB-INF\classes” folder in package level …and configure web.xml file …
"filepath" and "filename" are the variable values we are passing to Servlet and in servlet, we retrieve them using request.getParameter("FILE_PATH");
My "DownloadFile" servlet has code to download the file from the path that we pass as a parameter from DSP ...
So when we hit on submit button in the dsp , it will invoke the given servlet, as mentioned in the action variable of <FORM> tag, passing filename and filepath as parameters and will download the file......