HarsH
HarsH

Reputation: 794

Unable to call index.jsp

I'm working on a java web application stuffed with JSPs & servlets through jDeveloper IDE. The integrated server I'm using is Weblogic.

In middle of my application, if I remove the path till the context root, the java code written on my index.jsp isn't getting executed.

Also index page entry is provided in web.xml

For Ex. :

my app url is http://localhost:7101/DAMS/index.jsp In middle somewhere I'm on the url : http://localhost:7101/DAMS/pages/activate.jsp Here if I remove "/pages/activate.jsp" from my URL, the SOP written on my index.jsp isn't printed. Any clues ?

What I wish to do is if someone hits the index page, I wish to invalidate session by calling session.invalidate(); on index.jsp.

web.xml :

<servlet>
    <servlet-name>OnSaveMedicaidOption</servlet-name>
    <servlet-class>com.restat.db.OnSaveMedicaidOption</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>OnSaveMedicaidOption</servlet-name>
    <url-pattern>/OnSaveMedicaidOption</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>/index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <description></description>
    <display-name>PostData</display-name>
    <servlet-name>PostData</servlet-name>
    <servlet-class>com.restat.db.PostData</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>PostData</servlet-name>
    <url-pattern>/postData</url-pattern>
  </servlet-mapping>

SOP** = System.out.println();

Thanks

Upvotes: 0

Views: 616

Answers (1)

user2282175
user2282175

Reputation:

It would have been a comment, but my reputation doesn't allow me to do so.Declare the index.jsp as welcome-file-list in web.xml.

<welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
</welcome-file-list> 

Upvotes: 2

Related Questions