At 03:33 AM 4/10/2001, you wrote:
I want to display the size of an Collection attribute of a Bean using
Struts taglibs. I can use scriptlet but are there any other ways to do that?
Regards,
Thai
Based on a response from [EMAIL PROTECTED] to a bug I filed, it
appears you can use the bean:size
Just specify the property attribute of the html:errors tag. So, for
example, in your validate function you might have something like:
errors.add("roles", new
ActionError("error.reqaccess.role.invalid"));
to indicate an error in the "roles" field. Using:
html:errors
Am I the only one who finds it odd that while both logic:iterate and
html:options take a "collection" attribute, one expects a run-time
expression that evaluates to a Collection and the other takes a String that
names a bean in some scope that is a Collection?
Shouldn't these two tags play
I resolved this by creating two pieces:
First is a class in your business logic package that manages the context
required by the business logic beans. This class should be a Singleton and
should manage access to resources needed by your business logic beans such
as configuration parameters
What strategies or patterns do people use to manage persistence of business
object data in a Struts application when there is no EJB layer and there is
a desire to keep the business objects as independent of the web portion of
the application as possible? Do you use the Struts DataSource and
Here is what I do in a similar situation:
html:link paramId="role" paramName="role"
page='%="/user/saveUser.do?action=Removeorg.apache.struts.taglib.html.TOKEN="
+
session.getAttribute("org.apache.struts.action.TOKEN")%'
Removenbsp;Role /html:link
It's ugly, but it works
I can't speak about the address bar (different browsers probably behave
differently), but if you aren't seeing it in the generated source then
there is a problem. To confirm, you don't see the
org.apache.struts.taglib.html.TOKEN=4bb7c9e6084fbf88acc2aa976ea9e3
string in your
Is this really true? I have an Action that doesn't define an input
attribute, but does specify a request scope ActionForm. According to the
log messages, Struts creates an instance of the form and stores it under
the appropriate key before calling my Action.perform() method. In
addition,
The way this is typically handled is to use an Action to populate the
bean. So instead of linking your user directly to the JSP page, you link
them to an Action. This Action typically loads the bean and then returns
the success mapping, which, in struts-config.xml, you've mapped to the JSP
No, this doesn't work in Tomcat 3.2.1 either (at least, not in all
cases). Here's my situation:
Normally, I am behind a firewall that prevents direct connection to the
Internet. I can't even resolve external domain names. Now when I start up
Tomcat with the struts-example deployed (using
10 matches
Mail list logo