Note that there are some explanatory texts on larger screens.

plurals
  1. POJava EE and struts and JSP: java form population - action bean etc
    primarykey
    data
    text
    <p>HI everyone.</p> <p>ISSUE-</p> <blockquote> <p>Error populating nl.strohalm.cyclos.controls.cv.CvUploadForm@317bdd in /member/cvUpload javax.servlet.ServletException: BeanUtils.populate</p> </blockquote> <p>I am working on a opensource wep app, and trying to teach my self some skills by adding new functionality.</p> <p>Now The web app is called cyclos and uses - Java EE, Struts, Hibernate, JSP, Tiles-def (spring, MySql JavaScript) SETUP: controls, DAO's, services, entities etc.</p> <p>I am trying to add new functionality such as a CV database for users to save a template and file.</p> <p>My sample JSP form looks as follows:</p> <pre><code>&lt;ssl:form method="post" action="/member/cvUpload" enctype="multipart/form-data"&gt; &lt;html:hidden property="id" /&gt; &lt;html:hidden property="owner" /&gt; &lt;html:hidden property="uploadDate" /&gt; &lt;table class="defaultTableContent" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td class="tdHeaderTable"&gt;TITLE HERE PLEASE !!!&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" align="left" class="tdContentTableLists"&gt; &lt;table class="defaultTable"&gt; &lt;tr&gt; &lt;th class="tdHeaderContents" width="30%"&gt; CV Upload -&gt; needs properties copy / ref !!!&lt;/th&gt; &lt;th class="tdHeaderContents" width="60%"&gt;&amp;nbsp;&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Notes &lt;/td&gt; &lt;td&gt;&lt;cyclos:richTextArea name="notes" styleId="descriptionText"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Address&lt;/td&gt; &lt;td&gt;&lt;html:text value="address" size="25" property="address" /&gt;&lt;br&gt; &lt;html:text value="address" size="25" property="address2" /&gt; &lt;html:text value="address" size="25" property="address3" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Phone Number&lt;/td&gt; &lt;td&gt;&lt;html:text value="0791 000 000" size="15" property="phoneNumber"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Field of interest / industry&lt;/td&gt; &lt;td&gt;&lt;c:forEach var="industry" items="${industries}"&gt; &lt;label&gt; &lt;html:radio property="industry" value="${industry}" styleClass="radio" /&gt;&lt;bean:message key="cv.industries.${industry}" /&gt; &lt;/label&gt; &lt;/c:forEach&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;CV upload&lt;/td&gt; &lt;td&gt;&lt;html:file property="cvContent" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="submit" id="saveButton" value="&lt;bean:message key="global.submit"/&gt;" align="center"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p></p> <p>And my java form populated by struts or how ever looks as follows:</p> <pre><code>public class CvUploadForm extends BaseBindingForm { private Long id; @IndexedEmbedded(depth = 4) private Member owner; // private Calendar creationDate; // private Member memberId; private FormFile cvContent; private Calendar uploadDate; private long memberId; public CvUploadForm() { } public CvUploadForm(Long id, Member owner, FormFile cvContent, Calendar uploadDate) { this.id = id; this.owner = owner; this.cvContent = cvContent; this.uploadDate = uploadDate; } public Map&lt;String, Object&gt; getCv() { return values; } public void setCv(final Map&lt;String, Object&gt; map) { values = map; } public void setCv(final String key, final Object value) { values.put(key, value); } </code></pre> <p>// ++ GETTERS AND SETTERS ++</p> <p>// =============================================</p> <p>Now I can display my template, but my submit wont work -> and i would like to understand the issue / error shown im my output window !! (see at top and following error )</p> <p>the next error shown is as follows :</p> <blockquote> <p>Caused by: java.lang.IllegalArgumentException: Cannot invoke nl.strohalm.cyclos.controls.cv.CvUploadForm.setOwner - argument type mismatch</p> </blockquote> <p>Plus couple more errors. (owner ov cv refers to different member table as ID - uses java enum - relationships... fetch</p> <p>I am very grateful for any reply ! And mybe some clarification about the setup. I thought I onlu use the form to display bits on JSP, and the use the CV.java entity file for the maaping etc . . so I am a little lost on getting all files and the connection right as wel las understanding the error here</p> <p>Thanks for any reply, if you need additional info pls let me know. Alex</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload