我有问题,如何在动作属性中创建uri.我必须使用子文件夹作为"用户","管理员"因为我使用Spring Security.
<form:form action="/user/reservationTour.html" method="post" commandName="bookTourForm">
Run Code Online (Sandbox Code Playgroud)
结果,没有项目名称http:// localhost:8080/user/reservationTour.html
<form:form action="user/reservationTour.html" method="post" commandName="bookTourForm">
Run Code Online (Sandbox Code Playgroud)
结果,链接中的2x用户http:// localhost:8080/ProjectContextTitle/user/user/reservationTour.html
<form:form action="<c:url value="/user/reservationTour.html" />" method="post" commandName="bookTourForm">
Run Code Online (Sandbox Code Playgroud)
结果,例外
org.apache.jasper.JasperException: /jsp/user/reservationTourPage.jsp(7,33) Unterminated <form:form tag
Run Code Online (Sandbox Code Playgroud)
这很好,但肯定不是很好的解决方案
<form:form action="/ProjectContextName/user/reservationTour.html" method="post" commandName="bookTourForm">
Run Code Online (Sandbox Code Playgroud) 我在分公司工作,让我们说出来mybranch.我不修改master.我想推动改变,origin/feature/mybranch但我有一些问题.奇怪的是我之前做过几次并没有任何问题.
$ git branch
develop
* feature/mybranch
master
$ git push
To http://......
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'http://....'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration variable
hint: to 'simple', 'current' or 'upstream' to push …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用带有gwt-maven-plugin的Maven运行遗留项目.我有以下错误
找到com.google.gwt.core.ext.typeinfo.JClassType接口,但是预期了类
它与GWT 2.4.0连接.关于降级GWT或重新编译gwtp有一些答案,但我不明白.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>i18n</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>someTarget.html</runTarget>
<hostedWebapp>${webappDir}</hostedWebapp>
<i18nMessagesBundle>org.I18nMsg</i18nMessagesBundle>
</configuration>
</plugin>
<pluginManagement>
<plugins>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
gwt-maven-plugin
</artifactId>
<versionRange>
[2.4.0,)
</versionRange>
<goals>
<goal>i18n</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute></execute>
</action>
</pluginExecution>
</pluginExecutions>
....
Run Code Online (Sandbox Code Playgroud)
错误:
[INFO] Scanning for additional dependencies: jar:file:/C:/Users/xxx/.m2/repository/com/extjs/gxt/2.2.0/gxt-2.2.0.jar!/com/extjs/gxt/ui/client/core/El.java
[INFO] Computing all possible rebind results for 'com.extjs.gxt.ui.client.core.impl.ComputedStyleImpl'
[INFO] Rebinding com.extjs.gxt.ui.client.core.impl.ComputedStyleImpl
[INFO] Could not find an exact match rule. Using 'closest' rule <replace-with class='com.extjs.gxt.ui.client.core.impl.ComputedStyleImplIE'/> based on fall back …Run Code Online (Sandbox Code Playgroud) 我想在两个可能的分隔符"/"或"//"上将字符串拆分为List.但更重要的是,分隔符也应该放在同一个列表中.我不能用Guava中的Splitter或java.util.Scanner来做这个.
Scanner s = new Scanner(str);
s.useDelimiter("//|/");
while (s.hasNext()) {
System.out.println(s.delimiter());
System.out.println(s.next());
}
Run Code Online (Sandbox Code Playgroud)
s.delimiter()回报//|/.我想得到/或//.
你知道其他任何一个可以做到这一点的图书馆吗?
我写了一些代码,它可以工作,但它不是很好的解决方案:
public static ArrayList<String> processString(String s) {
ArrayList<String> stringList = new ArrayList<String>();
String word = "";
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == '/' && i < s.length() && s.charAt(i + 1) == '/') {
if (!word.equals(""))
stringList.add(word);
stringList.add("//");
word = "";
i++;
} else if (s.charAt(i) == '/') {
if (!word.equals("")) …Run Code Online (Sandbox Code Playgroud) 我想问一下如何处理多个构造函数.
if(a != null && b != null)
return new QueryProducer(query, a, b);
else if(a != null)
return new QueryProducer(query, a);
else if(b != null)
return new QueryProducer(query, b);
else return new QueryProducer(query);
Run Code Online (Sandbox Code Playgroud)
我想避免复杂的if else块.在这种情况下,可伸缩性也不是很好.
java ×3
action ×1
delimiter ×1
forms ×1
git ×1
gwt ×1
if-statement ×1
maven ×1
maven-plugin ×1
oop ×1
push ×1
split ×1
splitter ×1
spring-mvc ×1
string ×1