Hi

The nullpointer occurs because there is no check on the Inputstream in 
ClayAmalgam:

        InputStream in = null;
        try {
            in = context.getExternalContext().getResourceAsStream(url); 
<<<<<---- This could return null 
            int c = 0;
            done: while (true) {
                c = in.read();
                if (c > -1)
                    value.append((char) c);
                else
                    break done;
                
            }
        } catch (IOException e) {
            throw new RuntimeException(messages.getMessage("invalid.attribute", 
new Object[] {"url", "clayImport"}));
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {}
            }   
            
        }

If the url is not found, in is null.

Hermod


-----Original Message-----
From: Gary VanMatre [mailto:[EMAIL PROTECTED]
Sent: Monday, December 05, 2005 7:46 PM
To: Struts Users Mailing List
Subject: Re: [Shale] Clay - Links not working


Ok, that's a bug.  Before the HTML templates existed, the jsfid was a required 
attribute of the JSP tag.  We need to add a better exception.  Please create a 
bugzilla ticket with this information so that we don't loose site of it.

http://issues.apache.org/bugzilla/enter_bug.cgi?product=Struts

Thanks,
Gary

-------------- Original message -------------- 

> Ok, in my application I followed your directions to implement Tiles features 
> using Clay. 
> I have the following component declared in the global clay config : 
> 
> 
> 
> 
> 
> 
> 
> Then I have the page selectServices.xml wich contains : 
> 
> 
> > "-//Apache Software Foundation//DTD Shale Clay View Configuration 1.0 > 
> > //EN" 
> "http://struts.apache.org/dtds/shale-clay-config_1_0.dtd";> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> And finally the page gabarit.html wich has a basic structure like that : > 
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> 
> 
> 
> 
> 
> 

> 

> 

> 

> 

> 

> 
> 
> 
> If you run this, you will receive a NullPointerException because contenu > 
> symbol has the null value. So I was wondering if it was a correct behavior. 
> 
> On 12/5/05, Gary VanMatre wrote: 
> > 
> > > Something maybe that should improved is when the symbol value is null > > 
> > > > instead of getting a nullpointer exception maybe do like Tiles does. > 
> > > > > 
> > 
> > Clay's behavior handling symbol replacement should be as follows: 
> > 
> > If a symbol is null, it will be replaced as an empty string within the > > 
> > token if the token length is greater than the symbol. 
> > 
> > 
> > "testing @myvalue a symbol" --> "testing a symbol " 
> > 
> > If the symbol is null and the target expression's length is zero, the > > 
> > attribute is ignored and not passed to the component. 
> > 
> > 
> > "@myvalue" --> N/A, ignored 
> > 
> > If a symbol is not defined, it will not be replaced with the token. 
> > 
> > "@myvalue" --> "@myvalue" 
> > 
> > Somthing that I fixed last weekend was the case sensitivity on 
> > symbols. HTML attributes that are not defined by a bound component using 
> > the jsfid attribute, are considered symbols. 
> > 
> > 
> > 
> > 
> > 
> > The HTML parser normalizes the case of attributes to lower case. The 
> > token replacement is now case insensitive. The example above will now work. 
> > 
> > What is the scenario that you are talking about? Please give an example. 
> > 
> > > -- 
> > > Alexandre Poitras 
> > > Québec, Canada 
> > > 
> > 
> > Gary 
> > 
> 
> 
> 
> -- 
> Alexandre Poitras 
> Québec, Canada 
> 


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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

Reply via email to