1

I want to import a class that is inside one jsp page to another jsp page. How must I write the import statement for it? For example I have a jsp page called Login.jsp which contains a class called User. I want to import this User class into another jsp page called Shop.jsp.

1 Answer 1

1

Short: Not possible.

Longer: I could imagine few very dirty hacks to achieve what you want, but the whole conception is wrong. If you have classes to be shared between different JSP pages, these classes should be externalized, compiled independently, and then referenced (imported) as such in such JSP pages.

Sign up to request clarification or add additional context in comments.

2 Comments

If I create an object of a class in one jsp page, how do I use that object in another jsp page?
Depends on when the other page needs it - learn about request, session, and servlet context.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.