java - Interservlet communication -


i have websocket servlet , rest servlet. want inform websocket servlet changes in order write these "events" via websocket server.

i find forward() , include() approach. seem me can forward onget, onpost, etc.

do miss something?

indeed, forward() , include() meant used when processing request. might not best option given want achieve.

what create third component, let's call eventmanager time being, , have rest servlet signal changes eventmanager. websocket, on other hand, notified eventmanager new data available , new data in order write client.

in approach essential both rest servlet , websocket servlet share same instance of eventmanager. achieve marking eventmanager singleton ejb adding @singleton annotation, , inject both rest servlet , websocket servlet.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -