I'm trying to use the following Servlet to transform a XML to HTML but GlassFish server doesn't show any web page and reads this error " The requested resource is not available".
I guess the problem is from the address of XML and XSL files but I don't know where I must put them in my project. I use NetBeans IDE.
Bear Bibeault wrote:Not the way that the poster has written his code. The file I/O system needs the absolute path to the files. It doesn't know anything about the context.
If the poster wants to switch to using ServletContext.getResourceAsStream()and the files are within the context, then context-relative paths would be fine.
Would you please tell me where in my code I must add this statement and if I must make any other changes? And what do you mean by saying "within the context" is it like within the project directories? ( where do you suggest I place XSL and XML file? )
Thanks everybody for guides and recommendations.
I made the following code base on your recommendation but still get "Resource not available" message when I run the project through NetBeans/GlassFish
I added both XML/XSL files in XML directory and files are accessible via url like this: http://localhost:80/myProject/xml/xmlFilename.xml