It's not a secret anymore!
The moose likes Struts and the fly likes Ajax Problem / Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Ajax Problem / Struts " Watch "Ajax Problem / Struts " New topic

Ajax Problem / Struts

RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi all,
I am using platform: Struts 1.2.9, JDK 1.4, Tomcat 5.0.30

Basic Problem:
A JSP has a row which contains different elements (Textbox, combo box, checkbox, etc). A button is given to provide the �Add Row� functionality. It creates a dynamic row that is a replica of the same row.

There is a triple-combo-box (third based on second and second based on first) in the row. Currently I am using JS to populate but the second dynamic row gives a problem and the values are not populated in the desired manner.

I plan to use Ajax for the same.

SampleCodeProblem:I made a sample code for which i have this problem.
Generally most the available examples use �id� <input type=�text� .. id=��>. The tags for Struts do not support id. <html:text name=�� >. Span tag may be use for differentiating Ajax returns.

When I use Span tag and I use:

<html:text name=�abc� property=�xyz�>

The tomcat server gives an error for the bean not found, whereas the bean exists and the proper getXXX() and setXXX() are there in the Form class. The example in question is not giving any problem when I want to display any text/image etc. It works fine. When ever I put any tag inside <span> which requires a user input it throws an exception.

Kindly help me solve the problem.

Regards,<br />Roshani
Anay Nayak

Joined: Aug 15, 2006
Posts: 26
Actually struts does support the id attribute. It has been named "styleId".

Check for more details.

I hope the span is within the html:form tag and not outside.
[ September 04, 2006: Message edited by: Anay Nayak ]
I agree. Here's the link:
subject: Ajax Problem / Struts
jQuery in Action, 3rd edition