Hi Wendy,

Thanks for responding!  Someone showed me a way to do what I needed to do,
but the way I'm approaching the entire problem may be kludged:

The user can click

Search Attributes | Search Components | Search Templates

I've provided html:link's like these respectively:

doPrepareSearch.do?searchType=attribute |
doPrepareSearch.do?searchType=component |
doPrepareSearch.do?searchType=template

so when they user lands on my form, I want to prepopulate the search type
based on what they chose.  If they submit a search with bad data, then I'd
want the SearchForm's (extends ActionForm) validate() method to send the
back to the search form, this time keeping their most recent entries to the
form field -- if they changed search type for example now it would be
different.  

I am new to Struts and may not be getting a key concept of it's Best
Practices usage.  Does it make sense what I've described?  Thanks again!,

Jim


-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 2:03 PM
To: Struts Users Mailing List
Subject: RE: newbie html-el question


From: Bender, James [mailto:[EMAIL PROTECTED] 
> I am trying to display a value from a requestAttribute in 
an <html-el:text
> ...> but I can't get it to work.  Here is my code:
> <html-el:text: property="searchType"
> value="<%=request.getAttribute("searchType")%>"/>
> 
> I recieve the error:
> "Attribute searchType has no value"
> Someone told me I have to do something more like this:
> <html-el:text property="searchType" value="${searchType}"/>
> 
> but where would I define the variable searchType that is 
> accessed there?

You wouldn't, you'd set the property of the Form bean and let Struts
handle it.  

If you need to pre-populate the form, you do that in the Action by
calling setSearchType() on your Form bean.  Then when you forward to the
JSP, Struts will fill in the value.

Can you explain more about your situation?  I'm making some assumptions
that may not be correct.

In general there's no need to touch the 'value' attribute of the tags
that render HTML form elements.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail transmission contains information that is confidential and may be 
privileged.   It is intended only for the addressee(s) named above. If you receive 
this e-mail in error, please do not read, copy or disseminate it in any manner. If you 
are not the intended recipient, any disclosure, copying, distribution or use of the 
contents of this information is prohibited. Please reply to the message immediately by 
informing the sender that the message was misdirected. After replying, please erase it 
from your computer system. Your assistance in correcting this error is appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to