Re: Re: Problem with logic:equal and bean:define

2002-04-11 Thread stephen.chambers

Pawel,

I appreciate the suggestion, but I couldn't get it to work somehow. It keeps coming 
back with compile errors that java.lang.String is already defined. I put exactly the 
same bean:define tag, albeit with a different value outside and above the logic:equal 
tag.

Which struts are you using 1.0.2 or 1.1 b1?

Stephen

From: Pawel Rzepa [EMAIL PROTECTED]
Date: 2002/04/11 Thu AM 02:38:45 CDT
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Problem with logic:equal and bean:define

Hi Stephen,
  If you are interested in why it is happening look at the .java file that is
created by jsp compiler. I've spent some time doing it but eventually I had given
up because there were too many lines of code to analyze. Nevertheless I'm sure
there is an important reason :-).
Despite I don't know why it is happening, I know how to solve the problem and
that is why I'm replying to your email. What you have to do is to define a bean
with the same name outside of any logic:... tag. When you repeat bean:define
... inside logic:.. tag bean's value just changes. And that is all. You can
then use bean as you want.
What you must remember is to keep the same classname of the bean in each
bean:define ... statement. When you use value attribute it is done
automatically, assuming that the classname is java.lang.String. If you use
another attribute (name, property and so on) don't forget to add type attribute
as well.

Regards,
  Pawel

stephen.chambers wrote:

  All,

  When I use the bean:define tag inside a logic:equal, why doesn't the
 scriptinh variable created stay in scope outside of the logic tags? What am
 I doing wrong?

  Code snippet below:

  logic:equal name=myattribute value=5
bean:define id=myvar value=50/
  /logic:equal

  Once outside of the logic tags, even out.print(myvar); results in null.

  Thanks, Steve

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

--
Pawel Rzepa   Department of Computer Science
[EMAIL PROTECTED]   University of Mining and Metallurgy (AGH)
tel: +48 (12) 617 39 82  fax: +48 (12) 617 39 66



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





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




Problem with logic:equal and bean:define

2002-04-06 Thread stephen.chambers

 All,

 When I use the bean:define tag inside a logic:equal, why doesn't the
scriptinh variable created stay in scope outside of the logic tags? What am
I doing wrong?

 Code snippet below:

 logic:equal name=myattribute value=5
   bean:define id=myvar value=50/
 /logic:equal

 Once outside of the logic tags, even out.print(myvar); results in null.

 Thanks, Steve


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




Big problem with tomcat's security manager and dataSource in the struts_config.xml file

2002-04-01 Thread stephen.chambers



 All,

 I have been migrating a smaller Tomcat/MySQL application to Struts and
have
 run into a problem.

 I have completely converted the app to Struts and hit a snag when I
inserted
 the DataSource tag into the struts-config.xml. It began to generate
Cannot
 find ActionMappings errors in the html and in the logs it could not find
 the database, asking Is there a MySQL database running on this server?

 My Tomcat 4.0 (on RH 7.1) is running with security and I added these lines
 to the conf/catalina.policy file, each on as nothing else seemed to work:

 grant CodeBase file:${catalina.home}/webapps/myapp/- {
 permission java.security.AllPermission;
 };
 grant CodeBase file:${catalina.home}/webapps/myapp/WEB-INF/classes/- {
 permission java.security.AllPermission;
 };
 grant CodeBase file:${catalina.home}/webapps/myapp/WEB-INF/lib- {
 permission java.security.AllPermission;
 };
 grant CodeBase

file:${catalina.home}/webapps/myapp/WEb-INF/lib/mm.mysql-2.0.11-bin.jar!/-
 {
 permission java.security.AllPermission;
 };

 None of these worked either. When I commented out the datasource tag
 everything except the database started working and then when I commented
it
 back in, nothing. I finally turned off the security manager and everything
 including the database works now, with the datasource tag in the
 struts-config.xml in there as it should be. Has anyone else had this
 problem? In the local user's group, someone else had the same problem on a
 WIN2K box with MySQL (and a different version of the mm.mysql.driver as
 well) and they still haven't solved it either.

 The appropriate section of the struts-config.xml looks like the following:
 data-sources
 data-source
 autoCommit=false
 autoReconnect=true
 description=Data Source
 driverClass=org.gjt.mm.mysql.Driver
 maxCount=4
 minCount=2
 password=whatever
 url=jdbc:mysql://myserver:3306/4po
 user=servlet
 /
 /data-sources

 What is the conflict with the security manager or am I messing something
up
 myself?

 Steve



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




Problem with Tomcat's security manager and DataSource in struts-config.xml

2002-03-29 Thread stephen.chambers

All,

I have been migrating a smaller Tomcat/MySQL application to Struts and have run into a 
problem.

I have completely converted the app to Struts and hit a snag when I inserted the 
DataSource tag into the struts-config.xml. It began to generate Cannot fond 
ActionMappings errors in the html and in the logs could not find the database, asking 
Is there a MySQL database running on this server?

My Tomcat 4.0 (on RH 7.1) is running with security and I added these lines to the 
conf/catalina.policy file, each on as nothing else seemed to work:

grant CodeBase file:${catalina.home}/webapps/myapp/- {
permission java.security.AllPermission;
};
grant CodeBase file:${catalina.home}/webapps/myapp/- {
permission java.security.AllPermission;
};


Problem with tomcat's security manager and dataSource in the struts_config.xml file

2002-03-29 Thread stephen.chambers

All,

I have been migrating a smaller Tomcat/MySQL application to Struts and have
run into a problem.

I have completely converted the app to Struts and hit a snag when I inserted
the DataSource tag into the struts-config.xml. It began to generate Cannot
find ActionMappings errors in the html and in the logs it could not find
the database, asking Is there a MySQL database running on this server?

My Tomcat 4.0 (on RH 7.1) is running with security and I added these lines
to the conf/catalina.policy file, each on as nothing else seemed to work:

grant CodeBase file:${catalina.home}/webapps/myapp/- {
permission java.security.AllPermission;
};
grant CodeBase file:${catalina.home}/webapps/myapp/WEB-INF/classes/- {
permission java.security.AllPermission;
};
grant CodeBase file:${catalina.home}/webapps/myapp/WEB-INF/lib- {
permission java.security.AllPermission;
};
grant CodeBase
file:${catalina.home}/webapps/myapp/WEb-INF/lib/mm.mysql-2.0.11-bin.jar!/-
{
permission java.security.AllPermission;
};

None of these worked either. When I commented out the datasource tag
everything except the database started working and then when I commented it
back in, nothing. I finally turned off the security manager and everything
including the database works now, with the datasource tag in the
struts-config.xml in there as it should be. Has anyone else had this
problem? In the local user's group, someone else had the same problem on a
WIN2K box with MySQL (and a different version of the mm.mysql.driver as
well) and they still haven't solved it either.

The appropriate section of the struts-config.xml looks like the following:
data-sources
data-source
autoCommit=false
autoReconnect=true
description=Data Source
driverClass=org.gjt.mm.mysql.Driver
maxCount=4
minCount=2
password=whatever
url=jdbc:mysql://myserver:3306/4po
user=servlet
/
/data-sources

What is the conflict with the security manager or am I messing something up
myself?

Steve


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