aspose file tools*
The moose likes Struts and the fly likes can somebody take a look at my  struts--config file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "can somebody take a look at my  struts--config file?" Watch "can somebody take a look at my  struts--config file?" New topic
Author

can somebody take a look at my struts--config file?

kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Hi All:

I posted earlier, here is my original code




and i got javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN

basically , i figured out that it is the <html:select> tags that are giving me problems, and in his reply to my post, Marc Peabody said that error means that the ActionForm being referenced (in this case it defaults to the ActionForm defined in your struts-config ActionMapping because the name attribute was not specified) cannot be found."


here is a section from my struts-config.xml

I do have a "name " attribute though...can somebody please tell me what went wrong?

Many Thanks...
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

This is a one-in-a-million shot, but make sure your starting html:form is not being terminated with a slash like:
<html:form action="inquiry"/>
...
</html:form>

This is probably one of the most frustrating things to debug.

btw - the input attribute is not necessary when validate is false although it's probably not hurting anything either.
[ May 22, 2004: Message edited by: Marc Peabody ]

A good workman is known by his tools.
kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Originally posted by Marc Peabody:
[QB]This is a one-in-a-million shot, but make sure your starting html:form is not being terminated with a slash like:
<html:form action="inquiry"/>
...
</html:form>

This is probably one of the most frustrating things to debug.



Hi:
Just a question,DO I HAVE TO HAVE A <html:form> tags

you mean I should inclose the <html:form> outside of my <html:select>?

like the following?


I thought I just need to have the <html:select> before. Please let me know

Many thanks
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
From the Struts documentation for the html:select tag:

Renders an HTML <select> element, associated with a bean property specified by our attributes. This tag is only valid when nested inside a form tag body.

See full documentation here.
[ May 22, 2004: Message edited by: Chris Mathews ]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Just a question,DO I HAVE TO HAVE A <html:form> tags


It's usually a good idea.

You MIGHT be able to get around it by:
1) Use regular html form tags <form action="context/myAction.do"> (This assumes you want to actually SUBMIT your form. You might be able to leave this out if your drop-down box was for display purposes only.)
2) define the name attribute in the html:select tag to point to a bean with the corresponding property, otherwise it will look for one in the html:form as the default... which does not exist

Warning: Do not try this at home! I accept no responsibility for any ulcers developed in the process of following the above procedure.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can somebody take a look at my struts--config file?