3

I have deployed our War under Tomcat 6.0 into Linux server. In that Linux machine, we don't have permissions to open a browser.

Is it possible to execute a JSP from command line?

Piotr Nowicki
  • 17,914
  • 8
  • 63
  • 82
Revathi
  • 1,193
  • 9
  • 19
  • 24

1 Answers1

3

You can use among others wget (<-- click the link to see the manual):

wget http://localhost:8080/context/page.jsp

Unrelated to the concrete problem, I however wonder how that's useful. If you're for example abusing a JSP to do some webapp initialization, then you should instead have done it in a ServletContextListener (<-- click the link to see the Javadoc).

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • How ServletContextListener , could help in this case ?? – Revathi Nov 24 '11 at 17:48
  • Click the links in my answer. I edited the answer to point out them for the case you missed them. – BalusC Nov 24 '11 at 17:48
  • Seems useful , one more query please , assume that the war is placed inside the tomcat ?? Would this ServletContextListener class would be automatically called up when the server is started ?? – Revathi Nov 24 '11 at 17:53
  • That's also answered in the given links. Just register it in `web.xml`. – BalusC Nov 24 '11 at 17:54