Skip to content
Advertisement

How to import java libraries in jsp code?

I have the following jsp code. I want to add libraries such as java.io.

How can I do this?

JavaScript

Advertisement

Answer

You are almost right, but you need to close the import tag, like this:

JavaScript

To declare multiple imports you can either duplicate that entire tag, like so:

JavaScript

or use a comma-separated list:

JavaScript

For a multitude of reasons, though, I would not recommend mixing java code into your JSPs.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement