I have the following code working fine when the field is populated with
value, but if left blank, the error came out, please help...

----------- entry.jsp  -----------

<%@ page import="java.util.*"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/jstl-core.tld" prefix="c" %>

<script language=javascript src="js/validate-intmsg.js"></script>

<html:form method="post" action="/AddrBook/save" >
<html:hidden property="strutsAction"/>
<html:hidden property="abId"/>

<table width="100%">
 <tr>
  <td>
   <table width="100%">
    <tr class="listHead">
     <td>
         <c:choose>
            <c:when test="${requestScope['addrBookForm'].strutsAction ==
1}">
              <bean:message bundle="common/intmsg" key="label.add"/>
            </c:when>
            <c:otherwise>
              <bean:message bundle="common/intmsg" key="label.edit"/>
            </c:otherwise>
         </c:choose>&nbsp;AddrBook
       </td>
    </tr>
    <tr>
     <td>&nbsp;</td>
    </tr>
      <tr class="listBelow">
     <td>
      <table width="100%" cellpadding="5">
       <tr>
        <td class="listHead"><bean:message key="AddrBook.usrId"/></td>
        <td class="listBelow" colspan="5"><html:text property="usrId"
size="50"/></td>
       </tr>
          <tr>
        <td class="listHead"><bean:message key="AddrBook.abFirstName"/></td>
        <td class="listBelow"><html:text property="abFirstName"
size="20"/></td>
        <td class="listHead"><bean:message
key="AddrBook.abMiddleName"/></td>
        <td class="listBelow"><html:text property="abMiddleName"
size="20"/></td>
        <td class="listHead"><bean:message key="AddrBook.abLastName"/></td>
        <td class="listBelow"><html:text property="abLastName"
size="20"/></td>
       </tr>
          <tr>
        <td class="listHead"><bean:message key="AddrBook.abTitle"/></td>
        <td class="listBelow"><html:text property="abTitle" size="20"/></td>
        <td class="listHead"><bean:message key="AddrBook.abDispName"/></td>
        <td class="listBelow"><html:text property="abDispName"
size="20"/></td>
        <td class="listHead"><bean:message key="AddrBook.abNickName"/></td>
        <td class="listBelow"><html:text property="abNickName"
size="20"/></td>
       </tr>
       <tr>
        <td colspan="2"></td>
        <td colspan="4">
               <logic:messagesPresent>
                     <bean:message bundle="common/intmsg"
key="errors.header"/>
                      <ul>
                        <html:messages id="error">
                          <li>
                            <bean:write name="error"/>
                          </li>
                        </html:messages>
                      </ul>
                      <hr/>
                  </logic:messagesPresent>
           </td>
       </tr>
        </table>
     </td>
    </tr>
   </table>
   <br>
   <table width="100%">
    <tr align="right" valign="middle">
     <td>
      <html:submit>
             <bean:message bundle="common/intmsg" key="label.save" />
         </html:submit>
         <html:cancel>
             <bean:message bundle="common/intmsg" key="label.cancel" />
         </html:cancel>
       </td>
    </tr>
     </table>
  </td>
 </tr>
</table>
</html:form>



----------- struts-config.xml  -----------
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>

<struts-config>

<!-- ============ Form beans ============ -->
  <form-beans>
    <form-bean type="com.ilium.eapps.intmsg.controller.AddrBookForm"
name="addrBookForm" />
  </form-beans>

<!-- ========== Global Forwards Definations
=============================== -->
  <global-forwards>
    <forward name="/login" path="/login/LoginAcct_Pub/login.do"
contextRelative="true" redirect="true" />
    <forward name="/failure" path="error.page" contextRelative="true"
redirect="true" />
  </global-forwards>

