2

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,194
  • 8
  • 60
  • 80
Revathi
  • 1,173
  • 8
  • 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,040,783
  • 362
  • 3,548
  • 3,513
  • 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