I have 2 class one is question and another one is answer.iam getting questions in a list in action class and in my jsp page iam using iterator and display the questions in questions page.All questions have the href.when i click on first quesion i want to get the question in answer page. here my code is there, This is my question action class execute method
PersistenceService service1 = PersistenceServiceImpl.getInstance();
questionlist = service1.getQuestionList();
Iterator iterator1 = questionlist.iterator();
while(iterator1.hasNext())
{
Questions question = (Questions)iterator1.next();
System.out.println("id1"+question.getQuestions());
}
here iam getting all questions
my question jsp page is
<s:iterator value="questionList" var="m" status="status">
<tr>
<td><a href="AnswerAction"><s:property value="%{#m.questions}" /></a></td>
</tr>
</s:iterator>
Please tell me how to get the on click question in answer page
You getting questionlist list,then why your Iterating movieNameList.if question are availble in movieNameList,your need to iterate
<s:iterator value="movieNameList" status="movieNameList_status">
<tr>
<td><a href="AnswerAction"><s:property value="movieNameList.get(#movieNameList_status.index).question.getQuestions()"/> </a></td>
</tr>
</s:iterator>
try this,,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.