The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex
In order to call EJB from remote JVM, you should
ReplyDeleteUse @Remote annotation on you EJB
Supply a jar with interfaces and put it in the classpath of you client-vm
Use JNDI in order to obtain a reference on the EJB stub from server.
For JNDI you'll need an implementation that depends on container (for example, if its JBoss jboss-client-all.jar should be enough (I don't remember the exact name but you've got the point, I think)
Once you feel comfortable with the overall notions and definitions, read this example, I think its handy enough
Example
Hope this helps
STEP 1:
ReplyDeleteContext context = new InitialContext():
The initial context is a reference to the JNDI lookup service.
It is like the entry into the JNDI virtual directory tree.
STEP 2:
Object o = context.lookup("mejb"):
Here in the lookup we need to give the name of the bean whatever that is deployed in the server, to get a reference to the home interface of that bean.
We then get the object of type java.lang.Object we need to cast this object to the Home interface of whichever bean we did a lookup on.
STEP 3:
Home home = (Home) PortableRemoteObject.narrow(o,Home.class):
We actually need to cast the object to the type that we think it is type of. However, since this is RMI over IIOP we need to use the PortableRemoteObject.narrow method this it seems filters the object type to the actual object type and checks for errors.