-
1. Re: How may i Serve Servlet by classname (to Wildfly migration)
swd847 May 4, 2016 9:29 AM (in response to deltrant)There might be some way to do it programatically. How exactly does it work, there are no mappings or listing in web.xml at all, just a mapping to a service class based on name at runtime?
-
2. Re: How may i Serve Servlet by classname (to Wildfly migration)
deltrant May 4, 2016 10:51 AM (in response to swd847)For example, is tottally normal to find something like this in a form:
<FORM ACTION="<%=context%>/servlet/co.com.package.servlet.myServlet" METHOD="post" NAME="FormA" ID="FormA" onSubmit="return false;">
-
3. Re: How may i Serve Servlet by classname (to Wildfly migration)
ctomc May 4, 2016 10:59 AM (in response to deltrant)what you could maybe do is write your own ServletExtension http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#servlet-extensions
where you would scan your classpath for all servlets (check if they are instance of / extend Servlet class)
and than programmatically build up ServletMappings for all servlets http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#creating-a-servlet-deployment
where you would map all of them to full class name of the servlet.
it is not the prettiest solution but it should work for your scenario, this way you would be able to migrate your application easier and step by step.
-
4. Re: How may i Serve Servlet by classname (to Wildfly migration)
deltrant May 10, 2016 12:01 PM (in response to ctomc)HI thanks for the help, finally i mapped all the servlets in web.xml file, i used java to scan all the servlets and generate the strig . I tried your solution, but i can´t get it to work.
-
5. Re: How may i Serve Servlet by classname (to Wildfly migration)
jaikiran May 10, 2016 11:45 PM (in response to deltrant)FWIW - it's not considered a good practice to implicitly map these servlet classes by their classname for reasons noted here Invoker Servlet (Wiki forum at Coderanch) (Invoker servlet is a Tomcat specific thing but it does the same thing as what you seem to be after).