[opencms-dev] create new Resource

Federico Locci flocci at energit.it
Tue Oct 28 18:28:01 CET 2003


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"));




More information about the opencms-dev mailing list