You can define an action that has an action class, but no form-bean.  Here's
an example of an action that I am using, and it works great:

<action path="/vgminit"
        type="action.VgmInitPropertiesAction"
        scope="request">
        <forward name="properties" path="/tVgmProperties.jsp"/>
</action>

Karen Prengaman
Software Engineer

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 8:35 AM
To: Struts Users Mailing List
Subject: Re: JSP page without form bean ?



You can specify an action without a form bean with this syntax:

<action    path="/main"
            forward="/Main.jsp">
</action>

The limitation here is that there is no corresponding Struts Action class
either.  The above syntax is a solution I had to use when the customer
wanted a button to trigger a URL as opposed to a hyperlink trigger.

As far as I was able to determine, you cannot specify an action in the
struts configuration that has an action class, but no form-bean.  My
application has plenty of screens that triggered actions on form submit,
but had no entry fields on them.  In these cases I used the normal action
syntax in the struts configuration file but pointed to a "dummy form" - a
form bean with no properties.

Allowing an action to be specified with an action class but no form bean
would be a nice struts enhancement.

Jim Weaver
Software Developer - ThoughtWorks



 

                    "M�ris

                    Orbid�ns"            To:     "Struts-list (E-mail)"
<[EMAIL PROTECTED]>                                     
                    <M.Orbidans@da       cc:

                    tapro.lv>            Subject:     JSP page without form
bean ?                                                           
 

                    11/20/2001

                    10:13 AM

                    Please respond

                    to "Struts

                    Users Mailing

                    List"

 

 






Can I have a JSP form without a  form bean?
I dont need the bean, there are no input fields on form.


I defined action like this:

<action   path="/main"
              type="addressbook.MainAction"
              input="/main.jsp"
              >
    </action>

But it threw an exception:
           javax.servlet.ServletException: Cannot retrieve definition for
form bean null


Maris



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






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

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

Reply via email to