on 02-16-2006 4:43 PM
Hello,
I develop a portal application and I would access a xml file "getRooms.xml" in my JSPDynPage.
- I put my xml file under project <b>root</b>.
- I use the following code :
IPropertiesResource rooms = (IPropertiesResource)(request.getResource("xml", "getRooms.xml"));
But I've a FileNotFoundException, the system cannot find the file specified.
Must I put the xml file under a specific folder ?
Could you help me please ?
Thanks.
Delphine.
Hi Saravanan,
I'm not trying to get the resource from KM repository.
I develop a application in Eclipse, a portal application project. The hierarchy of this project are :
- src.api
- src.core
- dist : under this folder, there are others folders as "css", "images" and "scripts" where we can put resources (image.jsp under "images" for example).
I would use a xml file but I don't know where I put this resource in my project.
Have you an idea ?
Thanks.
Delphine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Delphine!
You have to put files in the following folders:
1. WEB resources: can be accessed from the outside by an HTTP request: <project_root>/dist/
2. Public resources: can be accessed by other portal components: <project_root>/dist/PORTAL-INF
3. Private resources: can only be accessed by the component itself: <project_root>/dist/PORTAL-INF/private
Within the different folder you can create any sub folders you need.
The file path can then be get by the IPortalComponentRequest.getPublicResourcePath(), getWebResourcePath() or getPrivateResourcePath() method.
example:
you put your xml file in the folder <project_root>/dist/PORTAL-INF/xml/file.xml
you can the get a java File object by using:
IPortalComponentRequest request;
String location =request.getPublicResourcePath()+"/xml/file.xml";
File f = new File(location);
Hi
I have a scenario like XI sends XML file to servlet
XI->J2EE application. For this am using HTTP adapter as receiver. I have to retrieve that XML file in my servlet and display the same in browser. How to do that, please help me.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Delphine,
If i understand properly, you are trying to get the resource from KM repository... right???
In that case you need to use RID.
RID rid = RID.getRID("/root/getRooms.xml");
IResourceContext resourceContext = new ResourceContext(user);
IResource resource =ResourceFactory.getInstance().getResource(rid, resourceContext);
Hope it helps.
regards,
Saravanan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.