Hick
Hick

Reputation: 36404

how to make json work in a jsp page using tomcat server?

I have downloaded json library , and my jsp pages are in tomcat/webapps/star/index.jsp .

So where should I extract the json libraries so that the json code contained in index.jsp works ?

Upvotes: 1

Views: 2861

Answers (1)

BalusC
BalusC

Reputation: 1108782

As usual, 3rd party libraries in JAR flavor should go in Webapp/WEB-INF/lib folder. This folder is taken in the webapp's default runtime classpath. If you'd like to share the same libs among multiple webapplications on the same server, then rather drop it in Tomcat/lib folder.


By the way, such JSON libraries only converts Java objects to JSON strings and vice versa. They have completely nothing to do with JSON in the JSP side. It's JavaScript who's responsible for that part.

Upvotes: 1

Related Questions