Importing classes in JSP

0 votes

I am a complete JSP beginner. I am trying to use a java.util.List in a JSP page. What do I need to do to use classes other than ones in java.lang?

May 25, 2018 in Java by developer_1
• 3,350 points
28,013 views

1 answer to this question.

0 votes

Use Page Directive to import a Class in JSP page. Page Directive Uses 11 Different types of Attributes , One of them is "import". Page Directive with import Attribute Allows you to Mention more than one package at the same place separated by Commas(,). Alternatively you can have multiple instances of page element each one with Different package .

For Example:

 <%@ page import = "java.io.*" %>
 <%@ page import = "java.io.*", "java.util.*"%>

Note : the import attribute should be placed before the element that calls the importd class .

answered May 25, 2018 by Rishabh
• 3,620 points

Related Questions In Java

0 votes
1 answer

Should a class file always be inside package for importing it in jsp page?

Hey there! It is not necessary for the ...READ MORE

answered May 24, 2019 in Java by Karan
2,203 views
0 votes
1 answer

Can't access static fields in inner classes in Java

Well, the major idea behind this concept ...READ MORE

answered Oct 9, 2018 in Java by anto.trigg4
• 3,440 points
1,814 views
0 votes
0 answers

How execute JSP web page in Intellij

Hi all, I am new to java and ...READ MORE

Jan 24, 2019 in Java by Abraham
• 120 points

edited Jul 11, 2023 by Khan Sarfaraz 1,889 views
0 votes
1 answer

How to disable session in JSP?

<%@ page session=“false” %>    Using this above command, you can ...READ MORE

answered Feb 18, 2019 in Java by Frankie
• 9,830 points
1,535 views
0 votes
1 answer

Get parameters from the URL with JSP

To delete the subject record with its ...READ MORE

answered May 29, 2018 in Java by Parth
• 4,640 points
3,386 views
0 votes
1 answer

How can we upload the files using JSP/ Servlets in Java?

<form action="upload" method="post" enctype="multipart/form-data"> ...READ MORE

answered Jun 8, 2018 in Java by Sushmita
• 6,920 points
873 views
0 votes
1 answer

Difference between JSF, Servlet and JSP?

Servlet - it's java server side layer. JSP ...READ MORE

answered Jul 3, 2018 in Java by samarth295
• 2,220 points
1,538 views
0 votes
1 answer

doGet and doPost in Servlets

When you are using HTTP GET requests ...READ MORE

answered Jul 17, 2018 in Java by Mrunal
• 680 points
5,428 views
0 votes
1 answer

How to divide a string in two parts

String s="yourstring"; boolean flag = true; for(int i=0;i<s.length();i++) { ...READ MORE

answered Apr 13, 2018 in Java by Rishabh
• 3,620 points
1,191 views
0 votes
2 answers

Integer to String conversion in java

We can do this in 2 ways: String ...READ MORE

answered Jul 28, 2018 in Java by samarth295
• 2,220 points
1,189 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP