You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Deadman, Hal" <ha...@tallan.com> on 2001/02/10 01:12:21 UTC

bean-cookie.jsp

The struts documentation says this in
.../struts-documentation/api/org/apache/struts/taglib/bean/package-summary.h
tml

You must use <jsp:useBean> to introduce a reference to an existing bean, if
you wish to reference that bean with other standard JSP tags (such as
<jsp:getProperty> or <jsp:setProperty>). If you only wish to reference such
beans with other Struts tags, use of <jsp:useBean> is not required.

The bean-cookie.jsp page in the struts-test application uses
<jsp:getProperty> but does not first use jsp:useBean. This makes Weblogic
6.0 very angry and it fails to generated any java code let alone compile the
jsp. 

The jsp 1.1 spec implies that the jsp:useBean tag does not need to be used
before using jsp:getProperty.

Re: bean-cookie.jsp

Posted by Matthias Kerkhoff <ma...@BESToffers.de>.
Hello Hal,

> The jsp 1.1 spec implies that the jsp:useBean tag does not need to be used
> before using jsp:getProperty.

That's correct. The 1.1 errata and the 1.2 spec make this even more explicit.

> Either the struts documentation should be changed to be less emphatic about
> the use of jsp:useBean or the bean-cookie.jsp should be changed to be nice
> to Weblogic. It could use bean:write only and not use jsp:getProperty. I
> have always assumed the bean:cookie tag didn't work in Weblogic 6.0 because
> the bean:cookie test page didn't work. Maybe there should be a separate test
> page to assess the ability of a jsp engine to use jsp:getProperty for beans
> defined by means other than jsp:useBean. That seems like something the J2EE
> certification suite should test for rather than struts. 

<bean:cookie> does not work, because Weblogic does not implement the spec
correctly. There are a couple of things that should be done from my point
of view:

a) Notify BEA and request a fix
  (done three months ago for WLS 5.1, unsure what's with WLS6.0)

b) Until Bea supplies a fix, fix it on your own
  (done for WLS 5.1, see my mails from yesterday)
  
c) Change the test page(s) (applies to bean-cookie; logic-match; logic-present)
  They will fail on any container, if no cookie is present. The tag should use
  the value="FOO" attribute to get a default for missing cookies.
  (supplied updated JSPs yesterday to STRUTS-DEV, see my mail titled
   "struts-test w/ URLRewriting (Patch to enable...)" )

d) Change the test page, if you don't like a) and b) to gracefully catch,
  print and explain exceptions to the user.
  I think that a test-suite should not fail completly on a known bug. Either
  the bug should be fixed, or the suite should catch the error, print and
  explain it. People new to Struts may otherwise immediatly stop looking
  further into it, because it really doesn't matter to them where the
  exception comes from.

Matthias                        (mailto:make@BESToffers.de)