<!-- ============ Action Mapping definitions ============ -->
  <action-mappings type="org.apache.struts.action.ActionMapping">

    <!-- <<<<<<<<<<<<<< AddrBook >>>>>>>>>>>>>>> -->

    <action path="/AddrBook/SearchByPK"
      parameter="forward"
        type="com.ilium.eapps.intmsg.controller.DispatchForward">
      <forward name="forward" path="query.AddrBook.SearchByPK" />
    </action>
    <action path="/AddrBook/add"
      parameter="ADD"
        type="com.ilium.eapps.intmsg.controller.AddrBookAction"
        scope="request"
        name="addrBookForm"
        validate="false">
      <forward name="success" path="manager.AddrBook.entry" />
      <forward name="cancel" redirect="true" path="/AddrBook/list.do" />
    </action>
    <action path="/AddrBook/edit"
      parameter="EDIT"
        type="com.ilium.eapps.intmsg.controller.AddrBookAction"
        scope="request"
        name="addrBookForm"
        validate="false">
      <forward name="success" path="manager.AddrBook.entry" />
      <forward name="cancel" redirect="true" path="/AddrBook/list.do" />
    </action>
    <action path="/AddrBook/list"
      parameter="LIST"
        type="com.ilium.eapps.intmsg.controller.AddrBookAction"
        scope="request"
        name="addrBookForm"
        validate="false">
      <forward name="success" path="manager.AddrBook.summary" />
    </action>
    <action path="/AddrBook/view"
      parameter="VIEW"
        type="com.ilium.eapps.intmsg.controller.AddrBookAction"
        scope="request"
        name="addrBookForm"
        validate="false">
      <forward name="success" path="manager.AddrBook.view" />
      <forward name="cancel" redirect="true" path="/AddrBook/list.do" />
    </action>
    <action path="/AddrBook/remove"
      parameter="REMOVE"
        type="com.ilium.eapps.intmsg.controller.AddrBookAction"
        scope="request"
        name="addrBookForm"
        validate="false">
      <forward name="success" path="manager.AddrBook.remove" />
      <forward name="cancel" redirect="true" path="/AddrBook/list.do" />
    </action>
    <action path="/AddrBook/trash"
      parameter="TRASH"
        type="com.ilium.eapps.intmsg.controller.AddrBookAction"
        scope="request"
        name="addrBookForm"
        validate="false">
      <forward name="success" path="/AddrBook/list.do" />
      <forward name="cancel" redirect="true" path="/AddrBook/list.do" />
    </action>
    <action path="/AddrBook/save"
      parameter="SAVE"
        type="com.ilium.eapps.intmsg.controller.AddrBookAction"
        scope="request"
        name="addrBookForm"
        validate="true"
        input="manager.AddrBook.entry">
      <forward name="success" redirect="true" path="/AddrBook/list.do" />
      <forward name="cancel" redirect="true" path="/AddrBook/list.do" />
    </action>

  </action-mappings>


<!-- ========== Message Resources Definitions
=========================== -->
  <message-resources parameter="resources.application-intmsg" />
  <message-resources parameter="resources.application-common" key="common"
/>

<!-- ========== Plug Ins Configuration
================================== -->
<!-- Add multiple validator resource files by setting the pathname
property -->
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation-intmsg.xml" />
  </plug-in>

  <plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config"
value="/WEB-INF/tiles-def-intmsg.xml" />
    <set-property property="definitions-debug" value="0" />
    <set-property property="definitions-parser-details" value="0" />
    <set-property property="definitions-parser-validate" value="true" />
    <set-property property="moduleAware" value="true" />
  </plug-in>

</struts-config>


----------- validation-intmsg.xml  -----------
<!DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
          "http://jakarta.apache.org/struts/dtds/validation_1_1.dtd";>

<form-validation>
  <formset>
    <form name="addrBookForm">
      <field property="abFirstName" depends="required">
        <arg0 key="AddrBook.abFirstName"/>
      </field>
    </form>
  </formset>
</form-validation>



------------- error ------------
[ServletException in:/jsp/AddrBook/entry.jsp] Cannot find bean error in any
scope' javax.servlet.ServletException: Cannot find bean error in any scope
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:530) at org.apache.jsp.entry_jsp._jspService(entry_jsp.java:239) at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
04) at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684) at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:575) at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:498) at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
22) at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:398)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177) at
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756) at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.ja
va:881) at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473) at
org.apache.jsp.classicLayout_jsp._jspx_meth_comp_insert_3(classicLayout_jsp.
java:224) at
org.apache.jsp.classicLayout_jsp._jspService(classicLayout_jsp.java:109) at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
04) at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684) at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:432) at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:356) at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69) at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso
r.java:274) at
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRe
questProcessor.java:254) at
org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(
TilesRequestProcessor.java:341) at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
ava:980) at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193) at
com.ilium.eapps.syswar.filter.SetCharacterEncodingFilter.doFilter(SetCharact
erEncodingFilter.java:152) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:213) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643) at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643) at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641) at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174) at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:386) at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:530) at java.lang.Thread.run(Thread.java:534)







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to