<tfoot id='lZ5S4'></tfoot>
    1. <legend id='lZ5S4'><style id='lZ5S4'><dir id='lZ5S4'><q id='lZ5S4'></q></dir></style></legend>

      <small id='lZ5S4'></small><noframes id='lZ5S4'>

      <i id='lZ5S4'><tr id='lZ5S4'><dt id='lZ5S4'><q id='lZ5S4'><span id='lZ5S4'><b id='lZ5S4'><form id='lZ5S4'><ins id='lZ5S4'></ins><ul id='lZ5S4'></ul><sub id='lZ5S4'></sub></form><legend id='lZ5S4'></legend><bdo id='lZ5S4'><pre id='lZ5S4'><center id='lZ5S4'></center></pre></bdo></b><th id='lZ5S4'></th></span></q></dt></tr></i><div id='lZ5S4'><tfoot id='lZ5S4'></tfoot><dl id='lZ5S4'><fieldset id='lZ5S4'></fieldset></dl></div>

        <bdo id='lZ5S4'></bdo><ul id='lZ5S4'></ul>

      1. ParametersInterceptor error: Unexpected Exception catched, E

        时间:2023-10-15
        <tfoot id='tweYw'></tfoot>

        • <bdo id='tweYw'></bdo><ul id='tweYw'></ul>

                <tbody id='tweYw'></tbody>
              <i id='tweYw'><tr id='tweYw'><dt id='tweYw'><q id='tweYw'><span id='tweYw'><b id='tweYw'><form id='tweYw'><ins id='tweYw'></ins><ul id='tweYw'></ul><sub id='tweYw'></sub></form><legend id='tweYw'></legend><bdo id='tweYw'><pre id='tweYw'><center id='tweYw'></center></pre></bdo></b><th id='tweYw'></th></span></q></dt></tr></i><div id='tweYw'><tfoot id='tweYw'></tfoot><dl id='tweYw'><fieldset id='tweYw'></fieldset></dl></div>
                <legend id='tweYw'><style id='tweYw'><dir id='tweYw'><q id='tweYw'></q></dir></style></legend>

              1. <small id='tweYw'></small><noframes id='tweYw'>

                  本文介绍了ParametersInterceptor error: Unexpected Exception catched, Error setting expression的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在表单中有一个表格,其中包含下拉列表和隐藏的 input.

                  I have a table inside a form that contains dropdowns and a hidden input.

                  JSP:

                  <form action="modifyfaculty" method="post">
                      <table>
                          <thead class="center">
                              <tr>
                                  <!-- column names here -->
                              </tr>
                          </thead>
                  
                          <tbody>
                              <c:forEach var="professor" items="${facultyList}">
                                  <tr>
                                      <!-- more <td> -->
                  
                                      <td align="center">
                                          <c:choose>
                                              <c:when test="${professor.profEmplStatus.equals('FULL')}">
                                                  <select name="profEmplStatus" required>
                                                      <option value="FULL" selected>FULL</option>
                                                      <option value="PART">PART</option>
                                                      <option value="RET">RET</option>
                                                      <option value="TRMTD">TRMTD</option>
                                                  </select>
                                              </c:when>
                  
                                              <!-- more <c:when> blocks -->
                                          </c:choose>
                                      </td>
                  
                                      <td align="center">
                                          <c:choose>
                                              <c:when test="${professor.profDept.equals('BSCS-SE')}">
                                                  <select name="profDept" required>
                                                      <option value="BA-MMA">BA-MMA</option>
                                                      <option value="BFDT">BFDT</option>
                                                      <option value="BS-AN">BS-AN</option>
                                                      <option value="BS-GPD">BS-GPD</option>
                                                      <option value="BSBA-FM">BSBA-FM</option>
                                                      <option value="BSBA-MKT">BSBA-MKT</option>
                                                      <option value="BSCS-SE" selected>BSCS-SE</option>
                                                      <option value="BSIT-WD">BSIT-WD</option>
                                                      <option value="GENED">GENED</option>
                                                  </select>
                                              </c:when>
                  
                                              <!-- more <c:when> blocks -->
                                          </c:choose>
                                      </td>
                  
                                      <td class="center">
                                          <input type="hidden" name="profId" value="${professor.profId}" />
                                          <input type="submit" value="Save" />
                                      </td>
                                  </tr>
                              </c:forEach>
                          </tbody>
                      </table>
                  </form>
                  

                  ModifyFacultyAction:

                  public class ModifyFacultyAction extends ActionSupport {
                      private static final long serialVersionUID = 1L;
                  
                      private Integer profId;
                      private String profEmplStatus;
                      private String profDept;
                  
                      @Override
                      public String execute() {
                          FacultyManager fm = new FacultyManager();
                          fm.modifyFaculty("professor_employment_status", profEmplStatus, profId);
                          fm.modifyFaculty("professor_department", profDept, profId);
                  
                          return SUCCESS;
                      }
                  
                      public Integer getProfId() {
                          return profId;
                      }
                  
                      public void setProfId(Integer profId) {
                          this.profId = profId;
                      }
                  
                      public String getProfEmplStatus() {
                          return profEmplStatus;
                      }
                  
                      public void setProfEmplStatus(String profEmplStatus) {
                          this.profEmplStatus = profEmplStatus;
                      }
                  
                      public String getProfDept() {
                          return profDept;
                      }
                  
                      public void setProfDept(String profDept) {
                          this.profDept = profDept;
                      }
                  }
                  

                  struts.xml:

                  <action name="modifyfaculty" class="com.mypackage.action.ModifyFacultyAction">
                      <interceptor-ref name="notauth" />
                      <interceptor-ref name="defaultStack" />
                  
                      <result type="redirectAction">
                          <param name="actionName">viewfaculty</param>
                      </result>
                  
                      <result name="input" type="redirectAction">
                          <param name="actionName">viewfaculty</param>
                      </result>
                  
                      <result name="index" type="redirect">/index.jsp</result>
                  </action>
                  

                  输出:

                  但是,在从下拉列表中选择一个新值并单击 Save 时,我收到一个错误消息.以下是 devMode 日志:

                  However, upon choosing a new value from the dropdown and clicking Save, I am receiving an error. Below is the devMode log:

                  Jan 05, 2015 11:34:43 PM com.opensymphony.xwork2.interceptor.ParametersInterceptor error
                  SEVERE: Developer Notification (set struts.devMode to false to disable this message):
                  Unexpected Exception caught setting 'profId' on 'class com.mypackage.action.ModifyFacultyAction: Error setting expression 'profId' with value ['100005', '100006', '100007', '100008', '100009', '100010', '100011', ]
                  Jan 05, 2015 11:34:43 PM com.opensymphony.xwork2.util.LocalizedTextUtil warn
                  WARNING: Missing key [invalid.fieldvalue.profId] in bundles [[org/apache/struts2/struts-messages, com/opensymphony/xwork2/xwork-messages]]!
                  

                  如何解决?

                  推荐答案

                  你不需要提交表的所有个id.因为您不想将 profId 转换为列表或数组.为每条记录使用单独的表格.

                  You don't need to submit all ids of the table. Because you don't want to convert profId to a list or array. Use a separate form for each record.

                  <table>
                      <thead class="center">
                          <tr>
                              <!-- column names here -->
                          </tr>
                      </thead>
                  
                      <tbody>
                          <c:forEach var="professor" items="${facultyList}">
                            <tr><td>
                            <form action="modifyfaculty" method="post">
                            <table>
                              <tr>
                                  <!-- more <td> -->
                  
                                  <td align="center">
                                      <c:choose>
                                          <c:when test="${professor.profEmplStatus.equals('FULL')}">
                                              <select name="profEmplStatus" required>
                                                  <option value="FULL" selected>FULL</option>
                                                  <option value="PART">PART</option>
                                                  <option value="RET">RET</option>
                                                  <option value="TRMTD">TRMTD</option>
                                              </select>
                                          </c:when>
                  
                                          <!-- more <c:when> blocks -->
                                      </c:choose>
                                  </td>
                  
                                  <td align="center">
                                      <c:choose>
                                          <c:when test="${professor.profDept.equals('BSCS-SE')}">
                                              <select name="profDept" required>
                                                  <option value="BA-MMA">BA-MMA</option>
                                                  <option value="BFDT">BFDT</option>
                                                  <option value="BS-AN">BS-AN</option>
                                                  <option value="BS-GPD">BS-GPD</option>
                                                  <option value="BSBA-FM">BSBA-FM</option>
                                                  <option value="BSBA-MKT">BSBA-MKT</option>
                                                  <option value="BSCS-SE" selected>BSCS-SE</option>
                                                  <option value="BSIT-WD">BSIT-WD</option>
                                                  <option value="GENED">GENED</option>
                                              </select>
                                          </c:when>
                  
                                          <!-- more <c:when> blocks -->
                                      </c:choose>
                                  </td>
                  
                                  <td class="center">
                                      <input type="hidden" name="profId" value="${professor.profId}" />
                                      <input type="submit" value="Save" />
                                  </td>
                              </tr>
                             </table>
                            </form>
                           </td></tr>
                          </c:forEach>
                      </tbody>
                  </table>
                  

                  这篇关于ParametersInterceptor error: Unexpected Exception catched, Error setting expression的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在执行struts 2动作类时给出一个空的json结果 下一篇:如何在 Struts 2 中使用 JSP 返回 JSON 结果

                  相关文章

                1. <small id='JNUVR'></small><noframes id='JNUVR'>

                  <tfoot id='JNUVR'></tfoot>
                  <i id='JNUVR'><tr id='JNUVR'><dt id='JNUVR'><q id='JNUVR'><span id='JNUVR'><b id='JNUVR'><form id='JNUVR'><ins id='JNUVR'></ins><ul id='JNUVR'></ul><sub id='JNUVR'></sub></form><legend id='JNUVR'></legend><bdo id='JNUVR'><pre id='JNUVR'><center id='JNUVR'></center></pre></bdo></b><th id='JNUVR'></th></span></q></dt></tr></i><div id='JNUVR'><tfoot id='JNUVR'></tfoot><dl id='JNUVR'><fieldset id='JNUVR'></fieldset></dl></div>

                        <bdo id='JNUVR'></bdo><ul id='JNUVR'></ul>
                    1. <legend id='JNUVR'><style id='JNUVR'><dir id='JNUVR'><q id='JNUVR'></q></dir></style></legend>