Hmmmmm.
Hang about. The syntax you suggest works with my application in some
cases, but not in all. In a few cases, when I remove the name element from
the action ("de-form-beaning it" as it were) I end up getting the same
exception Maris originally complained of when the application navigates to
the target JSP of the action:
javax.servlet.ServletException: Cannot retrieve definition for
form bean null
It appears that in the cases where I get this exception, I have the struts
<html:form> tag present, with a dummy action specified. I think it is
trying to look up the form bean for the action when it gets the exception.
I don't think you can have an html:form tag without an action specified,
but I think that has been a frequently appearing thread so not sure what
the final verdict was. In my particular case, I do not use the action
specified in the html:form tag (the action to use set by javascript when
they submit), but I had to put it there anyway.
Jim
Jim Weaver
Software Developer - ThoughtWorks
"Prengaman.Kare
n" To: 'Struts Users Mailing List'
<[EMAIL PROTECTED]>
<Karen.Prengama cc:
[EMAIL PROTECTED]> Subject: RE: JSP page without form bean
?
11/20/2001
11:00 AM
Please respond
to "Struts
Users Mailing
List"
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]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>