Announcement Announcement Module
Collapse
No announcement yet.
Taglib c prefix problems Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Taglib c prefix problems

    I have a problem when using the c:if on the jsp pages. I have tried on apache server 6.0.38, apache 7 and VMware vFabric tc Server Developer Edition v2.6.

    It seems it can't load the jstl 1.2 libraries and throws an JasperException that it can't read the META-INF/c.tld and can't instantiate the TagLibraryValidator.

    I'm using the SpringToolSource Suite 2.9.1, and I have lost nearly the whole day in this mistake and reading other posts that simply don't work.

    My web.xml has:
    Code:
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="NotreDammeWeb" version="2.5">
        <display-name>NotreDamme-Web</display-name>
    
    	<!-- Processes application requests -->
    	<servlet>
    		<servlet-name>spring-dispatcher</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    		
    	<servlet-mapping>
    		<servlet-name>spring-dispatcher</servlet-name>
    		<url-pattern>*.do</url-pattern>
    	</servlet-mapping>
    	
    	<servlet-mapping>
    		<servlet-name>spring-dispatcher</servlet-name>
    		<url-pattern>*.form</url-pattern>
    	</servlet-mapping>
    	
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>/WEB-INF/spring-dispatcher-servlet.xml</param-value>
    	</context-param>
    	
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    	
    	<welcome-file-list>
    		<welcome-file>/WEB-INF/views/index.html</welcome-file>
    		<welcome-file>/WEB-INF/views//index.jsp</welcome-file>
    	</welcome-file-list>
    
    </web-app>
    My Jsp is:
    Code:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <html>
    <head>
    <title>Buscar Expediente Medico Por ´┐Żltima Visita Hecha</title>
    </head>
    <body>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    <form:form commandName="lastVisitForm" action="ultima_visita.form">
    	<form:errors path="*"/>
    	<table>
    		<tr>	
    			<td>Fecha Principio:</td>
    			<td><form:input path="lastVisitedDateBeginning" /></td>
    			<td><form:errors path="lastVisitedDateBeginning" /></td>
    		</tr>
    		<tr>	
    			<td>Fecha Despues:</td>
    			<td><form:input path="lastVisitedDateEnding" /></td>
    			<td><form:errors path="lastVisitedDateEnding" /></td>
    		</tr>
    		<tr>
    			<td colspan="2">
    				<input type="submit" value="Save Changes" />
    			</td>
    		</tr>
    	</table>
    	<c:if test="${not empty result}">
    		<table>
    			<c:forEach var="data" items="${result}" >
    				<tr>
    					<td>${data}</td>
    				</tr>
    			</c:forEach>
    		</table>
    	</c:if>	
    </form:form>
    </body>
    </html>
    maven dependencies for servlet:
    Code:
          <dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>servlet-api</artifactId>
    			<version>2.5</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>javax.servlet.jsp</groupId>
    			<artifactId>jsp-api</artifactId>
    			<version>2.1</version>
    			<scope>provided</scope>
    		</dependency>
    		
    		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>jstl</artifactId>
    			<version>1.2</version>
    		</dependency>
    Any clues?

  • #2
    I have finally found a solution.

    changing on maven:
    Code:
    <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>jstl</artifactId>
                <version>1.2</version>
            </dependency>
    to:

    Code:
                    <dependency>
    			<groupId>jstl</groupId>
    			<artifactId>jstl</artifactId>
    			<version>1.2</version>
    		</dependency>
    Probably meaning that the previous library was corrupted or that it simply doesn't work with the servers, while the last one does.

    Comment

    Working...
    X