简体   繁体   中英

Classes from the default package must not be referenced from JSP file

From JSP file accessed another JSP file which acts like java class, this used to work in JRun server properly. Now I'm migrating to Tomcat server and this is what I'm getting. How can I solve such problem?

This is another.jsp file which is accessed from regular jsp file:

 <%!
public class ElemSetup {
}
%>

You can solve such problems by having a package declaration. Seriously, it is a strongly discouraged practice to have the default package!

Well, declaring a class inside a JSP is forbidden. Use a regular .java file instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM