Hi,

For an application of mine, I need to list all pages, contained both in
libraries and under the WEB-INF directory.

In order to achieve this as soon as possible in the process, I have
created a WebRequestServicerFilter, initialized only once,
in charge of listing the pages and retrieving their specifications.

Here is the code:

IApplicationSpecification applicationSpecification = applicationGlobals
    .getSpecification();

Set<String> pageNames = new HashSet<String>();

// First, inits pages from libraries
... I get the pages through applicationSpecification.getLibraryIds()

// Second, inits pages declared in the application specification
... I get additional pages through applicationSpecification.getPageNames()

// Third, inits pages found under WEB-INF
String prefix = "/WEB-INF/";
String suffix = ".page";

... I get additional pages through servletContext.getResourcePaths(prefix)

At this stage, a Set<String> called pageNames is filled up 
with prefixed page names.

Then, for each page, I am trying to get its IComponentSpecification:

INamespace namespace = specificationSource.getApplicationNamespace();

for (Iterator<String> it = potentialPages.iterator(); it.hasNext();) {

  String pageName = it.next();
 

  // This is the line throwing a java.util.MissingResourceException
  // because:
  //   (1) there is a bug with a missing entry for
  //       'Namespace.no-such-page' (which I don't care)
  //   (2) the specification is NOT found (the REAL problem)

  IComponentSpecification specification = namespace
      .getPageSpecification(pageName);

}



The question is: is the specificationSource object initialized
at the time I am trying to access it? Or am I doing someting
wrong here?

Any help would be greatly appreciated, or a viable workaround
to get all page specifications loaded early in the application
startup process.


Thx
/H


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

Reply via email to