Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

servletContext.addservlet之后其他的设置set方法非链式调用的? #4

Open
WenTao-Love opened this issue Jun 29, 2024 · 0 comments

Comments

@WenTao-Love
Copy link

Map<String, ServletInfoDef> servlets = webaLoader.getServlets(); servlets.forEach((k,v)->{ ServletDef sd = v.getServlet(); ServletMappingDef smd = v.getServletMapping(); ServletRegistration sr = servletContext.addServlet(k, sd.getServletClass()); sr.addMapping(smd.getUrlPatterns().stream().toArray(String[]::new)); sr.setAsyncSupported(sd.getAsyncSupported()); sr.setInitParameters(sd.getParameterMap()); sr.setLoadOnStartup(sd.getLoadOnStartup()); sr.setRunAsRole(sd.getRunAs()); });
这里怎么为servletContext设置其他属性呢?
ServletRegistration sr = servletContext.addServlet(k, sd.getServletClass());
感觉这样子单独拿出来设置了呼啦呼啦一通servlet属性后,却没法子将这些属性回传回去

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant