0

I am developing an web application and i can access it using the below URL:

http://localhost:8090/LPT/jsp/index.jsp

Can i access with context path.

user3711336
  • 13
  • 1
  • 7

1 Answers1

0

You can use servlet mapping functionality in web.xml to achieve this.

In your web.xml, you can add:

<servlet>
    <servlet-name>index</servlet-name>
    <jsp-file>/jsp/index.jsp</jsp-file>
</servlet>

<servlet-mapping>
    <servlet-name>index</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>
fajarkoe
  • 1,543
  • 10
  • 12
  • there is no way for the browser to know that if you type "LPT", then the browser should send HTTP request to localhost at port 8090. What if you change the port to 8091? How does the browser knows to sent to port 8091, instead of 8090? – fajarkoe Jun 20 '14 at 18:35