Rath, Dipak wrote:
> I'm new to the world of JSP/Servlet. I'm about to be a part
> of a project and we intend to use jsp and servlet. We ordered
> Visual Cafe (expert edition) and realized that it does not
> support jsp and servlet development. I would like to know if
> some of you use visual cafe for jsp/servlet development and
> how do you go about it.
We are using Visual Cafe Expert Edition for JSP & servlet development.
Although it doesn't directly support JSP & servlet development, you can
still use it to debug servlets (including compiled JSPs). It was a pain in
the butt to get Visual Cafe configured to support this, but it works nicely
once that is done.
At the bottom of this message, I've included instructions on how to
configure Visual Cafe to debug servlets under JRun. I haven't done this for
any other servlet engines, but it should work similarly.
Of course, you could always upgrade to the Enterprise Edition of Visual Cafe
-- it has built-in support for servlet development & deployment. However,
it lists for $2800 versus $800 for the Expert Edition!
> Also I would like to know what are few good books on jsp?
Core Servlets and JavaServer Pages
Marty Hall
Sun Microsystems Press
ISBN 0-13-089340-4
Professional Java Server Programming
Wrox Press
ISBN 1-861002-77-7
----------------------------------------------------------
How to configure Visual Café 4 Expert Edition
to run the JRun 2.3.3 servlet engine
I have successfully configured Visual Café 4 Expert Edition to run the JRun
engine (version 2.3.3 build 157). Below are the details of what I did to
get this working. The instructions are long, but it's really not that
difficult, and it's great to be able to debug your servlets and even JSPs.
Please let me know if you have any questions.
Note: Whenever you see "..." in a pathname, you'll need to put in the
appropriate path to the installed product (Visual Café or JRun) on your
machine. For instance, on my machine, I installed Visual Café and JRun in
E:\, so I replace "..." with "E:\".
1. Replace Visual Café's version of jsdk.jar with a version that supports
JSP 1.0 / Servlet 2.1. This is necessary because the jsdk.jar that comes
with Visual Café only supports JSP 0.92 / Servlet 2.0. To do this, you'll
first need to get Sun's Java Servlet Development Kit 1.0.1 (JSWDK1.0.1).
Then, you must combine the servlet.jar file from JSWDK1.0.1 with the
original jsdk.jar file from Visual Café. Note that the classes in
servlet.jar should override any duplicates in the original version of
jsdk.jar. You'll need to use the Java "jar" utility to do this.
The jsdk.jar file is located in:
...\VisualCafé\Java\lib\jsdk.jar
2. Modified the classpath used by Visual Café's JVM's to include everything
from the classpath used by the JRun engine. This is necessary so that
Visual Café can find all of the classes used by the JRun engine. The JRun
classpath that I added can be found in the "java.classpath" property in the
following JRun property file:
...\JRun\jsm-default\properties\jsm.properties
On my machine, the JRun classpath starts with the directory
"E:/JRun/classes" and contains 20+ paths. Note that you must convert all of
the directory paths to use single back slashes ("\") instead of single
forward slashes ("/") or escaped back slashes ("\\"). For example, the
directory path "e:/jrun/classes" must be changed to "e:\jrun\classes". This
is necessary for Visual Café to work properly.
This JRun classpath must be added to two classpaths in Visual Café:
"Classpath for the VM" and "Classpath for the Compiler". Both of those can
be set under "Tools->Options->Virtual Machines". I prepended the JRun
classpath to the existing ones in Visual Café. You'll need to restart
Visual Café after you do this for the changes to take effect.
3. In order for JSP pages to compile properly when running JRun in Visual
Café, you'll need to modify the "compiler" property in the jsp.properties
property file to contain an absolute path instead of a relative one. Note
that this file exists in two places, depending upon whether you are running
the JRun engine with the JRun web server or with any other web server (e.g.,
Apache, IIS, NES, etc.). For safety, change the value in both copies:
...\JRun\jsm-default\services\jse\properties\jsp.properties
...\JRun\jsm-default\services\jseweb\properties\jsp.properties
The original value for the "compiler" property will probably start with
"..\\bin\\jikesw.exe". That needs to be changed to something like
"E:\\JRun\\bin\\jikesw.exe".
This step is necessary because the JRun engine expects to be started up with
the current directory set to ...\JRun\jsm-default. However, Visual Café
runs programs with the current directory set to wherever your Visual Café
project file is located. I haven't found a way to tell Visual Café how to
run programs in a different directory.
4. Configure your project in Visual Café to run the appropriate JRun class
when debugging. This is done by setting your project options in Visual Café
as follows:
· Select "Project->Options"
· Select the "Project" tab.
· Set the Project Type to Application
· Set the Main Class to com.livesoftware.jrun.service.ServiceManager
· Set the Program Arguments to E:\JRun\jsm-default (assuming that JRun is
installed in "E:\").
That's it. Now, when you select "Project->Run in Debugger" in Visual Café,
it will start up the JRun engine. You can set breakpoints in your servlets
and any other Java classes just like a non-servlet Java application.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets