java - JasperException: Absolute uri cannot be resolved -


i have been getting following jasperexception when trying use xml schema web.xml, instead of deprecated doctype declaration:

http status 500 - absolute uri: http://java.sun.com/jsp/jstl/core  cannot resolved in either web.xml or jar files deployed application 

if use web.xml, application compiles:

<!doctype web-app public  "-//sun microsystems, inc.//dtd web application 2.3//en" "http://java.sun.com/dtd/web-app_2_3.dtd" >  <web-app>     <display-name>archetype created web application</display-name> </web-app> 

however, if use web.xml, jasperexception:

<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">     <display-name>coursemanagementjdbc</display-name>\ </web-app> 

any idea why deprecated format work?

note: maven project, , jstl dependency has been correctly declared, tag library in jsp:

pom.xml:

<dependency>     <groupid>javax.servlet</groupid>     <artifactid>jstl</artifactid>     <version>1.2</version> </dependency> 

jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 

they're correct; gives?

i came upon solution. default, reason (and i'd know why), maven generates dynamic web module version 2.3. dtd of course standard servlet 2.3 , unable parse or evaluate xml-based web.xml file.

i'm still not 100% clear why changing web.xml xsd caused jasperexception respect jstl, though think has jstl being integrated jsp @ point after servlet 2.3 - please correct or elaborate on if possible.

see this: https://stackoverflow.com/a/4928309/2879303

now solution:

  1. right-click on maven project , select properties

  2. navigate project facets , untick dynamic web module. apply changes.

  3. from version drop-down box, select latest version (as of writing, 3.1). re-select dynamic web module. apply changes.

  4. right-click on maven project , select maven -> update project.

  5. your project should able correctly interpret web.xml xsd declaration.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -