Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > BOOK: Professional Jakarta Struts
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 7th, 2009, 11: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.
  #2 (permalink)  
Old October 13th, 2009, 07:51 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 11:03 AM
how to dynamically insert <META> tag in .html Abdul Hameed XSLT 1 August 10th, 2004 04:58 AM
Can't get errors to display with <html:errors> michaeldill JSP Basics 0 August 2nd, 2004 02:47 PM
Dynamic HTML <<Events>> babloo81 Javascript 2 December 29th, 2003 12:40 PM



All times are GMT -4. The time now is 05:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.