我有springboot应用程序,而不是部署到tomcat。 我上课了:
public List<CaseListEntry> GetCaseListEntries()
{
var CaseGridTrs = CaseListGrid.FindElements(By.XPath(".//tr"));
var entryList = CaseGridTrs.Select(x =>
{
var CaseEntryTds = x.FindElements(By.XPath(".//td"));
var ListNoElement = GetElementOrNull(CaseEntryTds,0);
var RegisterDateElement = GetElementOrNull(CaseEntryTds,1);
var DocumentTypeElement = GetElementOrNull(CaseEntryTds,2);
var RegisterNoElement = GetElementOrNull(CaseEntryTds,3);
var RegisterDate = (RegisterDateElement != null)? RegisterDateElement.Text : "";
var RegisterNo = (RegisterNoElement != null)? RegisterNoElement.Text : "";
var ListNo = (ListNoElement != null) ? ListNoElement.FindElement(By.XPath(".//a")).Text : "";
var DocumentType = (DocumentTypeElement != null) ? DocumentTypeElement.Text : "";
return new CaseListEntry
{
ListNo = ListNo ,
RegDate = DateTime.ParseExact(RegisterDate, "dd.MM.yyyy",
CultureInfo.InvariantCulture),
DocumentType = DocumentType
};
}).ToList();
return entryList;
}
public IWebElement GetElementOrNull(IList<IWebElement> CaseEntryTds, int elementAtPosition, int maxSeconds = 1) {
IWebElement element = null;
IWait<IWebDriver> wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(maxSeconds));
wait.Until(d => {
try {
element = CaseEntryTds.ElementAt(elementAtPosition);
return element.Displayed;
} catch (WebDriverTimeoutException) {
return false;
} catch (NoSuchElementException) {
return false;
}
});
return element;
在application.properties中我有:
public class SpringBootApp extends SpringBootServletInitializer {
....
}
但是当应用程序部署到tomcat时,它不能与url一样: http://193.123.33.33:8080/ 通过网址http://193.123.33.33:8080/appname
购买如何在tomcat中为root url映射设置springboot? 谢谢!
答案 0 :(得分:0)
&#34; .yml&#34;文件需要声明
服务器: 港口:8089 display-name:displayname
并且需要在tomcat属性中配置域名。但对于本地环境http://将无法正常工作。
答案 1 :(得分:0)
解决方法是在webapp tomcat文件夹中创建ROOT.war。