File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to execute a JSP file from command line? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to execute a JSP file from command line?" Watch "How to execute a JSP file from command line?" New topic

How to execute a JSP file from command line?

Kavita Ghia
Ranch Hand

Joined: Oct 10, 2000
Posts: 91
Hello friends,
Is there a way to execute a JSP from the comandline or from my own application?

Ranch Hand

Joined: Oct 20, 2000
Posts: 68
You cannot execute JSP through command line. JSP needs a servlet engine to conver it in to servlet code and run. JSP is meant for web applications, not for stand alone applications
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
If your JSP is already running in a servlet container, you can always contact it using Java's built-in networking and request some output. Or are you looking for a way to run a JSP without a servlet container?

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
pooranan balasubramanian

Joined: Sep 22, 2003
Posts: 1
I want to know how to execute a JSP page within a container without issuing a call from a browser or another Java program. Basically i need to execute some tags from a taglibrary(OScache).
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
You could try poking at some of the unit testing frameworks - Cactus, etc. That's a horrible hack to get to the tags, but could be theoretically done.
deepak kukreja
Ranch Hand

Joined: Aug 13, 2001
Posts: 54
what option you do have is to compile ur jsp page without executing it.
But for compiling too u have to use browser.
u can use jsp_precompile parameter for that.

Deepak<br />SCJP
I agree. Here's the link:
subject: How to execute a JSP file from command line?
It's not a secret anymore!