I have a problem getting the correctness of my JSP footwear. I intend to do what is included in a list that contains questions and Each question object is a list with a text field and option.
My intention is to be able to edit multiple questions (both enable the text of the question / edit the name and edit the option containing.)
My backing object is now Sending a list question.
Here is my JSP which is failing with illegal property, Bean class.
& lt; Form: Form CommandName = "Question" & gt; & Lt; Form: Errors Path = "*" & gt; & Lt; Fieldet class = "stdframe" & gt; & Lt; Story & gt; Question & lt; / Narrative & gt; & Lt; / Fieldset & gt; & Lt; / Form: Errors & gt; & Lt; Div class = "stdframe" & gt; & Lt; C: forEach var = "q" item = "$ {query}" varStatus = "s" & gt; & Lt; P & gt; & Lt; P & gt; Question: & lt; / P & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Form: Input size = "67" path = "$ {q.text}" /> gt; & Lt; / P & gt; & Lt; Br / & gt; $ {Q.text} & lt; Ul & gt; & Lt; C: forEach var = "optional" item = "$ {q.alternatives}" varStatus = "t" & gt; $ {Optional.text} & lt; Li & gt; & Lt; Form: Input Path = "$ {Optional [$ t.index] .text}" /> & Lt; / Li & gt; & Lt; / C: foreach & gt; & Lt; / Ul & gt; & Lt; Br / & gt; & Lt; / C: foreach & gt; & Lt; Input type = "submit" class = "submit" value = "save" /> & Lt; Input type = "button" square = "button" onClick = "back ()" value = "back" /> & Lt; / Div & gt; & Lt; / Form: Form & gt; I have tried both $ {q.text} and $ {q [$ s.index] .text} . When I print only $ {q.text} , then this question shows the correct text for the object, alternately the same goes. What can I do to bind the object correctly?
In addition to that, when I store that object which lists the other objects, then the list can be stored in the database itself?
You may need to wrap your list as a field in a simple object with the list: / P>
class MyListWrapper {list question; } // e.t.c. If you use it as your order / form object, then you should be able to do something in JSP:
& lt ; Form: Form CommandName = "Cover" & gt; // ... & lt; C: forEach var = "q" item = "$ {wrapper.questions}" varStatus = "s" & gt; & Lt; P & gt; & Lt; P & gt; Question: & lt; / P & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Form: input size = "67" path = "question [$ {s.index}]. Text" /> gt; & Lt; / P & gt; // ... & lt; C: forEach var = "optional" item = "$ {q.alternatives}" varStatus = "t" & gt; $ {Optional.text} & lt; Li & gt; & Lt; Appearance: Input path = "question [$ {s.index}]. Option [$ {t.index}]. Text" /> & Lt; / Li & gt;
Comments
Post a Comment