We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,363 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Links in SpringMVC

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>
1
Contributor
0
Replies
1
View
m1051f
Newbie Poster
2 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0538 seconds using 2.66MB