英文:
Some Imports Unresolved in JSP file Intellij
问题
尝试在Intellij中使用JavaEE构建Web应用程序。但是尽管在Servlet类中相同的导入工作正常,但是在我的jsp文件中却出现了未解析的依赖项。项目在Servlet类中使用导入进行编译正常,但是当我尝试在jsp文件中使用相同的导入时,我会收到错误消息。
我已经检查了我的构件库依赖项,模块在构件中也存在,一切正常。只是在jsp文件中导入无法解析。
以下是我的jsp文件的屏幕截图:
我无法弄清楚问题出在哪里。任何帮助将不胜感激。
编辑:
为了解决这个问题,我不得不将我想要在jsp文件中使用的类和库选择为全局库。所以我只需要进入项目结构 > 全局库 > 新建...,然后选择我想要的类作为全局库,然后jsp文件就能识别这些类了。我编辑了这个问题,以防其他人碰到这样的小问题。
感谢所有试图帮助的人。
英文:
Am trying to build a web App in intellij using JavaEE. But i am getting unresolved dependencies in my jsp file even though that same import works fine in the servlet class. The project compiles fine with the import in the servlet class but when I try to use the same import in the jsp file i get errors.
I've checked my artifact library dependencies and the module is present in the artifact and everything is fine. Only that the import is unresolved only in the jsp file.
Here's a screenshot of my jsp file
I can't figure out what's wrong. Any help will be appreciated.
EDIT :
to resolve the issue i had to select the classes and libraries i wanted to use in the jsp file as global libraries. So i did this by simply going to project structure > global libraries > new .... i selected the classes i wanted as global and then the jsp file recognized the classes. I edited the question In case anyone else ever runs into such a silly problem.
Thanks to all who tried to help.
专注分享java语言的经验与见解,让所有开发者获益!
评论