I am getting the following error when I try to set the name and type
attribute of the <html:form> tag.  I have included a snippet of my login.jsp
file and my struts-config.xml file

The main reason I am trying to set them is because if I don't set them and
let the form tag configure itself with the appropriate bean, the action
attribute on the form is empty
(action="")  .  If someone can explain why the action attribute is not being
set then I will not worry about having to try to set the name and type
attributes of the form tag.


Any help with be greatly appreciated.

Marty Jones




////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
Error I received.
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////

java.lang.NullPointerException
        at
org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.j
ava:1162)
        at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j
ava:772)
        at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:80
1)
        at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:952)
        at
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
        at
jrun__WEB2dINF__pages__login2ejsp18._jspService(jrun__WEB2dINF__pages__login
2ejsp18.java:111)
        at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
        at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
        at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
        at
jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.java:439
)
        at
jrun.servlet.JRunRequestDispatcher.forwardInvoke(JRunRequestDispatcher.java:
409)
        at
jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:178)
        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.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
        at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ
estProcessor.java:320)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
        at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
        at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
        at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
        at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
        at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
)
        at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
snippet of login.jsp
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
<html:form name="loginForm" action="/login" focus="username" method="GET"
type="org.apache.struts.validator.DynaValidatorForm">
<table border="0" width="50%">
        <tr>
                <td align="center" colspan="2"><H2>StarTeam
Integration</H2></td>
        </tr>
  <tr>
    <th align="right" width="50%">
      <bean:message key="prompt.username"/>:
    </th>
    <td align="left" width="50%">
      <html:text property="username" size="16" maxlength="18"/>
    </td>
  </tr>

  <tr>
    <th align="right" width="40%">
      <bean:message key="prompt.password"/>:
    </th>
    <td align="left" width="50%">
      <html:password property="password" size="16" maxlength="18"
                    redisplay="false"/>
    </td>
  </tr>

  <tr>
    <td align="center" colspan="2">
        <br>
        <html:img page="/images/common/login_btn.gif" border="0"
onclick="submitForm()"/>
    </td>
  </tr>
</table>
<html:errors/>
<br>
</center>
</html:form>

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
struts-config.xml
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////
<?xml version="1.0" encoding="ISO-8859-1" ?>

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

<!--
     This is the Struts configuration file for the example application,
     using the proposed new syntax.
-->


<struts-config>


  <!-- ========== Form Bean Definitions ===================================
-->
  <form-beans>

    <!-- Logon form bean -->
    <form-bean       name="loginForm"
                     type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="username" type="java.lang.String"/>
      <form-property name="password" type="java.lang.String"/>
    </form-bean>

  </form-beans>


  <!-- ========== Global Forward Definitions ==============================
-->
  <global-forwards>
    <forward   name="gotoSignOn"           path="/WEB-INF/pages/login.jsp"/>
    <forward   name="success"              path="/WEB-INF/pages/index.jsp"/>
  </global-forwards>


  <!-- ========== Action Mapping Definitions ==============================
-->
  <action-mappings>

    <!-- Process a user logoff -->
    <action    path="/logoff"
               type="com.dailyaccess.actions.LogoffAction">
      <forward name="success"
path="/WEB-INF/pages/logoff.jsp"/>
    </action>

    <action    path="/login"
               type="com.dailyaccess.actions.LoginAction"
               name="loginForm"
              scope="request"
              input="/WEB-INF/pages/login.jsp"
              validate="false">
      <forward name="failure"              path="/WEB-INF/pages/login.jsp"/>
      <forward name="success"              path="home"/>
      <exception
                key="expired.password"
 
type="org.apache.struts.webapp.example.ExpiredPasswordException"
               path="/changePassword.jsp"/>
    </action>
    
  </action-mappings>


  <!-- ========== Controller Configuration ================================
-->

  <controller 
     bufferSize="4096"
     nocache="true"
     inputForward="true"
     processorClass="com.dailyaccess.RequestProcessor">
  
     <set-property property="inputForward" value="false"/>
  </controller>


  <!-- ========== Message Resources Definitions ===========================
-->

  <message-resources
    parameter="org.apache.struts.webapp.example.ApplicationResources"/>

  <message-resources
 
parameter="org.apache.struts.webapp.example.AlternateApplicationResources"
    key="alternate">
  </message-resources>


  <!-- ========== Plug Ins Configuration ==================================
-->
  
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
                     value="/WEB-INF/validator-rules.xml,
                            /WEB-INF/validation.xml"/>
  </plug-in>
  
  <plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml"/>
    <set-property property="definitions-debug" value="2"/>
    <set-property property="definitions-parser-details" value="2"/>
    <set-property property="definitions-parser-validate" value="true"/>
  </plug-in>

</struts-config>



________________________
Marty B. Jones
Senior Software Engineer
DailyAccess.Com


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

Reply via email to