Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated taglib definitions in statically included delphiAnswersTable.jsp causes exceptions in runtime #500

Open
piotrkiraga opened this issue Oct 3, 2022 · 7 comments

Comments

@piotrkiraga
Copy link

Hello,

When I deploy our forked version of EUS application (synced with EUS master few days ago) in Tomcat 9.0.52 then I experience some exception related to repeated taglibs definition, hence I had to remove following 3 first lines from the file below:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="esapi" uri="http://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API" %>

File above is statically included (include directive) in:
WEB-INF/views/runner/elementtemplates.jsp:1505
In such a case taglibs do not need to (cannot actually) be redefined in included file. This is in opposition to dynamic include (<jsp:import...).

Observed exception:

30-Sep-2022 12:04:31.499 SEVERE [http-nio-8080-exec-4] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet [jsp-servlet] threw exception
	org.apache.jasper.JasperException: /WEB-INF/views/runner/elementtemplates.jsp (line: [1505], column: [4]) /WEB-INF/views/runner/delphiAnswersTable.jsp (line: [1], column: [63]) The prefix [c] specified in this tag directive has been previously used by an action in file [/WEB-INF/views/runner/elementtemplates.jsp] line [1045].

Issue takes place when you login to Admin Console and try to edit content of some survey, then it hangs with endless preloaders trying to load survey and editor components.

Best regards.
Piotr

@clam2310
Copy link
Contributor

clam2310 commented Oct 4, 2022

That does not happen in our environments. Do you precompile the JSPs (we do not)?

@piotrkiraga
Copy link
Author

This happens in runtime, when JSP if first time reached. I don't think we have some custom set-up in Tomcat 9, I was sure it is default behavior. Do you customize somehow your server set-up?

@clam2310
Copy link
Contributor

clam2310 commented Oct 5, 2022

We have no customized server setups and the code runs on several Tomcats without any issues. We use static includes at lots of places and never got any exceptions.
Your exception implies that a taglib reference is missing. I assume that happens after you removed these lines? What was the exception before you did that (the one indicating repeated taglib definitions)?

@piotrkiraga
Copy link
Author

Exception above IS NOT saying that taglib reference is missing.

Exception I have quoted above says that taglib definition under prefix "c" created in delphiAnswersTable.jsp document (included document) has been already declared under the same prefix in document elementtemplates.jsp (including document), hence severe level exception and JSP compilation interruption in runtime takes place.

When I remove these three lines of taglibs definition in delphiAnswersTable.jsp then all is fine and I can edit survey. But I am not sure if I am not breaking some functionality with this fix, as all variables and methods or classes related with some "delphi" term is quite new to me. What is "delphi survey"? Is there some reference about it?

@clam2310
Copy link
Contributor

clam2310 commented Oct 5, 2022

According to https://www.ibm.com/docs/en/was-liberty/nd?topic=messages-jspg that exception means this:
The taglibrary prefix was used before the tag directive that defines the prefix.

@piotrkiraga
Copy link
Author

Well, when I see Parser class code in Jasper then this documented error message seems not to be adequate as practice demonstrates different experience.

But, what I wanted to share with you is, that:

  1. All works fine when I remove from 'delphiAnswersTable.jsp' following three lines:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="esapi" uri="http://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API" %>

  2. When I change line elementtemplates.jsp:1505 into call below, then it also works fine:
    <jsp:include page="delphiAnswersTable.jsp"/>

@jobenjada
Copy link

hey! Not sure if the EU Survey team is still actively developing the solution. We've been working on a free & open source (AGPLv3) survey platform for almost 2 year now and keep improving it daily: Have a look at Formbricks

Github repo: https://github.com/formbricks/formbricks
Website: https://formbricks.com/

Happy to answer any questions in our Discord :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants