struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lucas owen <sr.ilus...@gmail.com>
Subject Struts 1: two forms in a jsp possible?
Date Fri, 29 Jun 2012 12:03:52 GMT
Hi Struts 1 users:

I have a jsp to show information of an object, let's say its name, type,
length...
but now users can attach documents of that object and I've decided to add a
new form to accomplish this requirement:

------JSP:

<html:form action="object.do" method="POST">
<html:text property="name" size="10" maxlength="10"/>
<html:text property="type" size="10" maxlength="10"/>
<html:text property="length" size="10" maxlength="10"/>
</html:form>

<html:form action="insertObjDoc.do" method="POST"
enctype="multipart/form-data">
<html:file property="upldFile" size="40"/>
<html:submit value="UploadFile"/>
</html:form>

------struts-config.xml:

<action path="/object" type="ObjectAction"
name="ObjectForm" scope="request"  validate="true" input="/jsp/Object.jsp">
<forward name="object" path="/jsp/Object.jsp" />
</action>

<action
path="/insertObjDoc" type="InsertObjectAction" name="DocObjectForm"
scope="request"
validate="true" input="/jsp/Object.jsp">
<forward name="success" path="/jsp/InfoUploadDoc.jsp" />
</action>

so I only submit the bottom part of the JSP to insertObjDoc which only has
the uploaded file but the problem is that following exception arises:

javax.servlet.jsp.JspException: No bean found under attribute key ObjectForm

(I'm performing maintenance tasks and i dont want to touch first form (its
much more complex than what i've spotted), so i add a new one but i dont
know if this is possible with Struts 1)
thanks in advance

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message