Skip to content

Commit 38eef2d

Browse files
committed
Refactor EJBClient.java
1 parent 1b59823 commit 38eef2d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎ejb/ejb-client/src/main/java/com/baeldung/ejb/client/EJBClient.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ public HelloWorld lookup() throws NamingException {
4545
final String distinctName = "";
4646
final String beanName = "HelloWorld";
4747
final String viewClassName = HelloWorld.class.getName();
48-
final String toLookup = "ejb:" + appName + "/" + moduleName
49-
+ "/" + distinctName + "/" + beanName + "!" + viewClassName;
48+
final String toLookup = String.format("ejb:%s/%s/%s/%s!%s", appName, moduleName, distinctName, beanName, viewClassName);
5049
return (HelloWorld) context.lookup(toLookup);
5150
}
5251

0 commit comments

Comments
 (0)