[jboss-user] [EJB 3.0] - Re: Get ear name

rpiaggio do-not-reply at jboss.com
Thu Jun 19 13:39:04 EDT 2008


private static String getEarName() {
  |   URL url = Thread.currentThread().getContextClassLoader().getResource("");
  |   Pattern p = Pattern.compile("(?i)/([^\\\\/:\\*\\?<>\\|]+)\\.ear/");
  |   Matcher m = p.matcher(url.getPath());
  |   if (m.find()) {
  |     return m.group(1) + "/";
  |   } else {
  |     return "";
  |   }
  | }
It's a bit of a hack, but it's the only way I could find.

I don't want to be annotating every single bean, it's error-prone. Wish they would standardize bean naming.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159371#4159371

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159371



More information about the jboss-user mailing list