File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
websocket/injection/src/main/java/org/javaee7/websocket/injection Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 4040package org .javaee7 .websocket .injection ;
4141
4242import javax .inject .Inject ;
43- import javax .servlet .ServletContext ;
4443import javax .websocket .OnMessage ;
4544import javax .websocket .server .ServerEndpoint ;
4645
4746/**
4847 * @author Arun Gupta
4948 */
50- @ ServerEndpoint (value = "/websocket-cdi" )
49+ @ ServerEndpoint ("/websocket-cdi" )
5150@ Logging
5251public class MyEndpointWithCDI {
5352
5453 @ Inject MyBean bean ;
5554
56- @ Inject ServletContext servletContext ;
57-
5855 @ OnMessage
5956 public String sayHello (String name ) {
6057 System .out .println (getClass ().getName () + ".sayHello" );
61- System .out .println ("context path: " + servletContext .getContextPath ());
62- return bean .sayHello (name );
58+ return bean .sayHello (name + " (from CDI)" );
6359 }
6460}
You can’t perform that action at this time.
0 commit comments