Wrox Programmer Forums
|
BOOK: Professional Jakarta Struts
This is the forum to discuss the Wrox book Professional Jakarta Struts by James Goodwill, Richard Hightower; ISBN: 9780764544378
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Jakarta Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2009, 10:30 AM
Registered User
 
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default <html:errors /> tag doubt

I have two confusions in the <html:errors> tag-
In chapter 10 of the book professional Jakarta Struts 1.1, Listing 10.2 index.jsp, I think <html:errors> tag is incomplete.
I tried to run like this in my own application but it did'nt work.
Code:
<@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<html>
<head>
   <title> struts application </title>
</head>
<body>
<table width="500" border="0" >
<tr>
  <td>%nbsp;</td>
</tr>
<tr bgcolor="#36566E">
   <td height="68" width="48%">
    <div align="center">
      <img src="images/hp_logo_worx.gif">
   </div>
  </td>
</tr>
<tr>
<td>%nbsp;</td>
</tr>
</table>

<html:errors/>-------------------------------(1, property not specified)

<html:form action="Lookup">
  <table width=45%" border="0" >
  <tr>
  <td><bean:message key="app.symbol" /></td>
   <td><html:text property="symbol"/></td>-------------(2)
  </tr>
 <tr>
 <td><html:submit/></td>
 </tr>
 </table>
</html:form>
</body>
</html>
what i know is when we write the <html:error> tag we mention the property name also:
<html:error property="symbol1"/>.-------------------------(3)

The reason this is required is when we make the ActionErrors object, we code like this:
ActionErrors err=new ActionErrors();
err.add("symbol1,new ActionError("keyname"));-----------(4)

So the "symbol1" in the add method is the value specified in the property at (3). So if we won't specify the property attribute then how will the <html:errors> will know about the error it refers to.

Secondly,In the book at page 169 below listing 10.3 its written that the "symbol1" at 4 is the value of the property of the <html:text> tag at (2).
But I have read that this "symbol1" at (4) corresponds to the value of the property at (3). I dont know what is correct. Plz help me in understanding the true concept.
 
Old October 13th, 2009, 06:51 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

You dont need to mentioned the property for <html:errors/> tag, it just lists all form errors, its not for single error!
__________________
- Rakesh
http://iam-rakesh.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
doubt in using <xsl:template> rajatake XSLT 5 December 15th, 2006 08:09 AM
How to dynamically insert <META> tag in .HTML? Abdul Hameed Javascript 1 August 11th, 2004 10:03 AM
how to dynamically insert <META> tag in .html Abdul Hameed XSLT 1 August 10th, 2004 03:58 AM
Can't get errors to display with <html:errors> michaeldill JSP Basics 0 August 2nd, 2004 01:47 PM
Dynamic HTML <<Events>> babloo81 Javascript 2 December 29th, 2003 12:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.