Nav Kumar
Nav Kumar

Reputation: 141

how to link a page in spring mvc

Hello, I am working on spring mvc and I have in my home page a a simple link of page register and the register.jsp is contained in my WEB-INF/pages/register.jsp

So on my index.jsp which is in my base folder means in webcontent parllel to WEB-INF so how can i link this register.jsp

<li class="float-block" style="margin-left:50px;"><a href="pages/register.jsp" class="login" title="New User Register here" >Register</a></li>

Please suggest me how to do this to run this link

Upvotes: 3

Views: 13099

Answers (3)

KESHAV RAJPUT
KESHAV RAJPUT

Reputation: 1

a href tag name and request mapping of controller class address should be same and add the object of that class in Form Tag like

Upvotes: 0

Bharath R
Bharath R

Reputation: 1531

You can do that by redirecting it to a controller and then to the jsp of your need.

Check this link.

Upvotes: 4

Alex
Alex

Reputation: 11579

It depends on your configuration. Check request mapping in your controller class and all xml configurations. Normally it should be something like <a href="/register"> depends on the controller.

Upvotes: 0

Related Questions