reset password
Author Message
ummata
Posts: 68
Posted 20:38 Oct 13, 2011 |

I follow an instruction of Maven with Servlet 3.0 by Dr.Sun, everything works except when I try to add taglib to JSP.
This is an error message.


"org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application"

I have the same format of web.xml and pom with SVN:review. But it still has an error.

Thank you.

aligh1979
Posts: 121
Posted 20:55 Oct 13, 2011 |

Did you add the jstl libraries to your project? if no , download these two jar files from here  , and put it under your project library . you can right click on your project --->  build path ---> configuration build path --->  click on library tab and add these two jar files

ummata
Posts: 68
Posted 21:54 Oct 13, 2011 |

Did you add the jstl libraries to your project

Yes, I did. I have added it by using Maven->add dependency.
It still does not work.

aligh1979
Posts: 121
Posted 22:07 Oct 13, 2011 |

initially when I made my project I made a regular dynamic web project , so for the purpose of submitting the homework (due tonight) just make one use that .

in case of maven it is more complicated , it took me a couple of trial and error to make it work (It did not have jstl error though)

there are a couple of jstl dependencies for maven by the way , maybe you are not using the right one . to make sure just open and edit the POM.xml file manually and compare it with this. (you probablly do not need junit section though )

 

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>cs520.homeworks</groupId>
  <artifactId>hm2</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>hm2 Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>hm2-Rubrics</finalName>
    <plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
    </configuration>
  </plugin>
</plugins>
  </build>
</project>

Last edited by aligh1979 at 22:48 Oct 13, 2011.
ummata
Posts: 68
Posted 22:36 Oct 13, 2011 |

Hi ALIGH1979,

My JSTL used in POM is the same as you.
I have no idea what is wrong either, anyway thanks a lot for your help.
 

ummata
Posts: 68
Posted 23:03 Oct 13, 2011 |

Hi all,

Finally it works, but I don't know the reason.
I kept changing dependencies around. And restarted server many times.
I need to learn more about Eclipse, I guess.