Announcement Announcement Module
Collapse
No announcement yet.
Getting "WEB-INF" in output of Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting "WEB-INF" in output of

    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.Sim pleUrlHandlerMapping">
    <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.Intern alResourceViewResolver">
    <property name="viewClass">
    <value>org.springframework.web.servlet.view.JstlVi ew</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>

  • #2
    Resolved -- wrong &quot;name&quot; in c:out

    I've figured this out. The c:url tag needs to be

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

    Comment

    Working...
    X