Hello all,

I am having some trouble with my struts application.. It doesn't seem to be
reading the ApplicationResources.properties file and when my Actions generate
errors all I get from the output of my <html:errors /> tag is "null null".

Here is a portion from my web.xml:

<servlet>
  <servlet-name>action</servlet-name>
  <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  <init-param>
    <param-name>application</param-name>
    <param-value>EprojectsResources</param-value>
  </init-param>
  <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
  </init-param>
  <load-on-startup>2</load-on-startup>
</servlet>

My EprojectsResources.properties file lives in
$TOMCAT_HOME/webapps/eprojects/WEB-INF/classes

My struts-config.xml:

<struts-config>
  <form-beans>
    <form-bean name="engJobForm"
      type="net.sinctech.eprojects.entity.EngJob" />
  </form-beans>

  <action-mappings>
    <action path="/home"
     type="net.sinctech.eprojects.actions.HomeAction"
     unknown="true">
     <forward name="success" path="/home.jsp" />
    </action>

    <action path="/editEngJob"
     type="net.sinctech.eprojects.actions.EditEngJobAction"
     input="/listAllProjects.do"
     name="engJobForm">
     <forward name="success" path="editEngJob.jsp" />
    </action>

    <action path="updateEngJob"
     type="net.sinctech.eprojects.actions.UpdateEngJobAction"
     input="editEngJob.do"
     name="engJobForm"
     scope="request">
      <forward name="success" path="/listAllProjects.do" />
    </action>
</action-mappings>

(I ommitted the action mapping for listAllProjects.do to save typing, but it is
there)

The action that is returning the "null null" is the updateEngJob action..
Basically I can list the projects and edit them, but when I submit the form the
updateEngJob action returns the error "null null"

Some code from my UpdateEngJobAction.java class file:

import net.sinctech.eprojects.entity.EngJob;

public class UpdateEngJobAction extends Action {
  public ActionForward perform(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {

    ActionErrors errors = new ActionErrors();

    try {
      EngJobBO engJobBO = new EngJobBO();
      EngJob engJob = (EngJob)form;
      engJobBO.updateEngJob(engjob);

      return mapping.findForward("success");
    } catch(Throwable e) {
      e.printStackTrace();
      ActionError error = new ActionError(e.getMessage());
      errors.add(ActionErrors.GLOBAL_ERROR, error);
    }
    saveErrors(request, errors);
    return new ActionForward(mapping.getInput());
  }
}

my EngJobBO.updateEngJob(engJob):

public void updateEngJob(EngJob engJob)
  throws EngJobException {

  validate(engJob);

  Connection con = null;

  try {
    con = pool.getConnection();

    EngJobDAO engJobDAO = new EngJobDAO(con);
    engJobDAO.update(engJob);

    con.commit();
  } catch(Exception e) {
    try {
      if(con != null) {
        con.rollback();
        throw new EngJobException(e.getMessage());
      }
    } catch(SQLException sqle) {




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

Reply via email to