gpt4 book ai didi

java - 找不到 ActionBean - Stripes 1.5 的默认处理程序

转载 作者:太空宇宙 更新时间:2023-11-04 13:04:27 24 4
gpt4 key购买 nike

我正在尝试按照 stripes 网站上的教程计算器进行操作。 https://stripesframework.atlassian.net/wiki/display/STRIPES/Quick+Start+Guide

但总是出现以下信息:HTTP 状态 500 - 找不到类型为:calculate.CalculatorActionBean 的 ActionBean 的默认处理程序

我的 ActionBean:

   @UrlBinding("/calculate/Calculator.action")
public class CalculatorActionBean implements ActionBean {
private ActionBeanContext context;
private double numberOne;
private double numberTwo;
private double result;

public ActionBeanContext getContext() { return context; }
public void setContext(ActionBeanContext context) { this.context = context; }

public double getNumberOne() { return numberOne; }
public void setNumberOne(double numberOne) { this.numberOne = numberOne; }

public double getNumberTwo() { return numberTwo; }
public void setNumberTwo(double numberTwo) { this.numberTwo = numberTwo; }

public double getResult() { return result; }
public void setResult(double result) { this.result = result; }

@DefaultHandler
public Resolution addition() {
result = getNumberOne() + getNumberTwo();
return new ForwardResolution("/WEB-INF/jsp/layout-usage.jsp");
}
}

我的 Jsp:

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" 
isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>

<%--<c:set var="contextPath" value="${pageContext.request.contextPath}" scope="page" />--%>

<stripes:form beanclass="calculate.CalculatorActionBean" focus="">

<table>
<tr>
<td>Number 1:</td>
<td><stripes:text name="numberOne"/></td>
</tr>
<tr>
<td>Number 2:</td>
<td><stripes:text name="numberTwo"/></td>
</tr>
<tr>
<td colspan="2">
<stripes:submit name="addition" value="Add"/>
</td>
</tr>
<tr>
<td>Result:</td>
<td>${actionBean.result}</td>
</tr>
</table>

</stripes:form>

最佳答案

ActionResolver.Packages 初始化参数为空!谢谢! @acdhirr

关于java - 找不到 ActionBean - Stripes 1.5 的默认处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34617083/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com