I have a jsp where I want to include a button that will simply invoke a new
struts action, which is a ForwardAction that invokes the Tiles definition
for a new page.  At first I tried this with a Struts tag, as below:

    <html:form action="/BuildPostMessageViewAction">
        <html:submit value="Post message for this classmate"/>
    </html:form>

However, I was getting the following error in my browser:

    [ServletException in:/classmateInfoData1.jsp] Cannot retrieve
definition for form bean null' javax.servlet.jsp.JspException: Cannot
retrieve definition for
     form bean null at
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:831)
     at...
     ...

I guess this was becuse I was defining a form in my JSP, yet there really
aren't any form fields, nor any form associated with the action invoked by
the button.  So, I swapped out that code for the straight HTML:

    <FORM METHOD="LINK" ACTION="BuildPostMessageViewAction.do">
        <INPUT TYPE="submit" VALUE="Post message for this classmate">
    </FORM>

This works fine, but I have to ask, is this how a purely struts application
should be written, or is there a truly struts-based solution to what I was
trying to do?
Thanks!

p.s., if it helps here is the relevant snippet from struts-config.xml:

    <action path="/BuildPostMessageViewAction"
type="org.apache.struts.actions.ForwardAction" parameter="postMessageDef">
    </action>

--
"NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected."


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

Reply via email to