JSP - 12

 
Web Hosting
EziHosting provides fast, reliable web hosting solutions in Australia for both business and web developers.
Check it out what we have to offer...
 
Add Your Link
You can add your web site's link to the EziDirectory.
This will increase your site's traffic and link popularity!
Learn more...

 
Domain Names

Web Design
We specialise in Australian Web Design.
The EziHosting team can design your web site in days.
Contact us today for a free consultation and quote.

EziHosting is proud to be a corporate World Vision Sponsor - find out more...

Find out more about your secure certificate here.
Security and privacy issues
Earn 50¢
per click!
Become an
affiliate!

  Do you need
Technical Support?

Home

WEB HOSTING
Web Hosting Australia

F.A.Q.

EziSupport

Control Panel

Dedicated Servers

Special

 

DOMAIN NAMES
Australian Domain Names

TLDs

Int. Domains

Policy Stuff

 

DIRECTORY
Listing

Add your Site

 

MISCELLANEOUS
Web Design

Search Engine Optimisation.

Free Site Analysis

Toos & Tutorials

2 Free Carts!

EziMerchant

Secure Certificates

 

CONTACT US
Contact Details

E-Mail Us

 

Techniques for form editing

A tag library such as the one that comes with the Blazix server, may not be available in your environment. How can you allow similar features without using a tag library?

It is a little tedious, but it can be done. Basically, you must edit each HTML tag yourself, and put in a default value. The following examples shows how we modify GetName.jsp to provide features similar to blx:getProperty but with manual HTML tag editing:

<jsp:useBean id="user" class="UserData" scope="session"/>
<HTML>
<BODY>
<FORM METHOD=POST ACTION="SaveName.jsp">
What's your name? <INPUT TYPE=TEXT NAME=username
SIZE=20 VALUE="<%= user.getUsername() %>"><BR>
What's your e-mail address? <INPUT TYPE=TEXT
NAME=email SIZE=20
VALUE="<%= user.getEmail() %>"><BR>
What's your age? <INPUT TYPE=TEXT NAME=age
SIZE=4 VALUE=<%= user.getAge() %>>
<P><INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>

As you can see, this simply involves adding a "VALUE" field in the INPUT tags, and initializing the field with an expression!
To handle exceptions during input processing, a simple approach is to use "String" fields in the bean, and do the conversion to the target datatype yourself. This will allow you to handle exceptions.

Exercise:
Modify the earlier example to do everything without the Blazix tag library (you can restrict this to only one field.)

 

Next Tutorial: Adding a log-in feature to your pages

 

 

 

Web Hosting Australia Monthly Special


At EziHosting, the Australian Web Hosting company,
we strive to become your internet technology partner
for the long run...

© 2003 EziHosting Australian Web Hosting - All Rights Reserved