Re: bean:include and request attributes

2002-07-01 Thread Pawel Rzepa

Barbara Post wrote:

 did you redeclare the taglibs at the beginning at the included jsp ? it is
 necessary.

I know, I did it. I've put this scriplet into main jsp file and the included one:

%
 for(java.util.Enumeration enum=request.getAttributeNames();
enum.hasMoreElements();)
{ %
request attribute: %= (String) enum.nextElement() %
%
}
% (Don't pay attention to typing mistakes - it worked)

The main file found attributes, included one didn't any.

 well, jsp:useBean does work, why would bean:include bug ? :-)

Not jsp:useBean, but jsp:include - I suppose it was just your mistake.
Regarding to your question - why jsp:include works and bean:include doesn't? I'd
really love to know... :-)

Best regards,
  Paul



 Babs
 - Original Message -
 From: Pawel Rzepa [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, June 28, 2002 4:23 PM
 Subject: bean:include and request attributes

  Hi everyone!
   Does bean:include forwards request attributes to the included page? I
  have registered a bean as a request attribute and I can touch it from
  main page but not from the included one. I put some Java code into both
  pages that lists request attributes names and while inside the main page
  all the attributes are visible inside the included one they aren't
  (request.getAttributeNames() is empty). Is it expected behaviour?
 
  What's more jsp:include ... works properly...
  Configuration: Struts 1.0/Tomcat 4.0.3/Solaris 8
 
  Regards,
Pawel
  --
  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]

--
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]




Re: Problem with logic:equal and bean:define

2002-04-11 Thread Pawel Rzepa

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]