You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gross, Carson" <ca...@bofasecurities.com> on 2002/02/12 02:07:39 UTC

newbie

All,

I am trying to set up struts 1.0.1with Weblogic 6.1sp2.  I have the
following jsp, called test_form.jsp:

<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html">

<html:form action="testForm">
  Please Input User Name:
  <html:text property="userName" /><br/>
  Please Input Password:
  <html:password property="password" /><br/>
  <html:submit />
</html:form>

My struts-config.xml looks like this:

<?xml version="1.0" encoding="ISO-8859-1" ?>

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

<struts-config>

  <form-beans>
    <form-bean name="testForm"
type="com.bofasecurities.strutstest.view.TestView" />
  </form-beans>

  <action-mappings>     
    <action name="testForm" 
            path="/testForm" 
	    scope="request" 
	    type="com.bofasecurities.strutstest.controller.TestController" 
	    input="/test_form.jsp"/>
  </action-mappings>

</struts-config>

My web.xml looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

  <!-- The Welcome File List -->
  <welcome-file-list>
    <welcome-file>test_form.jsp</welcome-file>
  </welcome-file-list>

  <!-- Template Tag Library Descriptor -->
  <taglib>
    <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
  </taglib>

  <!-- Template Tag Library Descriptor -->
  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>

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

  <servlet-mapping>
     <servlet-name>action</servlet-name>
     <url-pattern>*.do</url-pattern>
  </servlet-mapping>

</web-app>

Now, finally, here are my questions:

1)  If you look carefully, the action path is /testForm, but when I click on
the submit button, the /testForm.do URL is submitted to, and it is processed
correctly by the TestController class.  If I change the path to /testForm.do
in the jsp and the struts-config.xml, I get a "Cannot retrieve mapping for
action /testForm" exception.  Any ideas why?  The documentation says that
the action attribute of the html:form tag must be the same as the path
attribute of the action tag in the struts-config.xml file, optionally
without the ending.  But it seems like I can't specify an ending at all, it
automatically selects the .do ending and then the action with the same name.
Is this a change that has yet to be updated in the documentation?

2)  I keep having this print out on top:  <%@taglib
uri="/WEB-INF/struts-html.tld" prefix="html"> Any ideas on where this is
coming from?  I suspect it has to do with logging or something, but I've
been unable to tweak the logging level to get it to go away.

Thanks for your patience,
Carson Gross


_____________________________________________________________________ 
IMPORTANT NOTICES: 
          This message is intended only for the addressee. Please notify the
sender by e-mail if you are not the intended recipient. If you are not the
intended recipient, you may not copy, disclose, or distribute this message
or its contents to any other person and any such actions may be unlawful.

         Banc of America Securities LLC("BAS") does not accept time
sensitive, action-oriented messages or transaction orders, including orders
to purchase or sell securities, via e-mail.

         BAS reserves the right to monitor and review the content of all
messages sent to or from this e-mail address. Messages sent to or from this
e-mail address may be stored on the BAS e-mail system.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>