package Action;
import com.opensymphony.xwork2.ActionSupport;
//import javaBean.add;
public class AddAction extends ActionSupport{
    private int ope1;
    private int ope2;
    private int sum;

        public int getOpe1() {
return ope1;
}
public void setOpe1(int ope1) {
this.ope1 = ope1;
}
public int getOpe2() {
return ope2;
}
public void setOpe2(int ope2) {
this.ope2 = ope2;
}

               public int getSum() {
return ope1+ope2;
}
public void setSum(int sum) {
this.sum = sum;
}
           public String execute() throws Exception 
           {
   if(sum>0)
   return "ZS";
   else return "FS";
            }


            }struts中的代码是<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd"><struts>    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.devMode" value="false" />    <package name="action"  extends="struts-default" >
    <!--包的名称 主要供继承者使用 namespace会作为action访问的一部分,简化代码  -->
      <action name="AddAction" class="Action.AddAction" method="execute">
        <result name="ZS">/zhengshu.jsp</result>
        <result name="FS">/fushu.jsp</result>
      </action>
        
    </package>      <!-- Add packages here --></struts>在输入的操作数大于0的时候,也会跳转到负数的界面,小于0时还是负数界面。不能根据求和结果正确跳转!!!
急急急,javaee小白求助各位大神!!!!strutsjavaee