Spring Community Forums > Core Spring Projects > Web > Getting "WEB-INF" in output of
PDA

View Full Version : Getting "WEB-INF" in output of


jodacro
Sep 24th, 2004, 12:15 PM
I have a page containing:

<a href="<c:url value="Login.htm"/>">Login</a>

And my springapp-servlet.xml and web.xml contain what's below. The problem: The above href is rendered as

<a href="http://localhost:7001/camaro/WEB-INF/pages/Login.htm" />

Of course, this URL is not valid -- see "WEB-INF" in path. What I want is this:

<a href="http://localhost:7001/camaro/Login.htm" />

------------------------------ springapp-servlet.xml (excerpt) ---------------------
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="mappings">
<props>
<prop key="/Home.htm">homeController</prop>
<prop key="/Login.htm">loginForm</prop>
</props>
</property>
</bean>

<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix"><value>/WEB-INF/pages/</value></property>
<property name="suffix"><value>.jsp</value></property>
</bean>

------------------------------ web.xml (excerpt) ---------------------
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>

jodacro
Sep 24th, 2004, 12:43 PM
I've figured this out. The c:url tag needs to be

<a href="<c:url value="/Login.htm" />">Login</a>

vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.