ok i changed it to:

package com.ant.tests;

public class MyTestBean {
    public String setHelloBean() {
        System.out.println("hello bean");
        return("hello from bran");
    }
}

and it still don't work, also tryed your way. all this stuff worked before :(

ant


On 20 Nov 2007, at 14:12, David Smith wrote:

Umm... that's not a bean. Beans have getter and setter methods for it's properties. Here's pretty much the simplest bean class you can write:

package com.mycompany.myproject ;
public class myBean {
private String myProperty ;
public String getMyProperty() {
  return myProperty ;
public void setMyProperty( String newProp ) {
  this.myProperty = newProp ;
}
}

--David

anthony rogers wrote:

I've put my Bean in the 'magnolia/WEB-INF/lib' folder.
Yes its the first thing to exception; if i take the jsp:useBean tag out it doesn't error.
all my Bean as in it is:

package com.ant.tests;

public class MyTestBean {
   public void helloBean() {
       System.out.println("hello bean");
   }
}

i am using this as a test case, and it also has the same problem.
the server i am using is GlassFishv2 (all my other webapps that use Beans work fine, just if i use a Bean in magnolia it errors).

<jsp:useBean id="overworld" scope="session" class="com.ant.tests.MyTestBean" />

aNt

On 20 Nov 2007, at 01:35, David Smith wrote:

The exception message doesn't offer a lot of info. To my knowledge, Magnolia doesn't do anything that would interfere with your use of the jsp:useBean tag.

Is the exception the first one that appears when calling this template? Can you offer some detail regarding your bean? Where have you stored it?

--David

anthony rogers wrote:

if i do a simple template in magnolia 3.5_rc1 that looks like this:

<jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page"; xmlns:cms="urn:jsptld:cms-taglib" xmlns:cmsu="urn:jsptld:cms-util-taglib" xmlns:c="urn:jsptld:http://java.sun.com/jsp/jstl/core "
xmlns:fmt="urn:jsptld:http://java.sun.com/jsp/jstl/fmt";>
<jsp:directive.page contentType="text/html; charset=UTF-8" session="true" /> <jsp:useBean id="overworld" scope="session" class="com.ant.web.Overworld" />

  <jsp:directive.page import="info.magnolia.cms.util.Resource" />

  <jsp:text><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
  ]]></jsp:text>
      <html xmlns="http://www.w3.org/1999/xhtml";>
  <head>/head>
      <body>
          hello
      </body>
  </html>
</jsp:root>

with my bean added:
<jsp:useBean id="overworld" scope="session" class="com.ant.web.Overworld" />

i get this error:
org.apache.jasper.JasperException: java.lang.IllegalArgumentException: PWC2788: setAttribute: Non- serializable attribute

i can provide a bigger stack trace is needed? this error didn't happen on magnolia 3.0

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to