JSP and JSTL Tutorials - Tutorial Addendum - Bobcat 4.1.18 with JDK 1.4.1

arcadegamesios strategygamesios adventuregamesios
 31 December 18:00   

    



    



    



    

This affiliate explains:

    



        

  • How to change Bobcat 4.1.18 accession from using JDK 1.3.1 to using JDK 1.4.1.

        



  •     

  • Compilation issues of using JavaBean classes in bearding packages.

        



  •     

  • How to make JavaBean classes in called packages.

        



  •     



    



    



    

Upgrading Bobcat 4.1.18 to JDK 1.4.1

    



    

One of the readers appear a JSP accumulation affair while afterward my tutorials

    

with Bobcat 4.1.29 and JDK 1.4.x. In adjustment to accept the affair better, I upgraded

    

my Bobcat 4.1.18 accession from JDK 1.3.1 to JDK 1.4.1:

    



    

1. Arrested my JDK 1.4.1 installation. The afterward command shows that I accept JDK 1.4.1_01

    

working correctly:

    

 

    

>localj2sdk1.4.1injava -version

    

java adaptation "1.4.1_01"

    

Java(TM) 2 Runtime Environment, Accepted Copy (build 1.4.1_01-b01)

    

Java HotSpot(TM) Applicant VM (build 1.4.1_01-b01, alloyed mode)

    



    



    

2. Started Bobcat server with JDK 1.4.1 after any problem:

    

 

    

cd localjakarta-tomcat-4.1.18in

    

set JAVA_HOME=localj2sdk1.4.1

    

startup

    



    



    

3. Created the afterward JSP page, hello.jsp, and affected to localjakarta-tomcat-4.1.18webappsROOT:

    

 

    

<html><body>

    

<% out.println("Hello world!"); %>

    

</body></html>

    



    



    

4. Ran Internet Explorer (IE) with url: http://localhost:8080/hello.jsp.

    

You should see "Hello world!" in the IE window.

    



    

I am appealing abiding now my Bobcat server is active ok with JDK 1.4.1.

    



    

Compilation Errors with Bobcat 4.1.18 and JDK 1.4.1

    



    

To authenticate the accumulation error, run IE on the afterward JSP page I created in the

    

"Using JavaBean Classes" chapter, UseBean.jsp

    

 

    

<?xml version="1.0"?>

    

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">

    

<!-- UseBean.jsp

    

Absorb (c) 2002 by Dr. Yang

    

-->

    

<html><body>

    

<jsp:directive.page import="CacheBean"/>

    

<jsp:useBean id="b">

    

<jsp:setProperty name="b" property="text" value="Hello world!"/>

    

Property from my Bean:

    

<jsp:getProperty name="b" property="text"/>

    

<br/>

    

Info from my Bean:

    

<jsp:expression>b.getInfo()</jsp:expression>

    

</body></html>

    

</jsp:root>

    



    



    

You will see a accumulation absurdity in the IE window:

    

 

    

org.apache.jasper.JasperException: Clumsy to abridge chic for JSP

    

An absurdity occurred at line: 8 in the jsp file: /UseBean.jsp

    

Generated servlet error:

    

[javac] Accumulation 1 antecedent file

    

C:localjakarta-tomcat-4.1.18workStandalonelocalhost

    

\_UseBean_jsp.java:7: . expected

    

import CacheBean;

    



    



    

This tells us that JDK 1.4.1 does not acquiesce acceptation account to be acclimated on classes

    

in bearding packages. So what can we do about this? Can we abolish the acceptation statement?

    

The acknowledgment is no. You can try by active the afterward adapted JSP page, UseBeanModified.jsp:

    

 

    

<?xml version="1.0"?>

    

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">

    

<!-- UseBeanModified.jsp

    

Absorb (c) 2002 by Dr. Yang

    

-->

    

<html><body>

    

<jsp:useBean id="b">

    

<jsp:setProperty name="b" property="text" value="Hello world!"/>

    

Property from my Bean:

    

<jsp:getProperty name="b" property="text"/>

    

<br/>

    

Info from my Bean:

    

<jsp:expression>b.getInfo()</jsp:expression>

    

</body></html>

    

</jsp:root>

    



    

(Continued on next part...)

    



    

 


Tags: world, classes, property, value, notes, tutorial, tutorials

 tomcat, property, usebean, version, following, compilation, expression, error, world, installation, packages, import, tutorials, classes, javabean, localjakarta, , < jsp, < body, < html, html <, jsp page, jsp root, bean <, jsp expression, property text, javabean classes, jsp and, localjakarta tomcat, text value hello, property text value, value hello world, world property from, jsp getproperty name, jsp setproperty name, jsp page version, tutorials tutorial notes, tutorial notes tomcat, jsp root xmlns, jsp http java, jstl tutorials tutorial,

Share JSP and JSTL Tutorials - Tutorial Addendum - Bobcat 4.1.18 with JDK 1.4.1:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  jsp