1

Topic: Servlet adjustment in web.xml, using a file properties (Spr

There is a servlet in web.xml. Whether probably from it to refer on property from the setup file? (Application server JBoss EAP 6.1.) <servlet> <servlet-name> olap </servlet-name> <servlet-class>org.mitre.dsmiley.httpproxy.ProxyServlet</servlet-class> <init-param> <param-name> targetUri </param-name> <! - was so <param-value>http://10.7.41.76:5006</param-value>-> <Earlier! - And it is necessary so-> <param-value> $ {cubes_url} </param-value> </init-param> <init-param> <param-name> log </param-name> <param-value> true </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name> olap </servlet-name> <url-pattern>/olap/* </url-pattern> </servlet-mapping>

2

Re: Servlet adjustment in web.xml, using a file properties (Spr

It agree. But how easier to bypass? While I try through ServletContextListener to install to a servlet property. Still a passing question. How to get ServletContext by name a servlet, specified in a tag <servlet-name> in web.xml, instead of on uripath as more low in the code? public class WebXmlProperties implements ServletContextListener {@Override public void contextInitialized (ServletContextEvent sce) {sce.getServletContext ().getContext (uripath).setAttribute (name, object);}}

3

Re: Servlet adjustment in web.xml, using a file properties (Spr

5/11/2017 12:10, purser writes:> There is a servlet in web.xml. Whether probably from it to refer on property from> the setup file? (Application server JBoss EAP 6.1.) It is possible not  a servlet in web.xml and to create in ServletContextListener (which will know where the setup file lies): Approximately so: public void contextInitialized (ServletContextEvent sce) {sce.getServletContext ().addServlet (...).setInitParameters (...);} - WBR, Serge. Posted via RSDN NNTP Server 2.1 beta

4

Re: Servlet adjustment in web.xml, using a file properties (Spr

5

Re: Servlet adjustment in web.xml, using a file properties (Spr

Hello, hrensgory, you wrote: H> Servletnaja the specification - a basis of 99 % the web server-sajd on ,  and H> other jax-rs - only scenery to it. Not to know it and not to be able H> to use to it it is inadmissible. That Jetty that Undertow  contain another API and servlets only the adapter for this purpose API.  over servlets hide their jambs. I agree that servlets it is an objective reality, but to throw out them is very good idea. API awful and unreasoned.

6

Re: Servlet adjustment in web.xml, using a file properties (Spr

> H> the specification - a basis of 99 % the web server-sajd on > You so tell Servletnaja, as though it something good. It is not good and not badly, simply fact such.   - from this the little that really I demand to learn from the employees, engaged the server-sajdom. For the best understanding of an event in bowels well and for the purpose of preventive maintenance reinvent a wheel )> public class ReadyToUseHttpServer> {> public static void main (String [] args) throws Exception> {> Server server = new Server (8080);> ServletHandler handler = new ServletHandler ();> server.setHandler (handler);>> handler.addServletWithMapping (HelloServlet.class, "/ *");>> server.start ();> server.join ();>}>}>>> After all even on lines it is less, than typical web.xml. When it is necessary to make a servlet, I write for a long time already in it so: @WebServlet (urlPatterns = "/some/where") - WBR, Serge. Posted via RSDN NNTP Server 2.1 beta

7

Re: Servlet adjustment in web.xml, using a file properties (Spr

8

Re: Servlet adjustment in web.xml, using a file properties (Spr

9

Re: Servlet adjustment in web.xml, using a file properties (Spr

10

Re: Servlet adjustment in web.xml, using a file properties (Spr

11

Re: Servlet adjustment in web.xml, using a file properties (Spr