0

Basically I have a servlet say: gubis.

To be precise: I need my gubis servlet be accessed as servs/gubis

The goal I want to reach is that if I made the request as localhost:8080/EclipsePro/servs/gubis the request should be redirected to localhost:8080/EclipsePro/gubis

I tried:

<servlet>
    <servlet-name>servs/gubis</servlet-name>
    <servlet-class>duck.reg.pack.gubis</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>servs/gubis</servlet-name>
    <url-pattern>/gubis</url-pattern>
</servlet-mapping>

But it didn't worked

Whatever
  • 125
  • 2
  • 2
  • 8

1 Answers1

0

If you need gubis servlet be accessed as servs/gubis

<servlet>
    <servlet-name>gubis</servlet-name>
    <servlet-class>duck.reg.pack.gubis</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>gubis</servlet-name>
    <url-pattern>servs/gubis</url-pattern>
</servlet-mapping>

The goal I want to reach is that if I made the request as localhost:8080/EclipsePro/servs/gubis the request should be redirected to localhost:8080/EclipsePro/gubis

You can use url-rewriting to achieve the above.

Jaydeep Rajput
  • 3,605
  • 17
  • 35
  • Ahh, That makes my apache server never start and pops the error saying `Server Tomcat v8.5 Server at localhost failed to start.` – Whatever Oct 04 '17 at 11:50