1,105,594 Community Members

Links in SpringMVC

Member Avatar
m1051f
Newbie Poster
2 posts since Oct 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I am currently at this URL localhost:8080/Test/students/Steve

The page from that URL displays some info about Steve and a link that goes to teachers.

<a href="teachers/all">Click to view all teachers</a>

When I click the link it goes to localhost:8080/Test/students/teachers/all
I want localhost:8080/Test/teachers/all

How can I do that?

I managed to do it with

<a href="../teachers/all">Click to view teachers</a>

but .... is there another way to do this?


web.xml:

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.4"

xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">







	<servlet>

		<servlet-name>springmvc</servlet-name>

		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

		<load-on-startup>1</load-on-startup>

	</servlet>

	

	<servlet-mapping>

		<servlet-name>springmvc</servlet-name>

		<url-pattern>/</url-pattern>

	</servlet-mapping>

	

	

	<welcome-file-list> 

		<welcome-file>/WEB-INF/index.jsp</welcome-file>

	</welcome-file-list> 



</web-app>
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: