Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes How to compile JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to compile JSP?" Watch "How to compile JSP?" New topic
Author

How to compile JSP?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello JSP experts,
I am a novice in using JSP.I use tomcat 3.1 for the same.
How to compile jsp file ,what i mean exactly is how do we know simple Java & related errors without actually having to invoke the jsp page thru the browser. I know that if there is any error the same can be viewed on the browser screen when the JSP is invoked.But is there a way where in atleast the translation time errors are done away with before viewing in the browser.
Thanx in advance,
Regards
Brett Knapik
Ranch Hand

Joined: Oct 15, 2000
Posts: 255
As far as I know you can only compile a jsp page when it is invokled by the browser
------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
There is no "standard" way to do this. It depends on which servlet container you are using. I know that Resin has a way of doing this, and I guess thatn Tomcat does too. Please check out the web site or mailing list of the container you are using.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
Tomcat does it???/
Please tell me how
Cherry
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Tomcat's JSP compiler is named "org.apache.jasper.JspC". Check out the jspc.bat or jspc.sh scripts in the tomcat bin directory.


Customer surveys are for companies who didn't pay proper attention to begin with.
Venugopal nandikolla
Greenhorn

Joined: Feb 02, 2001
Posts: 22
Hi,
I have tried it long time ago.It'll work ,try using the command below.You must specify the uriroot (The root directory of your input files -- jsp's).The -webxml creates web.xml(but you must use -webapp as show below).The c.jsp is my only jsp in the c:\.Hope this will help you.
jspc -uriroot c:\ -webxml c:\web.xml -webapp c:\ c.jsp

Venu

Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
Thank u all for the responses
Venugopal,
I did try the jspc but it gives me exception IllegalArgumentException. Unknown object java.util.Hashtable etc.
please explain in detail the options of jspc. and till which directory i got to give
regards
Cherry
 
Don't get me started about those stupid light bulbs.
 
subject: How to compile JSP?