[opencms-dev] create new Resource

Stephan Hartmann beffe at beffe.de
Tue Oct 28 21:03:01 CET 2003


HI,

the content that you pass to the method (in your case "hello") has to be
XML. It is the content of the control file. Take another page and view its
control file.

Bye,
Stephan


----- Original Message -----
From: "Federico Locci" <flocci at energit.it>
To: <opencms-dev at opencms.org>
Sent: Tuesday, October 28, 2003 5:56 PM
Subject: [opencms-dev] create new Resource


> hi all,.
>
> i'm trying to create a newResource, but i've a an error that i don't
> udenrstand.
>
> Help me please..
> the error is org.apache.jasper.JasperException: String index out of
> range: -1
>
> This is the code that i wrote:
>
> CmsJspActionElement cms = new CmsJspActionElement(pageContext,
> request,response);
>  CmsObject cmso = cms.getCmsObject();
>
>
> java.util.Hashtable properties = new Hashtable();
>
>
>     properties.put("Description","page");
>     properties.put("Keywords","page");
>     properties.put("NavPos","4.0");
>     properties.put("NavText","page");
>     properties.put("title","page");
>     properties.put("content-encoding","ISO-8859-1");
>     properties.put("export","page");
>     properties.put("exportname","page");
>
>
>
>     CmsResourceTypePage resource = new CmsResourceTypePage();
>     com.opencms.file.CmsResource newResource =
> resource.createResourceForTemplate(cmso,"new_page.html",properties,new
> String("hello").getBytes(),new
> String("/system/modules/org.opencms.default/templates/empty"));
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list