File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes how to use json in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to use json in jsp" Watch "how to use json in jsp" New topic
Author

how to use json in jsp

skevin scott
Greenhorn

Joined: Sep 21, 2013
Posts: 10
<c:forEach var="ques" items="${result.rows}">

${ques.question}<br>

<input type="radio" name="group" value="${ques.ans_a}" /> ${ques.ans_a}<br>
<input type="radio" name="group" value="${ques.ans_b}" /> ${ques.ans_b}<br>
<input type="radio" name="group" value="${ques.ans_c}" /> ${ques.ans_c}<br>
<input type="radio" name="group" value="${ques.ans_d}" /> ${ques.ans_d}<br>

<input type="submit" value="Check" onclick="loadJSON();" />
<hr>

</c:forEach>

This is used to print question and answers in page.

I want to check each question after answer question , check button is used for that.
there I use json for load a correct answer.

<c:forEach var="ques" items="${result.rows}">

${ques.question}<br>

<input type="radio" name="group" value="${ques.ans_a}" /> ${ques.ans_a}<br>
<input type="radio" name="group" value="${ques.ans_b}" /> ${ques.ans_b}<br>
<input type="radio" name="group" value="${ques.ans_c}" /> ${ques.ans_c}<br>
<input type="radio" name="group" value="${ques.ans_d}" /> ${ques.ans_d}<br>
<div id="Name"></div> //this div is used to display updates . this is connect with the javascript and it is connect with json file for get a data
<input type="submit" value="Check" onclick="loadJSON();" />
<hr>

</c:forEach>

When I use in this method, if any check button pressed, only 1st question update


how I solve this problem?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

I do not believe that you have explained the problem in enough detail for anyone to figure out what you are asking.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: how to use json in jsp