小女子真心求教 现在有个字符串是这样子的:http://${domain}${contextPath}${actionName}/${methodName}.${suffix}怎样才能用java语言得到${}中间的值,比如:domainJavaString 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 return 头像是你本人&&没对象?Call me:No way; import java.util.regex.Matcher;import java.util.regex.Pattern;public class Hello { public static void main(String[] args) { String str = "http://${domain}${contextPath}${actionName}/${methodName}.${suffix}"; Pattern pattern = Pattern.compile("\\$\\{(.*?)\\}"); Matcher matcher = pattern.matcher(str); while (matcher.find()) { System.out.println(matcher.group(1)); } }}输出domaincontextPathactionNamemethodNamesuffix 请问用手机访问自动跳转到wap页面怎么实现的? 我用ftl文件是不是在我的myeclipse上还要安装freemaker插件啊? java反序列化问题( could not deserialize) 利用Hibernate Criteria的分页处理,遇到的2个小问题 hibernate+mysql报错 Axis + webservice 出现问题, 关于struts的小问题 如何快速的在eclipse中开发j2ee/ejb JBuilder7+Weblogic7+SQLServer2000的一个简单问题! 讨论:全部用开源软件设计一个J2EE环境 JSP页面问题 spring配置文件的问题
import java.util.regex.Pattern;public class Hello {
public static void main(String[] args) {
String str = "http://${domain}${contextPath}${actionName}/${methodName}.${suffix}";
Pattern pattern = Pattern.compile("\\$\\{(.*?)\\}");
Matcher matcher = pattern.matcher(str); while (matcher.find()) {
System.out.println(matcher.group(1));
}
}
}
输出
domain
contextPath
actionName
methodName
suffix