Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
232
Chapter 10 JSP Scripting Elements
could put a normal Web page: no compiling, no packages, and no user
CLASSPATH
 settings. However, although your personal environment doesn't
need any special settings, the server still has to be set up with access to the
servlet and JSP class files and the Java compiler. For details, see your server's
documentation or Section 1.5 (Installation and Setup). 
Although what you write often looks more like a regular HTML file than a
servlet, behind the scenes, the JSP page is automatically converted to a nor 
mal servlet, with the static HTML simply being printed to the output stream
associated with the servlet's 
service
 method. This translation is normally
done the first time the page is requested. To ensure that the first real user
doesn't get a momentary delay when the JSP page is translated into a servlet
and compiled, developers can simply request the page themselves after first
installing it. Many Web servers also let you define aliases so that a URL that
appears to reference an HTML file really points to a servlet or JSP page. 
Depending on how your server is set up, you can even look at the source
code for servlets generated from your JSP pages. With Tomcat 3.0, you need to
change the 
isWorkDirPersistent
 attribute from 
false
 to 
true
 in
install_dir/server.xml
. After that, the code can be found in
install_dir/work/port number
. With the JSWDK 1.0.1, you need to
change the 
workDirIsPersistent
 attribute from 
false
 to 
true
 in
install_dir/webserver.xml
. After that, the code can be found in
install_dir/work/%3Aport number%2F
. With the Java Web Server, 2.0 the
default setting is to save source code for automatically generated servlets. They
can be found in 
install_dir/tmpdir/default/pagecompile/jsp/_JSP
.
One warning about the automatic translation process is in order. If you
make an error in the dynamic portion of your JSP page, the system may not
be able to properly translate it into a servlet. If your page has such a fatal
translation time error, the server will present an HTML error page describ 
ing the problem to the client. Internet Explorer 5, however, typically replaces
server generated error messages with a canned page that it considers friend 
lier. You will need to turn off this  feature  when debugging JSP pages. To do
so with Internet Explorer 5, go to the Tools menu, select Internet Options,
choose the Advanced tab, and make sure  Show friendly HTTP error mes 
sages  box is not checked.
Core Warning
When debugging JSP pages, be sure to turn off Internet Explorer's 
 friendly  HTTP error messages.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved