Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7806277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:28:58+00:00 2026-06-02T02:28:58+00:00

i am trying to write a API using JSP/JSTL to generate JSON output but

  • 0

i am trying to write a API using JSP/JSTL to generate JSON output but its not working in am not able to figure out the problem. Here i am getting problem when using C tag Library for reading the array.Here is the code:

<%@ page import="java.lang.*,java.io.*,java.util.*,java.sql.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/abc" user="root"  password="xxx"/>
<sql:query dataSource="${snapshot}" var="result" sql="SELECT countries_name,countries_iso_code_2  FROM countries"/>

<json:object> 
    <json:object name="list">
        <c:forEach var="row" items="${result.rows}">
        <json:object items="countries">
            <json:property name="Country" value="${row.countries_name}"/>
            <json:property name="iso" value="${row.countries_iso_code_2}"/>
        </json:object>
        </c:forEach>
  </json:object>
</json:object> 

The Exception i am getting is as

org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.ws.indexajson_jsp
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:178)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Please help me to rectify the problem. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:29:00+00:00Added an answer on June 2, 2026 at 2:29 am

    I just have solved it. i just removed C Tag Library changed json generating code as

    <json:object> 
        <json:object name="list">
            <json:array name="countries" var="row" items="${result.rows}">
                <json:object>
                    <json:property name="Country" value="${row.countries_name}"/>
                    <json:property name="iso" value="${row.countries_iso_code_2}"/>
                </json:object>
            </json:array>
        </json:object>
    </json:object> 
    

    and it works. i got the problem was my array syntax.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a drop-in replacement for System.Media.SoundPlayer using the waveOut... API. This
I'm trying to write a REST API. I honestly do not know anything related
I'm trying to write a simple maze game, without using any deprecated OpenGL API
I'm trying to write a voip app for Android, using the Android SIP API
I am trying to write a C++/CLI wrapper using VS2010 against an C++ API
Trying to write a simple call to google's JSON stock ticker API. I would
I'm trying to write a bot for turntable.fm using alaingilbert's API (https://github.com/alaingilbert/Turntable-API), which uses
I'm trying to write a 3D game in ActionScript 3.0 using the Stage3D API.
I'm trying to write an MQL query to be executed using Freebase API's. I
I wrote REST service using ASP.NET Web API. I'm trying to send HttpDelete request,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.