jQuery in Action, 3rd edition
The moose likes JSP and the fly likes redirecting to a jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "redirecting to a jsp page" Watch "redirecting to a jsp page" New topic

redirecting to a jsp page

Priya Lavti
Ranch Hand

Joined: Oct 11, 2004
Posts: 41
Hi all,

I want to redirect to MyPage.jsp when user enters the url www.mywebsite.com/mypage in the browser. Can it be done by editing web.xml? Or something else have to be done for this?

Thanks in advance

SCJP 5.0
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Is "mypage" a valid webapp (context)?
If so, you only need to add MyPage.jsp to your welcome-file-list in web.xml.
If not, you can create a servlet entry for the MyPage.jsp page and create a mapping with a url-pattern of "mypage".

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: redirecting to a jsp page
It's not a secret anymore!