我有一个基于代码的mavenized配置Spring 3.2.4 Web应用程序.当我使用Maven/pom.xml构建应用程序时,我得到一个错误,即web.xml丢失.首先,我尝试创建一个空的web.xml.这是项目方面发生变化的时刻(我不知道为什么).它从动态Web模块3.0切换到3.1,这是不可逆转的.如何将其再次更改为Dynamic Web Modules 3.0 ???

另外我无法删除JAX-RS.尝试这样做会导致:
Failed while uninstalling JAX-RS (REST Web Services) 1.0.
org.eclipse.jst.javaee.web.internal.impl.WebAppImpl cannot be cast to org.eclipse.jst.j2ee.webapplication.WebApp
Run Code Online (Sandbox Code Playgroud)
后来我发现我可以通过在pom.xml中插入相应的插件来避免Maven编译错误:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud) 这是我生成表格视图的Swift代码.我正在尝试设置带有详细标签的tableView.问题是永远不会调用以下代码.
if (cell == nil) {
println("1")
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "CellSubtitle")
//cell = tableViewCell
}
Run Code Online (Sandbox Code Playgroud)
以下是该方法所需的代码:
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!
{
println("start TableViewCellForRowAtIndexPath")
var cell: UITableViewCell! = tableView.dequeueReusableCellWithIdentifier("CellSubtitle", forIndexPath: indexPath) as UITableViewCell
if (cell == nil) {
println("1")
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "CellSubtitle")
//cell = tableViewCell
}
cell.textLabel.text = instructions[indexPath.row].text
println("2")
//cell.detailTextLabel
cell.detailTextLabel.text = "HI"
println("3")
Run Code Online (Sandbox Code Playgroud)
以下是该方法的控制台输出:
start load
1
2
done load
start TableViewCellForRowAtIndexPath
2
fatal error: Can't unwrap Optional.None
(lldb)
Run Code Online (Sandbox Code Playgroud)
如何初始化 …